sfmig commited on
Commit
b658361
β€’
1 Parent(s): 9a8a433

inspecting yolo parameters

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -99,7 +99,11 @@ def predict_md(im,
99
  g = (size / max(im.size)) # multipl factor to make max size of the image equal to input size
100
  im = im.resize((int(x * g) for x in im.size),
101
  Image.ANTIALIAS) # resize
102
- MD_model = torch.hub.load('ultralytics/yolov5', 'custom', Megadet_Models[mega_model_input])
 
 
 
 
103
 
104
  ## detect objects
105
  results = MD_model(im) # inference # vars(results).keys()= dict_keys(['imgs', 'pred', 'names', 'files', 'times', 'xyxy', 'xywh', 'xyxyn', 'xywhn', 'n', 't', 's'])
@@ -132,6 +136,7 @@ def crop_animal_detections(yolo_results,
132
  pred_label = det_array[j,5]
133
 
134
  # keep animal crops above threshold
 
135
  if (pred_label == list_labels_as_str.index('animal')) and \
136
  (pred_llk >= likelihood_th):
137
  area = (xmin_rd, ymin_rd, xmax_rd, ymax_rd)
 
99
  g = (size / max(im.size)) # multipl factor to make max size of the image equal to input size
100
  im = im.resize((int(x * g) for x in im.size),
101
  Image.ANTIALIAS) # resize
102
+ MD_model = torch.hub.load('ultralytics/yolov5',
103
+ 'custom',
104
+ path = Megadet_Models[mega_model_input],
105
+ force_reload = True,
106
+ source='github')
107
 
108
  ## detect objects
109
  results = MD_model(im) # inference # vars(results).keys()= dict_keys(['imgs', 'pred', 'names', 'files', 'times', 'xyxy', 'xywh', 'xyxyn', 'xywhn', 'n', 't', 's'])
 
136
  pred_label = det_array[j,5]
137
 
138
  # keep animal crops above threshold
139
+ pdb.set_trace()
140
  if (pred_label == list_labels_as_str.index('animal')) and \
141
  (pred_llk >= likelihood_th):
142
  area = (xmin_rd, ymin_rd, xmax_rd, ymax_rd)