Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,6 +19,8 @@ def anylize(img):
|
|
19 |
target_sizes = torch.tensor([image.shape[:2]])
|
20 |
results = processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.9)[0]
|
21 |
|
|
|
|
|
22 |
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
|
23 |
box = [round(i, 2) for i in box.tolist()]
|
24 |
return(
|
@@ -26,7 +28,6 @@ def anylize(img):
|
|
26 |
f"{round(score.item(), 3)} at location {box}"
|
27 |
)
|
28 |
|
29 |
-
# return "Hello " + img + "!"
|
30 |
|
31 |
app = gr.Interface(fn=anylize, inputs="image", outputs="text")
|
32 |
|
|
|
19 |
target_sizes = torch.tensor([image.shape[:2]])
|
20 |
results = processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.9)[0]
|
21 |
|
22 |
+
print(f"results: {results}")
|
23 |
+
|
24 |
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
|
25 |
box = [round(i, 2) for i in box.tolist()]
|
26 |
return(
|
|
|
28 |
f"{round(score.item(), 3)} at location {box}"
|
29 |
)
|
30 |
|
|
|
31 |
|
32 |
app = gr.Interface(fn=anylize, inputs="image", outputs="text")
|
33 |
|