yeftakun commited on
Commit
70ff502
·
verified ·
1 Parent(s): ceb898d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -4,8 +4,8 @@ from PIL import Image
4
  import requests
5
 
6
  # Load the model and processor
7
- processor = ViTImageProcessor.from_pretrained('yeftakun/vit-base-nsfw-detector')
8
- model = AutoModelForImageClassification.from_pretrained('yeftakun/vit-base-nsfw-detector')
9
 
10
  # Define prediction function
11
  def predict_image(image_url):
@@ -29,9 +29,9 @@ def predict_image(image_url):
29
  # Create Gradio interface
30
  iface = gr.Interface(
31
  fn=predict_image,
32
- inputs=gr.inputs.Textbox(label="Image URL"),
33
- outputs=gr.outputs.Textbox(label="Predicted Class"),
34
- title="NSFW Image Detection"
35
  )
36
 
37
  # Launch the interface
 
4
  import requests
5
 
6
  # Load the model and processor
7
+ processor = ViTImageProcessor.from_pretrained('AdamCodd/vit-base-nsfw-detector')
8
+ model = AutoModelForImageClassification.from_pretrained('AdamCodd/vit-base-nsfw-detector')
9
 
10
  # Define prediction function
11
  def predict_image(image_url):
 
29
  # Create Gradio interface
30
  iface = gr.Interface(
31
  fn=predict_image,
32
+ inputs=gr.Textbox(label="Image URL"),
33
+ outputs=gr.Textbox(label="Predicted Class"),
34
+ title="NSFW Image Classifier"
35
  )
36
 
37
  # Launch the interface