Spaces:
Runtime error
Runtime error
Fix the demo error if no instance is detected.
Browse files
app.py
CHANGED
@@ -42,6 +42,8 @@ def fn(image):
|
|
42 |
im_h, im_w = img.shape[:2]
|
43 |
|
44 |
# instances.bboxes, instances.masks will be None, None if no obj is detected
|
|
|
|
|
45 |
|
46 |
for ii, (xywh, mask) in enumerate(zip(instances.bboxes, instances.masks)):
|
47 |
color = get_color(ii)
|
|
|
42 |
im_h, im_w = img.shape[:2]
|
43 |
|
44 |
# instances.bboxes, instances.masks will be None, None if no obj is detected
|
45 |
+
if instances.bboxes is None:
|
46 |
+
return Image.fromarray(drawed[..., ::-1])
|
47 |
|
48 |
for ii, (xywh, mask) in enumerate(zip(instances.bboxes, instances.masks)):
|
49 |
color = get_color(ii)
|