Spaces:
Sleeping
Sleeping
Jambulat Soltomuradow commited on
Commit ·
c6b5593
1
Parent(s): 54d9850
added convertation image
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
from fastai.vision.all import *
|
| 2 |
import gradio as gr
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
learn = load_learner('model.pkl')
|
|
@@ -7,6 +8,7 @@ learn = load_learner('model.pkl')
|
|
| 7 |
categories = ('damaged', 'intact')
|
| 8 |
|
| 9 |
def classify_image(img):
|
|
|
|
| 10 |
pred,idx,probs = learn.predict(img)
|
| 11 |
return dict(zip(categories, map(float,probs)))
|
| 12 |
|
|
|
|
| 1 |
from fastai.vision.all import *
|
| 2 |
import gradio as gr
|
| 3 |
+
import numpy as np
|
| 4 |
|
| 5 |
|
| 6 |
learn = load_learner('model.pkl')
|
|
|
|
| 8 |
categories = ('damaged', 'intact')
|
| 9 |
|
| 10 |
def classify_image(img):
|
| 11 |
+
img = PILImage.create(np.array(img))
|
| 12 |
pred,idx,probs = learn.predict(img)
|
| 13 |
return dict(zip(categories, map(float,probs)))
|
| 14 |
|