Spaces:
Sleeping
Sleeping
Commit
·
7f878cb
1
Parent(s):
f4deeea
Changed medseg.py file
Browse files- app/mediseg.py +2 -3
app/mediseg.py
CHANGED
@@ -297,9 +297,8 @@ def process_pneumonia(image: Image.Image, model_path=os.path.join("models", "pne
|
|
297 |
std=[0.229,0.224,0.225])
|
298 |
])
|
299 |
input_tensor = transform_img(image).unsqueeze(0).to(device)
|
300 |
-
|
301 |
-
|
302 |
-
predicted_class = output.argmax(dim=1).item()
|
303 |
label_text = "Pneumonia" if predicted_class == 1 else "Normal"
|
304 |
|
305 |
def get_bounding_box(heatmap, thresh=0.5, min_area=100):
|
|
|
297 |
std=[0.229,0.224,0.225])
|
298 |
])
|
299 |
input_tensor = transform_img(image).unsqueeze(0).to(device)
|
300 |
+
cam, output = grad_cam.generate(input_tensor)
|
301 |
+
predicted_class = output.argmax(dim=1).item()
|
|
|
302 |
label_text = "Pneumonia" if predicted_class == 1 else "Normal"
|
303 |
|
304 |
def get_bounding_box(heatmap, thresh=0.5, min_area=100):
|