Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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()
|
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=
|
62 |
-
gr.Label(label="Scene Classification", num_top_classes=
|
63 |
-
gr.Label(label="Expression Classification", num_top_classes=
|
64 |
-
gr.Label(label="Clothing Classification", num_top_classes=
|
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."
|