BrainAI-1 commited on
Commit
b5f2874
ยท
verified ยท
1 Parent(s): 135302f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -46,19 +46,23 @@ elif source_radio == "VIDEO":
46
 
47
  elif source_radio == "GAME":
48
  input_img = st.sidebar.file_uploader("์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ์„ ํƒํ•˜์„ธ์š”.", type=("jpg", "png"))
49
-
50
  if input_img:
51
-
52
  result_img, detected_object = object_detection.process_image(input_img)
53
- detected_objects_list = detected_object.split(": ")[1].split(", ")
54
- if st.session_state.random_class in detected_objects_list:
55
- st.header(f':{st.session_state.random_class}: ์ฐพ์Šต๋‹ˆ๋‹ค!')
56
- else:
57
- st.header(f':{st.session_state.random_class}: ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค')
 
 
 
 
 
 
58
  st.image(result_img)
59
 
60
  else:
61
- col1, col2 = st.columns([1, 4])
62
  with col1:
63
  if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
64
  st.session_state.random_class = object_detection.call_class()
 
46
 
47
  elif source_radio == "GAME":
48
  input_img = st.sidebar.file_uploader("์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ์„ ํƒํ•˜์„ธ์š”.", type=("jpg", "png"))
49
+ col1, col2 = st.columns([1, 4])
50
  if input_img:
 
51
  result_img, detected_object = object_detection.process_image(input_img)
52
+
53
+ with col1:
54
+ if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
55
+ st.session_state.random_class = object_detection.call_class()
56
+
57
+ with col2:
58
+ if st.session_state.random_class in detected_object:
59
+ st.header(f':{st.session_state.random_class}: ์ฐพ์Šต๋‹ˆ๋‹ค!')
60
+ else:
61
+ st.header(f':{st.session_state.random_class}: ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค')
62
+
63
  st.image(result_img)
64
 
65
  else:
 
66
  with col1:
67
  if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
68
  st.session_state.random_class = object_detection.call_class()