apailang commited on
Commit
0231808
β€’
1 Parent(s): 5dad358

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -51,6 +51,9 @@ def predict(pilimg,Threshold):
51
  def predict2(image_np,Threshold):
52
 
53
  results = detection_model(image_np)
 
 
 
54
 
55
  # different object detection models have additional results
56
  result = {key:value.numpy() for key,value in results.items()}
@@ -66,7 +69,7 @@ def predict2(image_np,Threshold):
66
  category_index,
67
  use_normalized_coordinates=True,
68
  max_boxes_to_draw=20,
69
- min_score_thresh=threshold_d,#0.38,
70
  agnostic_mode=False,
71
  line_thickness=2)
72
 
@@ -93,7 +96,7 @@ def predict3(image_np,Threshold):
93
  category_index,
94
  use_normalized_coordinates=True,
95
  max_boxes_to_draw=20,
96
- min_score_thresh=threshold_d,#.38,
97
  agnostic_mode=False,
98
  line_thickness=2)
99
 
 
51
  def predict2(image_np,Threshold):
52
 
53
  results = detection_model(image_np)
54
+
55
+ if Threshold is None or Threshold == 0:
56
+ Threshold=threshold_d
57
 
58
  # different object detection models have additional results
59
  result = {key:value.numpy() for key,value in results.items()}
 
69
  category_index,
70
  use_normalized_coordinates=True,
71
  max_boxes_to_draw=20,
72
+ min_score_thresh=threshold,#0.38,
73
  agnostic_mode=False,
74
  line_thickness=2)
75
 
 
96
  category_index,
97
  use_normalized_coordinates=True,
98
  max_boxes_to_draw=20,
99
+ min_score_thresh=threshold,#.38,
100
  agnostic_mode=False,
101
  line_thickness=2)
102