wangjin2000 commited on
Commit
59e42e5
·
verified ·
1 Parent(s): e6467ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -6
app.py CHANGED
@@ -82,8 +82,6 @@ def draw_bounding_boxes(img, results):
82
 
83
  def show_preds_image(filepath):
84
  results, img0 = detect_objects(filepath)
85
- print("in show preds:",results)
86
- #results = detect_objects(filepath)
87
  img_with_boxes = draw_bounding_boxes(img0, results)
88
  return cv2.cvtColor(img_with_boxes, cv2.COLOR_BGR2RGB)
89
 
@@ -114,7 +112,6 @@ def read_and_preprocess_dicom(file_path: str):
114
  image = image_pil.convert('RGB')
115
 
116
  print("In preprocess dicom:", image.size)
117
- #image = np.array(numpydata)[::-1].copy()
118
  image = np.array(image)[:,:,::-1].copy()
119
 
120
  # shape
@@ -130,8 +127,6 @@ def read_and_preprocess_dicom(file_path: str):
130
  return image, df_metadata.to_pandas() # Convert to pandas DataFrame for Gradio compatibility
131
 
132
  # Define Gradio components
133
- #input_component = gr.components.Image(type="filepath", label="Input Image")
134
- #input_component = gr.components.Image(type="pil", label="Input Image")
135
  input_component = gr.File(label="Input DICOM Data")
136
  output_component = gr.components.Image(type="numpy", label="Output Image")
137
 
@@ -142,7 +137,7 @@ interface = gr.Interface(
142
  outputs=output_component,
143
  title="Lung Nodule Detection",
144
  examples=['samples/81_80.dcm','samples/110_109.dcm','samples/189_188.dcm'],
145
- description=' "This online deployment proves the effectiveness and efficient function of the machine learning model in identifying lung cancer nodules. The implementation of YOLO for core detection tasks is employed that is an efficient and accurate algorithm for object detection. Through the precise hyper-parameter tuning process, the model proposed in this paper has given an impressive boost in the performance. Moreover, the model uses Retinanet algorithm which is recognized as the powerful tool effective in dense object detection. In an attempt to enhance the model’s performance, the backbone of this architecture consists of a Feature Pyramid Network (FPN). The FPN plays an important role in boosting the model’s capacity in recognizing objects in different scales through the construction of high semantic feature map in different resolutions. In conclusion, this deployment encompasses YOLOv5, hyperparameter optimization, Retinanet, and FPN as one of the most effective and modern solutions for the detection of lung cancer nodules." ~ Basil Shaji 😇',
146
  live=False,
147
  )
148
 
 
82
 
83
  def show_preds_image(filepath):
84
  results, img0 = detect_objects(filepath)
 
 
85
  img_with_boxes = draw_bounding_boxes(img0, results)
86
  return cv2.cvtColor(img_with_boxes, cv2.COLOR_BGR2RGB)
87
 
 
112
  image = image_pil.convert('RGB')
113
 
114
  print("In preprocess dicom:", image.size)
 
115
  image = np.array(image)[:,:,::-1].copy()
116
 
117
  # shape
 
127
  return image, df_metadata.to_pandas() # Convert to pandas DataFrame for Gradio compatibility
128
 
129
  # Define Gradio components
 
 
130
  input_component = gr.File(label="Input DICOM Data")
131
  output_component = gr.components.Image(type="numpy", label="Output Image")
132
 
 
137
  outputs=output_component,
138
  title="Lung Nodule Detection",
139
  examples=['samples/81_80.dcm','samples/110_109.dcm','samples/189_188.dcm'],
140
+ description= "This online deployment proves the effectiveness and efficient function of the machine learning model in identifying lung cancer nodules.",
141
  live=False,
142
  )
143