sfmig commited on
Commit
7839455
β€’
1 Parent(s): d35084c

changed default threshold for kpt detections

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -244,13 +244,15 @@ def predict_pipeline(img_input,
244
 
245
  # Produce final image
246
  img_background = Image.fromarray(md_results.imgs[0]) # img_input or Image.fromarray(md_results.imgs[0])?
247
- # Image.fromarray(md_results.imgs[0]) --> (640, 479)
248
- # img_input.size ---> (259, 194)
249
- # pdb.set_trace()
250
 
251
  # resize image to match megadetector output
 
252
  # g = (640 / max(img_background.size)) # gain
253
- # img_background = img_background.resize((int(x * g) for x in img_background.size), Image.ANTIALIAS) # resize
 
254
  for ic, (np_crop, kpts_crop) in enumerate(zip(list_crops,
255
  list_kpts_per_crop)):
256
 
@@ -298,7 +300,7 @@ gr_str_labels_checkbox = gr.inputs.Checkbox(True,
298
 
299
  gr_slider_conf_bboxes = gr.inputs.Slider(0,1,.05,0.8,
300
  label='Set confidence threshold for animal detections')
301
- gr_slider_conf_keypoints = gr.inputs.Slider(0,1,.05,0,
302
  label='Set confidence threshold for keypoints')
303
 
304
  # Data viz
 
244
 
245
  # Produce final image
246
  img_background = Image.fromarray(md_results.imgs[0]) # img_input or Image.fromarray(md_results.imgs[0])?
247
+ # # Image.fromarray(md_results.imgs[0]) --> (640, 479)
248
+ # # img_input.size ---> (259, 194)
249
+
250
 
251
  # resize image to match megadetector output
252
+ # img_background = img_input
253
  # g = (640 / max(img_background.size)) # gain
254
+ # img_background = img_background.resize((int(x * g) for x in img_background.size),
255
+ # Image.ANTIALIAS) # resize
256
  for ic, (np_crop, kpts_crop) in enumerate(zip(list_crops,
257
  list_kpts_per_crop)):
258
 
 
300
 
301
  gr_slider_conf_bboxes = gr.inputs.Slider(0,1,.05,0.8,
302
  label='Set confidence threshold for animal detections')
303
+ gr_slider_conf_keypoints = gr.inputs.Slider(0,1,.05,0.25,
304
  label='Set confidence threshold for keypoints')
305
 
306
  # Data viz