Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -95,6 +95,8 @@ def detect_objects2(model_name,url_input,image_input,threshold):
|
|
95 |
|
96 |
#Visualize prediction
|
97 |
viz_img = visualize_prediction(image, processed_outputs, threshold, model.config.id2label)
|
|
|
|
|
98 |
|
99 |
return processed_outputs["labels"][keep].tolist()
|
100 |
|
|
|
95 |
|
96 |
#Visualize prediction
|
97 |
viz_img = visualize_prediction(image, processed_outputs, threshold, model.config.id2label)
|
98 |
+
|
99 |
+
keep = processed_outputs["scores"] > threshold
|
100 |
|
101 |
return processed_outputs["labels"][keep].tolist()
|
102 |
|