Spaces:
Runtime error
Runtime error
Samantha Hipple
commited on
Commit
·
92c22ec
1
Parent(s):
dcdc943
changed image to file_name
Browse files
app.py
CHANGED
@@ -12,14 +12,20 @@ file_name = st.file_uploader("Upload a photo of your face.")
|
|
12 |
# file_name = st.file_uploader("Upload a hot dog candidate image")
|
13 |
|
14 |
if file_name is not None:
|
|
|
15 |
col1, col2 = st.columns(2)
|
16 |
|
|
|
17 |
image = Image.open(file_name)
|
|
|
18 |
col1.image(image, use_column_width=True)
|
19 |
-
|
|
|
|
|
20 |
# predictions = pipeline(image)
|
21 |
|
22 |
-
|
|
|
23 |
# for p in predictions:
|
24 |
for emotion in predictions['emotion']:
|
25 |
# col2.subheader(f"{ p['label'] }: { round(p['score'] * 100, 1)}%")
|
|
|
12 |
# file_name = st.file_uploader("Upload a hot dog candidate image")
|
13 |
|
14 |
if file_name is not None:
|
15 |
+
# make two columns
|
16 |
col1, col2 = st.columns(2)
|
17 |
|
18 |
+
# capture image
|
19 |
image = Image.open(file_name)
|
20 |
+
# to display in in column 1
|
21 |
col1.image(image, use_column_width=True)
|
22 |
+
|
23 |
+
# capture predictions
|
24 |
+
predictions = DeepFace.analyze(file_name, actions=['emotion'])
|
25 |
# predictions = pipeline(image)
|
26 |
|
27 |
+
# to display in column 2
|
28 |
+
col2.header("Emotion Probabilities")
|
29 |
# for p in predictions:
|
30 |
for emotion in predictions['emotion']:
|
31 |
# col2.subheader(f"{ p['label'] }: { round(p['score'] * 100, 1)}%")
|