Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -75,7 +75,7 @@ def detect_objects_from_url(model_name,url,threshold):
|
|
| 75 |
|
| 76 |
return viz_img
|
| 77 |
|
| 78 |
-
|
| 79 |
|
| 80 |
#Extract model and feature extractor
|
| 81 |
feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
|
|
@@ -98,7 +98,7 @@ def detect_objects_from_url(model_name,url,threshold):
|
|
| 98 |
viz_img = visualize_prediction(image, processed_outputs, threshold, model.config.id2label)
|
| 99 |
|
| 100 |
return viz_img
|
| 101 |
-
|
| 102 |
#examples=[['facebook/detr-resnet-50','https://media-cldnry.s-nbcnews.com/image/upload/t_fit-1500w,f_auto,q_auto:best/newscms/2020_14/3290756/200331-wall-street-ew-#343p.jpg',,0.7]
|
| 103 |
|
| 104 |
|
|
|
|
| 75 |
|
| 76 |
return viz_img
|
| 77 |
|
| 78 |
+
def detect_objects_from_upload(model_name,image_upload,threshold):
|
| 79 |
|
| 80 |
#Extract model and feature extractor
|
| 81 |
feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
|
|
|
|
| 98 |
viz_img = visualize_prediction(image, processed_outputs, threshold, model.config.id2label)
|
| 99 |
|
| 100 |
return viz_img
|
| 101 |
+
|
| 102 |
#examples=[['facebook/detr-resnet-50','https://media-cldnry.s-nbcnews.com/image/upload/t_fit-1500w,f_auto,q_auto:best/newscms/2020_14/3290756/200331-wall-street-ew-#343p.jpg',,0.7]
|
| 103 |
|
| 104 |
|