Update app.py
Browse files
app.py
CHANGED
|
@@ -1,21 +1,21 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import requests
|
| 3 |
-
import json
|
| 4 |
-
from io import BytesIO
|
| 5 |
-
|
| 6 |
-
st.title('Face Expression Prediction')
|
| 7 |
-
|
| 8 |
-
image_file = st.file_uploader("Upload Image")
|
| 9 |
-
|
| 10 |
-
if image_file is not None:
|
| 11 |
-
image = image_file.getvalue()
|
| 12 |
-
|
| 13 |
-
response = response.post(
|
| 14 |
-
"https://dpatel9923",
|
| 15 |
-
files = {
|
| 16 |
-
"image": ByteIO(image)
|
| 17 |
-
}
|
| 18 |
-
)
|
| 19 |
-
|
| 20 |
-
label = json.loads(response._content)
|
| 21 |
st.write(f"Expression of Face is {label['label']}")
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import requests
|
| 3 |
+
import json
|
| 4 |
+
from io import BytesIO
|
| 5 |
+
|
| 6 |
+
st.title('Face Expression Prediction')
|
| 7 |
+
|
| 8 |
+
image_file = st.file_uploader("Upload Image")
|
| 9 |
+
|
| 10 |
+
if image_file is not None:
|
| 11 |
+
image = image_file.getvalue()
|
| 12 |
+
|
| 13 |
+
response = response.post(
|
| 14 |
+
"https://dpatel9923-face-expression-prediction.hf.space/prediction",
|
| 15 |
+
files = {
|
| 16 |
+
"image": ByteIO(image)
|
| 17 |
+
}
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
label = json.loads(response._content)
|
| 21 |
st.write(f"Expression of Face is {label['label']}")
|