Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -57,9 +57,14 @@ for model in models:
|
|
57 |
|
58 |
def inference(images, min_score, model_name):
|
59 |
results = []
|
60 |
-
for image in images:
|
|
|
|
|
|
|
|
|
|
|
61 |
# Model expect BGR!
|
62 |
-
im = image[
|
63 |
|
64 |
model_id = model_name_to_id[model_name]
|
65 |
|
|
|
57 |
|
58 |
def inference(images, min_score, model_name):
|
59 |
results = []
|
60 |
+
for image in images:
|
61 |
+
r = requests.get(image)
|
62 |
+
if r:
|
63 |
+
im = np.frombuffer(r.content, dtype="uint8")
|
64 |
+
im = cv2.imdecode(im, cv2.IMREAD_COLOR_BGR2RGB)
|
65 |
+
else:
|
66 |
# Model expect BGR!
|
67 |
+
im = image[:,:,::-1]
|
68 |
|
69 |
model_id = model_name_to_id[model_name]
|
70 |
|