Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -65,8 +65,8 @@ def detect_objects(model_name,url_input,image_input,threshold):
|
|
65 |
|
66 |
model = YolosForObjectDetection.from_pretrained(model_name)
|
67 |
|
68 |
-
if
|
69 |
-
image = Image.open(requests.get(
|
70 |
|
71 |
elif image_upload:
|
72 |
image = image_upload
|
|
|
65 |
|
66 |
model = YolosForObjectDetection.from_pretrained(model_name)
|
67 |
|
68 |
+
if url_input and validators.url(url_input):
|
69 |
+
image = Image.open(requests.get(url_input, stream=True).raw)
|
70 |
|
71 |
elif image_upload:
|
72 |
image = image_upload
|