Spaces:
Sleeping
Sleeping
app.py
Browse files
app.py
CHANGED
|
@@ -36,11 +36,11 @@ model.eval()
|
|
| 36 |
|
| 37 |
def inference(img_dir):
|
| 38 |
image = np.array(Image.open(str(img_dir)).convert('L'))
|
| 39 |
-
|
| 40 |
-
|
| 41 |
out = model(image).item()
|
| 42 |
-
|
| 43 |
-
|
| 44 |
|
| 45 |
examples = ["NF1.jpg", "NF2.jpg", "NF3.jpg", "F1.jpg", "F2.jpg", "F3.jpg"]
|
| 46 |
|
|
|
|
| 36 |
|
| 37 |
def inference(img_dir):
|
| 38 |
image = np.array(Image.open(str(img_dir)).convert('L'))
|
| 39 |
+
image = transforms(image=image)['image']
|
| 40 |
+
with torch.inference_mode():
|
| 41 |
out = model(image).item()
|
| 42 |
+
out = out > 0
|
| 43 |
+
return "Fracture +" if out else "Fracture -"
|
| 44 |
|
| 45 |
examples = ["NF1.jpg", "NF2.jpg", "NF3.jpg", "F1.jpg", "F2.jpg", "F3.jpg"]
|
| 46 |
|