Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import PIL.Image
|
|
| 6 |
from fastai.vision.all import *
|
| 7 |
import pathlib
|
| 8 |
|
| 9 |
-
import matplotlib.pyplot as
|
| 10 |
|
| 11 |
plt = platform.system()
|
| 12 |
if plt == 'Windows': pathlib.PosixPath = pathlib.WindowsPath
|
|
@@ -29,12 +29,12 @@ def show_likelihood(pred_label):
|
|
| 29 |
classes = ["Temple", "You", "Me", "You", "Friend", "Love", "Enough", "Church","Mosque"]
|
| 30 |
class_labels = [classes[i] for i in range(len(class_probs))]
|
| 31 |
fig = plt.figure(figsize=(10, 10))
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
st.pyplot(fig)
|
| 39 |
|
| 40 |
def main():
|
|
|
|
| 6 |
from fastai.vision.all import *
|
| 7 |
import pathlib
|
| 8 |
|
| 9 |
+
import matplotlib.pyplot as pt
|
| 10 |
|
| 11 |
plt = platform.system()
|
| 12 |
if plt == 'Windows': pathlib.PosixPath = pathlib.WindowsPath
|
|
|
|
| 29 |
classes = ["Temple", "You", "Me", "You", "Friend", "Love", "Enough", "Church","Mosque"]
|
| 30 |
class_labels = [classes[i] for i in range(len(class_probs))]
|
| 31 |
fig = plt.figure(figsize=(10, 10))
|
| 32 |
+
pt.barh(class_labels, class_probs)
|
| 33 |
+
pt.ylabel("Class")
|
| 34 |
+
pt.xlabel("Probability")
|
| 35 |
+
pt.title("Class Probabilities")
|
| 36 |
+
pt.xlim(0, 1)
|
| 37 |
+
pt.ylim(-1, len(class_probs))
|
| 38 |
st.pyplot(fig)
|
| 39 |
|
| 40 |
def main():
|