wangjin2000 commited on
Commit
6b31ed6
·
verified ·
1 Parent(s): ee122ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -76,11 +76,11 @@ def detect_objects(image_path):
76
  def draw_bounding_boxes(img, results, dicom_meta):
77
  dets = []
78
  for (x1, y1, x2, y2), conf, cls in results:
 
79
  xc = x1+(x2-x1)/2
80
  yc = y1+(y2-y1)/2
81
- x1, y1, x2, y2, cls = map(int, [x1, y1, x2, y2, cls])
82
  conf = round(conf.detach().item(), 4)
83
- print("results in draw_bounding box:",[(x1, y1, x2, y2), conf, cls])
84
  zc = dicom_meta.loc[dicom_meta.Key == 'Instance Number', 'Value'].iloc[0]
85
  #dets.append([(x1, y1, x2, y2), conf, cls])
86
  dets.append([(xc, yc, zc), conf, cls])
 
76
  def draw_bounding_boxes(img, results, dicom_meta):
77
  dets = []
78
  for (x1, y1, x2, y2), conf, cls in results:
79
+ x1, y1, x2, y2, cls = map(int, [x1, y1, x2, y2, cls])
80
  xc = x1+(x2-x1)/2
81
  yc = y1+(y2-y1)/2
 
82
  conf = round(conf.detach().item(), 4)
83
+ #print("results in draw_bounding box:",[(x1, y1, x2, y2), conf, cls])
84
  zc = dicom_meta.loc[dicom_meta.Key == 'Instance Number', 'Value'].iloc[0]
85
  #dets.append([(x1, y1, x2, y2), conf, cls])
86
  dets.append([(xc, yc, zc), conf, cls])