Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -38,100 +38,13 @@ if st.button("Predict Emotions") and uploaded_images:
|
|
38 |
col.write(f"Original File Name: {file_names[i]}") # Display original file name
|
39 |
|
40 |
# Display the keys and values of all results
|
41 |
-
#for j, result in enumerate(results):
|
42 |
-
# st.write(f"Keys and Values of results[{j}]:")
|
43 |
-
# for key, value in result.items():
|
44 |
-
# st.write(f"Key: {key}, Value: {value}")
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
#for i, result in enumerate(results):
|
50 |
-
# st.write(f"Keys and Values of results[{i}]:")
|
51 |
-
# for j, res in enumerate(result):
|
52 |
-
# #st.write(f"Result {j}:")
|
53 |
-
# for key, value in res.items():
|
54 |
-
# st.write(f"Key: {key}, Value: {value}")
|
55 |
-
# st.write(f"{key}: {value}")
|
56 |
-
|
57 |
-
#for i, result in enumerate(results):
|
58 |
-
# st.write(f"Keys and Values of results[{i}]:")
|
59 |
-
# for j, res in enumerate(result):
|
60 |
-
# for key, value in res.items():
|
61 |
-
# if key == 'label':
|
62 |
-
# label = value
|
63 |
-
# elif key == 'score':
|
64 |
-
# score = value
|
65 |
-
# st.write(f"{label}: {score}")
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
#no good
|
70 |
-
#for i, result in enumerate(results):
|
71 |
-
# st.write(f"Keys and Values of results[{i}]:")
|
72 |
-
# for key, value in result.items():
|
73 |
-
# if key == 'label':
|
74 |
-
# label = value
|
75 |
-
# elif key == 'score':
|
76 |
-
# score = value
|
77 |
-
# st.write(f"{label}: {score}")
|
78 |
-
|
79 |
-
# working, but double display
|
80 |
-
#for i, result in enumerate(results):
|
81 |
-
# st.write(f"Keys and Values of results[{i}]:")
|
82 |
-
# for res in result:
|
83 |
-
# for key, value in res.items():
|
84 |
-
# if key == 'label':
|
85 |
-
# label = value
|
86 |
-
# elif key == 'score':
|
87 |
-
# score = value
|
88 |
-
# st.write(f"{label}: {score}")
|
89 |
-
|
90 |
for i, result in enumerate(results):
|
91 |
st.write(f"Keys and Values of results[{i}]:")
|
92 |
for res in result:
|
93 |
label = res["label"]
|
94 |
score = res["score"]
|
95 |
st.write(f"{label}: {score:.4f}")
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
#working, but double display
|
102 |
-
#for i, result in enumerate(results):
|
103 |
-
# st.write(f"Keys and Values of results[{i}]:")
|
104 |
-
# for j, res in enumerate(result):
|
105 |
-
# for key, value in res.items():
|
106 |
-
# if key == 'label':
|
107 |
-
# label = value
|
108 |
-
# elif key == 'score':
|
109 |
-
# score = value
|
110 |
-
# st.write(f"{label}: {score}")
|
111 |
-
|
112 |
-
|
113 |
-
#working, but double display
|
114 |
-
#for i, result in enumerate(results):
|
115 |
-
# st.write(f"Keys and Values of results[{i}]:")
|
116 |
-
# for j, res in enumerate(result):
|
117 |
-
# for key, value in res.items():
|
118 |
-
# if key == 'label':
|
119 |
-
# label = value
|
120 |
-
# elif key == 'score':
|
121 |
-
# score = value
|
122 |
-
# st.write(f"{label}: {score}")
|
123 |
-
|
124 |
|
125 |
-
#working, but double display
|
126 |
-
#if i ==1, result in enumerate(results):
|
127 |
-
# st.write(f"Keys and Values of results[{i}]:")
|
128 |
-
# for j, res in enumerate(result):
|
129 |
-
# for key, value in res.items():
|
130 |
-
# if key == 'label':
|
131 |
-
# label = value
|
132 |
-
# elif key == 'score':
|
133 |
-
# score = value
|
134 |
-
# st.write(f"{label}: {score}")
|
135 |
|
136 |
else:
|
137 |
# Open the uploaded images
|
|
|
38 |
col.write(f"Original File Name: {file_names[i]}") # Display original file name
|
39 |
|
40 |
# Display the keys and values of all results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
for i, result in enumerate(results):
|
42 |
st.write(f"Keys and Values of results[{i}]:")
|
43 |
for res in result:
|
44 |
label = res["label"]
|
45 |
score = res["score"]
|
46 |
st.write(f"{label}: {score:.4f}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
else:
|
50 |
# Open the uploaded images
|