Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -200,15 +200,15 @@ def generate_sgg(image):
|
|
200 |
label = obj["id"]
|
201 |
draw.rectangle(bbox, outline="red", width=3)
|
202 |
draw.text((bbox[0], bbox[1] - 15), label, fill="red", font=font)
|
203 |
-
except:
|
204 |
-
pass
|
205 |
|
206 |
-
|
|
|
|
|
207 |
|
208 |
gr.Interface(
|
209 |
fn=generate_sgg,
|
210 |
inputs=gr.Image(type="pil"),
|
211 |
-
outputs="
|
212 |
title="R1-SGG: Compile Scene Graphs with Reinforcement Learning",
|
213 |
description="Upload an image and generate a structured scene graph in JSON format."
|
214 |
).launch()
|
|
|
200 |
label = obj["id"]
|
201 |
draw.rectangle(bbox, outline="red", width=3)
|
202 |
draw.text((bbox[0], bbox[1] - 15), label, fill="red", font=font)
|
|
|
|
|
203 |
|
204 |
+
return image, json.dumps(resp)
|
205 |
+
except:
|
206 |
+
return image, resp
|
207 |
|
208 |
gr.Interface(
|
209 |
fn=generate_sgg,
|
210 |
inputs=gr.Image(type="pil"),
|
211 |
+
outputs=[gr.Image(type="pil"), gr.Textbox(label="Scene Graph")],
|
212 |
title="R1-SGG: Compile Scene Graphs with Reinforcement Learning",
|
213 |
description="Upload an image and generate a structured scene graph in JSON format."
|
214 |
).launch()
|