Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,12 +10,12 @@ def obj(input_img):
|
|
| 10 |
model = project.version(1).model
|
| 11 |
|
| 12 |
#save to .jpg
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
|
| 17 |
#predict
|
| 18 |
-
obj_result = model.predict(
|
| 19 |
if obj_result == "Low Bone":
|
| 20 |
obj_result = "Osteopenia"
|
| 21 |
|
|
|
|
| 10 |
model = project.version(1).model
|
| 11 |
|
| 12 |
#save to .jpg
|
| 13 |
+
img = Image.fromarray(input_img, "RGB")
|
| 14 |
+
img.save("image_filename.jpg")
|
| 15 |
+
image_save_test = 'image_filename.jpg'
|
| 16 |
|
| 17 |
#predict
|
| 18 |
+
obj_result = model.predict(image_save_test, confidence=40, overlap=30).json()['predictions'][0]['class']
|
| 19 |
if obj_result == "Low Bone":
|
| 20 |
obj_result = "Osteopenia"
|
| 21 |
|