Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -64,10 +64,8 @@ def detect_objects_from_url(model_name,url,threshold):
|
|
64 |
|
65 |
model = YolosForObjectDetection.from_pretrained(model_name)
|
66 |
|
67 |
-
if url:
|
68 |
-
|
69 |
-
if validators.url(url):
|
70 |
-
image = Image.open(requests.get(url, stream=True).raw)
|
71 |
|
72 |
#Make prediction
|
73 |
processed_outputs = make_prediction(image, feature_extractor, model)
|
|
|
64 |
|
65 |
model = YolosForObjectDetection.from_pretrained(model_name)
|
66 |
|
67 |
+
if url and validators.url(url):
|
68 |
+
image = Image.open(requests.get(url, stream=True).raw)
|
|
|
|
|
69 |
|
70 |
#Make prediction
|
71 |
processed_outputs = make_prediction(image, feature_extractor, model)
|