BrainAI-1 commited on
Commit
2354f05
ยท
verified ยท
1 Parent(s): 9f50d9c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -15
app.py CHANGED
@@ -47,9 +47,9 @@ elif source_radio == "VIDEO":
47
 
48
  elif source_radio == "GAME":
49
  input_img = st.sidebar.file_uploader("์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ์„ ํƒํ•˜์„ธ์š”.", type=("jpg", "png"))
50
- col1, col2 = st.columns([3, 1]) # Adjust the column widths as needed
51
  if input_img is None:
52
- st.session_state.random_class = object_detection.call_class()
 
53
 
54
  with col1:
55
  st.title(f':{st.session_state.random_class}: ์žˆ๋Š” ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œ') # Display the header
@@ -57,20 +57,13 @@ elif source_radio == "GAME":
57
  with col2:
58
  if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
59
  st.session_state.random_class = object_detection.call_class()
60
-
61
  else:
62
  result_img, detected_object = object_detection.process_image(input_img)
63
-
64
- with col1:
65
-
66
- if st.session_state.random_class in detected_object:
67
- st.header(f':{st.session_state.random_class}: ์ฐพ์Šต๋‹ˆ๋‹ค!')
68
 
69
- else:
70
- st.header(f':{st.session_state.random_class}: ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค')
71
- st.image(result_img)
72
-
73
- with col2:
74
- if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
75
- st.session_state.random_class = object_detection.call_class()
76
 
 
47
 
48
  elif source_radio == "GAME":
49
  input_img = st.sidebar.file_uploader("์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ์„ ํƒํ•˜์„ธ์š”.", type=("jpg", "png"))
 
50
  if input_img is None:
51
+ st.session_state.random_class = object_detection.call_class()
52
+ col1, col2 = st.columns([3, 1]) # Adjust the column widths as needed
53
 
54
  with col1:
55
  st.title(f':{st.session_state.random_class}: ์žˆ๋Š” ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œ') # Display the header
 
57
  with col2:
58
  if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
59
  st.session_state.random_class = object_detection.call_class()
 
60
  else:
61
  result_img, detected_object = object_detection.process_image(input_img)
62
+ if st.session_state.random_class in detected_object:
63
+ st.header(f':{st.session_state.random_class}: ์ฐพ์Šต๋‹ˆ๋‹ค!')
 
 
 
64
 
65
+ else:
66
+ st.header(f':{st.session_state.random_class}: ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค')
67
+
68
+ st.image(result_img)
 
 
 
69