BrainAI-1 commited on
Commit
4754d22
ยท
verified ยท
1 Parent(s): 9249554

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -18
app.py CHANGED
@@ -10,14 +10,21 @@ st.set_page_config(
10
 
11
 
12
  st.sidebar.header("๋ฉ”๋‰ด")
13
- col1, col2 = st.columns([4, 1])
 
 
 
 
14
  with col1:
15
  st.title(":blue[Object Detection] :black_cat:")
16
  with col2:
17
- if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
18
- st.session_state.random_class = object_detection.call_class()
 
 
 
 
19
 
20
- source_radio = st.sidebar.radio("์„ ํƒํ•˜์„ธ์š”", ["IMAGE", "VIDEO", "GAME"])
21
  if "random_class" not in st.session_state:
22
  st.session_state.random_class = object_detection.call_class()
23
 
@@ -53,16 +60,8 @@ elif source_radio == "VIDEO":
53
 
54
  elif source_radio == "GAME":
55
  input_img = st.sidebar.file_uploader("์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ์„ ํƒํ•˜์„ธ์š”.", type=("jpg", "png"))
56
- col1, col2 = st.columns([1, 4])
57
  if input_img:
58
  result_img, detected_object = object_detection.process_image(input_img)
59
-
60
- with col1:
61
- pass
62
- #if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
63
- # st.session_state.random_class = object_detection.call_class()
64
-
65
- with col2:
66
  if st.session_state.random_class in detected_object:
67
  st.title(f':{st.session_state.random_class}: ์ฐพ์Šต๋‹ˆ๋‹ค!')
68
  else:
@@ -71,12 +70,6 @@ elif source_radio == "GAME":
71
  st.image(result_img)
72
 
73
  else:
74
- with col1:
75
- pass
76
- #if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
77
- # st.session_state.random_class = object_detection.call_class()
78
-
79
- with col2:
80
  st.title(f':{st.session_state.random_class}: ์žˆ๋Š” ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œ')
81
 
82
 
 
10
 
11
 
12
  st.sidebar.header("๋ฉ”๋‰ด")
13
+
14
+
15
+ source_radio = st.sidebar.radio("์„ ํƒํ•˜์„ธ์š”", ["IMAGE", "VIDEO", "GAME"])
16
+
17
+ col1, col2 = st.columns([2, 3])
18
  with col1:
19
  st.title(":blue[Object Detection] :black_cat:")
20
  with col2:
21
+ if source_radio == "GAME":
22
+ if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
23
+ st.session_state.random_class = object_detection.call_class()
24
+ else:
25
+ pass
26
+
27
 
 
28
  if "random_class" not in st.session_state:
29
  st.session_state.random_class = object_detection.call_class()
30
 
 
60
 
61
  elif source_radio == "GAME":
62
  input_img = st.sidebar.file_uploader("์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ์„ ํƒํ•˜์„ธ์š”.", type=("jpg", "png"))
 
63
  if input_img:
64
  result_img, detected_object = object_detection.process_image(input_img)
 
 
 
 
 
 
 
65
  if st.session_state.random_class in detected_object:
66
  st.title(f':{st.session_state.random_class}: ์ฐพ์Šต๋‹ˆ๋‹ค!')
67
  else:
 
70
  st.image(result_img)
71
 
72
  else:
 
 
 
 
 
 
73
  st.title(f':{st.session_state.random_class}: ์žˆ๋Š” ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œ')
74
 
75