wangjin2000
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -82,12 +82,11 @@ def draw_bounding_boxes(img, results):
|
|
82 |
return img
|
83 |
|
84 |
def show_preds_image(filepath):
|
85 |
-
#results, img0 = detect_objects(filepath)
|
86 |
results, img0, dicom_meta = detect_objects(filepath)
|
87 |
img_with_boxes = draw_bounding_boxes(img0, results)
|
88 |
-
|
89 |
#return cv2.cvtColor(img_with_boxes, cv2.COLOR_BGR2RGB)
|
90 |
-
return cv2.cvtColor(img_with_boxes, cv2.COLOR_BGR2RGB), dicom_meta
|
91 |
|
92 |
def read_and_preprocess_dicom(file_path: str):
|
93 |
"""
|
@@ -136,7 +135,8 @@ input_component = gr.File(label="Input DICOM Data")
|
|
136 |
#output_component = gr.components.Image(type="numpy", label="Output Image")
|
137 |
dicom_image = gr.Image(type="numpy", label="Output Image")
|
138 |
dicom_meta = gr.Dataframe(headers=None, label="Metadata")
|
139 |
-
|
|
|
140 |
|
141 |
# Create Gradio interface
|
142 |
interface = gr.Interface(
|
|
|
82 |
return img
|
83 |
|
84 |
def show_preds_image(filepath):
|
|
|
85 |
results, img0, dicom_meta = detect_objects(filepath)
|
86 |
img_with_boxes = draw_bounding_boxes(img0, results)
|
87 |
+
dets = results.to_pandas()
|
88 |
#return cv2.cvtColor(img_with_boxes, cv2.COLOR_BGR2RGB)
|
89 |
+
return cv2.cvtColor(img_with_boxes, cv2.COLOR_BGR2RGB), dets, dicom_meta
|
90 |
|
91 |
def read_and_preprocess_dicom(file_path: str):
|
92 |
"""
|
|
|
135 |
#output_component = gr.components.Image(type="numpy", label="Output Image")
|
136 |
dicom_image = gr.Image(type="numpy", label="Output Image")
|
137 |
dicom_meta = gr.Dataframe(headers=None, label="Metadata")
|
138 |
+
dets_res = gr.Dataframe(headers=None, label="Detections")
|
139 |
+
output_component = [dicom_image, dets_res, dicom_meta]
|
140 |
|
141 |
# Create Gradio interface
|
142 |
interface = gr.Interface(
|