wangjin2000
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -81,7 +81,7 @@ def detect_objects(image_path):
|
|
81 |
pred = infer(model, img)
|
82 |
#results = postprocess(pred, img0.shape, img)
|
83 |
results = postprocess(pred, dicom_image, img)
|
84 |
-
return results
|
85 |
|
86 |
def draw_bounding_boxes(img, results):
|
87 |
for (x1, y1, x2, y2), conf, cls in results:
|
@@ -92,6 +92,7 @@ def draw_bounding_boxes(img, results):
|
|
92 |
|
93 |
def show_preds_image(filepath):
|
94 |
results, img0 = detect_objects(filepath)
|
|
|
95 |
#results = detect_objects(filepath)
|
96 |
#img0 = cv2.imread(filepath)
|
97 |
img_with_boxes = draw_bounding_boxes(img0, results)
|
|
|
81 |
pred = infer(model, img)
|
82 |
#results = postprocess(pred, img0.shape, img)
|
83 |
results = postprocess(pred, dicom_image, img)
|
84 |
+
return results, dicom_image
|
85 |
|
86 |
def draw_bounding_boxes(img, results):
|
87 |
for (x1, y1, x2, y2), conf, cls in results:
|
|
|
92 |
|
93 |
def show_preds_image(filepath):
|
94 |
results, img0 = detect_objects(filepath)
|
95 |
+
print("in show preds:",results)
|
96 |
#results = detect_objects(filepath)
|
97 |
#img0 = cv2.imread(filepath)
|
98 |
img_with_boxes = draw_bounding_boxes(img0, results)
|