calmdowngirl commited on
Commit
379655b
·
1 Parent(s): 8ce1df4

skip draw when none is detected

Browse files
Files changed (1) hide show
  1. ppl_detector.py +4 -2
ppl_detector.py CHANGED
@@ -23,7 +23,7 @@ def detect(img):
23
  return None
24
 
25
  print("processing img...")
26
-
27
  objects = detector(source)
28
  persons = [
29
  o for o in objects
@@ -32,7 +32,9 @@ def detect(img):
32
  n = len(persons)
33
  result = f"it's got {n} {'ppl' if n > 1 else 'person'} in the image"
34
 
35
- draw_bbox(bboxes)
 
 
36
  return source
37
 
38
  def set_result(*args):
 
23
  return None
24
 
25
  print("processing img...")
26
+
27
  objects = detector(source)
28
  persons = [
29
  o for o in objects
 
32
  n = len(persons)
33
  result = f"it's got {n} {'ppl' if n > 1 else 'person'} in the image"
34
 
35
+ if n > 0:
36
+ draw_bbox(bboxes)
37
+
38
  return source
39
 
40
  def set_result(*args):