Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -239,21 +239,22 @@ if st.session_state.screen == 2:
|
|
| 239 |
st.rerun()
|
| 240 |
|
| 241 |
# show character locations
|
| 242 |
-
class_names = {0: "Waldo", 1: "Wenda", 2: "Odlaw", 3: "Wizard", 4: "Woof"}
|
| 243 |
-
for idx, pred in enumerate(st.session_state.results):
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
|
| 252 |
# display locations
|
| 253 |
-
st.session_state.
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
st.
|
|
|
|
| 257 |
|
| 258 |
# plot predicted image
|
| 259 |
st.markdown(f"<h4 style='text-align: center; color: black;'>Image Tile {str(st.session_state.image_counter + 1)}</h4>", unsafe_allow_html=True)
|
|
|
|
| 239 |
st.rerun()
|
| 240 |
|
| 241 |
# show character locations
|
| 242 |
+
# class_names = {0: "Waldo", 1: "Wenda", 2: "Odlaw", 3: "Wizard", 4: "Woof"}
|
| 243 |
+
# for idx, pred in enumerate(st.session_state.results):
|
| 244 |
+
# #extract detected character names and their confidence scores
|
| 245 |
+
# st.session_state.detected_characters = {}
|
| 246 |
+
# for cls_id, conf in pred:
|
| 247 |
+
# name = class_names[int(cls_id)] # Convert class ID to character name
|
| 248 |
+
# if name in st.session_state.detected_characters:
|
| 249 |
+
# if conf >= st.session_state.confidence:
|
| 250 |
+
# st.session_state.detected_characters[name].append(idx)
|
| 251 |
|
| 252 |
# display locations
|
| 253 |
+
st.write(st.session_state.results[0][0])
|
| 254 |
+
# st.session_state.locations = ""
|
| 255 |
+
# for name, idx in st.session_state.detected_characters.items():
|
| 256 |
+
# st.session_state.locations += f" {name} tiles: {str(idx)}, )"
|
| 257 |
+
# st.write(st.session_state.locations)
|
| 258 |
|
| 259 |
# plot predicted image
|
| 260 |
st.markdown(f"<h4 style='text-align: center; color: black;'>Image Tile {str(st.session_state.image_counter + 1)}</h4>", unsafe_allow_html=True)
|