wangjin2000 commited on
Commit
f5251c8
·
verified ·
1 Parent(s): ddb6193

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -84,9 +84,8 @@ def draw_bounding_boxes(img, results):
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,7 +134,7 @@ input_component = gr.File(label="Input DICOM Data")
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
 
84
  def show_preds_image(filepath):
85
  results, img0, dicom_meta = detect_objects(filepath)
86
  img_with_boxes = draw_bounding_boxes(img0, results)
 
87
  #return cv2.cvtColor(img_with_boxes, cv2.COLOR_BGR2RGB)
88
+ return cv2.cvtColor(img_with_boxes, cv2.COLOR_BGR2RGB), results, dicom_meta
89
 
90
  def read_and_preprocess_dicom(file_path: str):
91
  """
 
134
  #output_component = gr.components.Image(type="numpy", label="Output Image")
135
  dicom_image = gr.Image(type="numpy", label="Output Image")
136
  dicom_meta = gr.Dataframe(headers=None, label="Metadata")
137
+ dets_res = gr.Text(headers=None, label="Detections")
138
  output_component = [dicom_image, dets_res, dicom_meta]
139
 
140
  # Create Gradio interface