Spaces:
Runtime error
Runtime error
shikharyashmaurya
commited on
Commit
•
3d45f69
1
Parent(s):
5f0d3e8
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,6 @@ learn = load_learner('model.pkl')
|
|
9 |
categories = ('Dog', 'Cat')
|
10 |
|
11 |
def classify_image(img):
|
12 |
-
img = Image.open(img)
|
13 |
pred, idx, probs = learn.predict(img)
|
14 |
return {categories[i]: float(probs[i]) for i in range(len(categories))}
|
15 |
|
@@ -21,5 +20,5 @@ if uploaded_file is not None:
|
|
21 |
st.image(image, caption='Uploaded Image', use_column_width=True)
|
22 |
st.write("")
|
23 |
st.write("Classifying...")
|
24 |
-
result = classify_image(
|
25 |
st.write(result)
|
|
|
9 |
categories = ('Dog', 'Cat')
|
10 |
|
11 |
def classify_image(img):
|
|
|
12 |
pred, idx, probs = learn.predict(img)
|
13 |
return {categories[i]: float(probs[i]) for i in range(len(categories))}
|
14 |
|
|
|
20 |
st.image(image, caption='Uploaded Image', use_column_width=True)
|
21 |
st.write("")
|
22 |
st.write("Classifying...")
|
23 |
+
result = classify_image(image)
|
24 |
st.write(result)
|