Spaces:
Sleeping
Sleeping
Commit
·
7d934c9
1
Parent(s):
8e41bfd
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ from fastcore.all import *
|
|
3 |
from fastai.vision.all import *
|
4 |
|
5 |
def classify_image(img):
|
6 |
-
learn = load_learner('nihal_model.pkl')
|
7 |
pred,pred_idx,probs = learn.predict(img)
|
8 |
#return both the prediction and the probability either nihal or not and format in perccentage
|
9 |
return pred, "{:.0%}".format(float(probs[pred_idx])),float(probs[~pred_idx])
|
|
|
3 |
from fastai.vision.all import *
|
4 |
|
5 |
def classify_image(img):
|
6 |
+
learn = load_learner('./nihal_model.pkl')
|
7 |
pred,pred_idx,probs = learn.predict(img)
|
8 |
#return both the prediction and the probability either nihal or not and format in perccentage
|
9 |
return pred, "{:.0%}".format(float(probs[pred_idx])),float(probs[~pred_idx])
|