fcakyon commited on
Commit
9313ffe
1 Parent(s): 7af3ac9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -24,7 +24,7 @@ def process_image(image):
24
  expression_text = tokenizer(expression_labels)
25
  clothing_text = tokenizer(clothing_labels)
26
 
27
- with torch.no_grad(), torch.cuda.amp.autocast():
28
  # Encode image and text
29
  image_features = model.encode_image(image)
30
  type_text_features = model.encode_text(type_text)
@@ -58,10 +58,10 @@ iface = gr.Interface(
58
  fn=process_image,
59
  inputs=gr.Image(type="pil", label="Upload Image"),
60
  outputs=[
61
- gr.Label(label="Type Classification", num_top_classes=3),
62
- gr.Label(label="Scene Classification", num_top_classes=3),
63
- gr.Label(label="Expression Classification", num_top_classes=3),
64
- gr.Label(label="Clothing Classification", num_top_classes=3)
65
  ],
66
  title="Image Content Moderation",
67
  description="Upload an image to analyze its content across multiple categories."
 
24
  expression_text = tokenizer(expression_labels)
25
  clothing_text = tokenizer(clothing_labels)
26
 
27
+ with torch.no_grad():
28
  # Encode image and text
29
  image_features = model.encode_image(image)
30
  type_text_features = model.encode_text(type_text)
 
58
  fn=process_image,
59
  inputs=gr.Image(type="pil", label="Upload Image"),
60
  outputs=[
61
+ gr.Label(label="Type Classification", num_top_classes=8),
62
+ gr.Label(label="Scene Classification", num_top_classes=8),
63
+ gr.Label(label="Expression Classification", num_top_classes=8),
64
+ gr.Label(label="Clothing Classification", num_top_classes=8)
65
  ],
66
  title="Image Content Moderation",
67
  description="Upload an image to analyze its content across multiple categories."