BrainAI-1 commited on
Commit
aafb61a
ยท
verified ยท
1 Parent(s): 0e32b2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -11,9 +11,9 @@ st.set_page_config(
11
  st.title(":blue[Object Detection] :black_cat:")
12
  st.sidebar.header("๋ฉ”๋‰ด")
13
  source_radio = st.sidebar.radio("์„ ํƒํ•˜์„ธ์š”", ["IMAGE", "VIDEO", "GAME"])
14
- if 'random_class' not in st.session_state:
15
- st.session_state.random_class = object_detection.call_class()
16
- st.write('initialize')
17
 
18
  if source_radio == "IMAGE":
19
  st.write(":green[์™ผ์ชฝ ๋ฉ”๋‰ด 'Browse files' ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ ์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ์„ ํƒํ•˜๋ฉด AI ์ถ”๋ก ์ด ์‹œ์ž‘๋ฉ๋‹ˆ๋‹ค.]" )
@@ -49,7 +49,6 @@ 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
-
53
 
54
  with col1:
55
  st.title(f':{st.session_state.random_class}: ์žˆ๋Š” ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œ') # Display the header
@@ -57,7 +56,7 @@ elif source_radio == "GAME":
57
  with col2:
58
  if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
59
  st.session_state.random_class = object_detection.call_class()
60
- st.write("new object 1")
61
  else:
62
  result_img, detected_object = object_detection.process_image(input_img)
63
 
@@ -73,4 +72,4 @@ elif source_radio == "GAME":
73
  with col2:
74
  if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
75
  st.session_state.random_class = object_detection.call_class()
76
- st.write("new object2")
 
11
  st.title(":blue[Object Detection] :black_cat:")
12
  st.sidebar.header("๋ฉ”๋‰ด")
13
  source_radio = st.sidebar.radio("์„ ํƒํ•˜์„ธ์š”", ["IMAGE", "VIDEO", "GAME"])
14
+
15
+ st.session_state.random_class = None
16
+
17
 
18
  if source_radio == "IMAGE":
19
  st.write(":green[์™ผ์ชฝ ๋ฉ”๋‰ด 'Browse files' ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ ์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ์„ ํƒํ•˜๋ฉด AI ์ถ”๋ก ์ด ์‹œ์ž‘๋ฉ๋‹ˆ๋‹ค.]" )
 
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
 
53
  with col1:
54
  st.title(f':{st.session_state.random_class}: ์žˆ๋Š” ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œ') # Display the header
 
56
  with col2:
57
  if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
58
  st.session_state.random_class = object_detection.call_class()
59
+
60
  else:
61
  result_img, detected_object = object_detection.process_image(input_img)
62
 
 
72
  with col2:
73
  if st.button('์ƒˆ๋กœ์šด ๊ฐ์ฒด'):
74
  st.session_state.random_class = object_detection.call_class()
75
+