t4ai commited on
Commit
55b849d
1 Parent(s): 1d2259d
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -68,11 +68,13 @@ def process_inference_result(result, class_colors):
68
 
69
  return img, label_counts
70
 
71
- def get_detection_count_display(classes):
72
- if(len(classes)):
 
 
73
  disp_str = "[Aircraft detected] "
74
- for class_name, count in classes.items():
75
- disp_str += class_name + ": " + str(count) + " "
76
  else:
77
  disp_str = "[No aircraft detected]"
78
  return disp_str
 
68
 
69
  return img, label_counts
70
 
71
+ def get_detection_count_display(classes):
72
+ class_names = classes["class"]
73
+ counts = classes["count"]
74
+ if(len(classes)):
75
  disp_str = "[Aircraft detected] "
76
+ for i, c in enumerate(class_names):
77
+ disp_str += c + ": " + str(counts[i]) + " "
78
  else:
79
  disp_str = "[No aircraft detected]"
80
  return disp_str