Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -18,9 +18,8 @@ app.add_middleware(
|
|
18 |
|
19 |
|
20 |
|
21 |
-
|
22 |
@app.get("/predict")
|
23 |
-
names = {0: 'breaking-stage', 1: 'half-riping-stage', 2: 'overripe un-healthy', 3: 'ripe', 4: 'ripe_with_consumable_disease', 5: 'unripe'}
|
24 |
async def get_prediction():
|
25 |
# Predict with the model
|
26 |
results = model('test.jpg')
|
@@ -28,4 +27,4 @@ async def get_prediction():
|
|
28 |
for r in results:
|
29 |
print(names[int(r.probs[top1])])
|
30 |
|
31 |
-
return
|
|
|
18 |
|
19 |
|
20 |
|
21 |
+
names = {0: 'breaking-stage', 1: 'half-riping-stage', 2: 'overripe un-healthy', 3: 'ripe', 4: 'ripe_with_consumable_disease', 5: 'unripe'}
|
22 |
@app.get("/predict")
|
|
|
23 |
async def get_prediction():
|
24 |
# Predict with the model
|
25 |
results = model('test.jpg')
|
|
|
27 |
for r in results:
|
28 |
print(names[int(r.probs[top1])])
|
29 |
|
30 |
+
return r.probs
|