ljsabc commited on
Commit
3dfc879
1 Parent(s): a1cfe96

Fix the demo error if no instance is detected.

Browse files
Files changed (1) hide show
  1. app.py +2 -0
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)