Update app.py
Browse files
app.py
CHANGED
@@ -90,7 +90,9 @@ def postprocess(pred, img0_shape, img):
|
|
90 |
return results
|
91 |
|
92 |
def detect_objects(image_path):
|
93 |
-
|
|
|
|
|
94 |
pred = infer(model, img)
|
95 |
results = postprocess(pred, img0.shape, img)
|
96 |
return results
|
@@ -199,8 +201,10 @@ def build_interface():
|
|
199 |
example = gr.Examples(
|
200 |
['samples/81_80.dcm','samples/110_109.dcm','samples/189_188.dcm'],
|
201 |
inputs=inputs,
|
202 |
-
outputs=outputs,
|
203 |
-
|
|
|
|
|
204 |
cache_examples=True
|
205 |
)
|
206 |
|
|
|
90 |
return results
|
91 |
|
92 |
def detect_objects(image_path):
|
93 |
+
dicom_image, dicom_meta = read_and_preprocess_dicom(image_path)
|
94 |
+
#img, img0 = preprocess_image(image_path)
|
95 |
+
img, img0 = preprocess_image(dicom_image)
|
96 |
pred = infer(model, img)
|
97 |
results = postprocess(pred, img0.shape, img)
|
98 |
return results
|
|
|
201 |
example = gr.Examples(
|
202 |
['samples/81_80.dcm','samples/110_109.dcm','samples/189_188.dcm'],
|
203 |
inputs=inputs,
|
204 |
+
#outputs=outputs,
|
205 |
+
outputs=dicom_image,
|
206 |
+
#fn=read_and_preprocess_dicom,
|
207 |
+
fn=show_preds_image,
|
208 |
cache_examples=True
|
209 |
)
|
210 |
|