Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,24 +4,18 @@ import requests
|
|
4 |
import streamlit as st
|
5 |
|
6 |
"""
|
7 |
-
#
|
8 |
-
This is a classifier for images
|
9 |
"""
|
10 |
-
|
11 |
def predict(img):
|
12 |
st.image(img, caption="Your image", use_column_width=True)
|
13 |
pred, key, probs = learn_inf.predict(img)
|
14 |
# st.write(learn_inf.predict(img))
|
15 |
|
16 |
-
f"""
|
17 |
-
## This **{'is ' if pred == 'mi' else 'is not'}** an MI (heart attack).
|
18 |
-
### Rediction result: {pred}
|
19 |
-
### Probability of {pred}: {probs[key].item()*100: .2f}%
|
20 |
-
"""
|
21 |
|
22 |
|
23 |
path = "./"
|
24 |
-
learn_inf = load_learner(path + "
|
25 |
|
26 |
option = st.radio("", ["Upload Image", "Image URL"])
|
27 |
|
|
|
4 |
import streamlit as st
|
5 |
|
6 |
"""
|
7 |
+
# Sustainable energy classifacation
|
8 |
+
This is a classifier for images ofSustainable energy.
|
9 |
"""
|
|
|
10 |
def predict(img):
|
11 |
st.image(img, caption="Your image", use_column_width=True)
|
12 |
pred, key, probs = learn_inf.predict(img)
|
13 |
# st.write(learn_inf.predict(img))
|
14 |
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
|
17 |
path = "./"
|
18 |
+
learn_inf = load_learner(path + "resnet34_stage-1.pkl")
|
19 |
|
20 |
option = st.radio("", ["Upload Image", "Image URL"])
|
21 |
|