BrainAI-1 commited on
Commit
43a45f7
Β·
verified Β·
1 Parent(s): 2354f05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -12,9 +12,6 @@ st.title(":blue[Object Detection] :black_cat:")
12
  st.sidebar.header("메뉴")
13
  source_radio = st.sidebar.radio("μ„ νƒν•˜μ„Έμš”", ["IMAGE", "VIDEO", "GAME"])
14
 
15
-
16
-
17
-
18
  if source_radio == "IMAGE":
19
  st.write(":green[μ™Όμͺ½ 메뉴 'Browse files' λ²„νŠΌμ„ ν΄λ¦­ν•˜μ—¬ 이미지 νŒŒμΌμ„ μ„ νƒν•˜λ©΄ AI 좔둠이 μ‹œμž‘λ©λ‹ˆλ‹€.]" )
20
  st.sidebar.header("이미지 파일 μ—…λ‘œλ“œ")
@@ -38,22 +35,21 @@ elif source_radio == "VIDEO":
38
  st.write(":green[μ™Όμͺ½ 메뉴 'Browse files' λ²„νŠΌμ„ ν΄λ¦­ν•˜μ—¬ λΉ„λ””μ˜€ νŒŒμΌμ„ μ„ νƒν•˜λ©΄ AI 좔둠이 μ‹œμž‘λ©λ‹ˆλ‹€.]" )
39
  st.sidebar.header("λΉ„λ””μ˜€ 파일 μ—…λ‘œλ“œ")
40
  input_video = st.sidebar.file_uploader("λΉ„λ””μ˜€ νŒŒμΌμ„ μ„ νƒν•˜μ„Έμš”..", type=("mp4"))
 
41
  if input_video is not None:
42
  temp_file = object_detection.play_video(input_video)
43
  st.video(temp_file)
44
  else:
45
  st.video("data/breakfast.mp4")
46
 
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
56
-
57
  with col2:
58
  if st.button('μƒˆλ‘œμš΄ 객체'):
59
  st.session_state.random_class = object_detection.call_class()
@@ -66,4 +62,5 @@ elif source_radio == "GAME":
66
  st.header(f':{st.session_state.random_class}: 찾을 수 μ—†μŠ΅λ‹ˆλ‹€')
67
 
68
  st.image(result_img)
69
-
 
 
12
  st.sidebar.header("메뉴")
13
  source_radio = st.sidebar.radio("μ„ νƒν•˜μ„Έμš”", ["IMAGE", "VIDEO", "GAME"])
14
 
 
 
 
15
  if source_radio == "IMAGE":
16
  st.write(":green[μ™Όμͺ½ 메뉴 'Browse files' λ²„νŠΌμ„ ν΄λ¦­ν•˜μ—¬ 이미지 νŒŒμΌμ„ μ„ νƒν•˜λ©΄ AI 좔둠이 μ‹œμž‘λ©λ‹ˆλ‹€.]" )
17
  st.sidebar.header("이미지 파일 μ—…λ‘œλ“œ")
 
35
  st.write(":green[μ™Όμͺ½ 메뉴 'Browse files' λ²„νŠΌμ„ ν΄λ¦­ν•˜μ—¬ λΉ„λ””μ˜€ νŒŒμΌμ„ μ„ νƒν•˜λ©΄ AI 좔둠이 μ‹œμž‘λ©λ‹ˆλ‹€.]" )
36
  st.sidebar.header("λΉ„λ””μ˜€ 파일 μ—…λ‘œλ“œ")
37
  input_video = st.sidebar.file_uploader("λΉ„λ””μ˜€ νŒŒμΌμ„ μ„ νƒν•˜μ„Έμš”..", type=("mp4"))
38
+ print(input_video)
39
  if input_video is not None:
40
  temp_file = object_detection.play_video(input_video)
41
  st.video(temp_file)
42
  else:
43
  st.video("data/breakfast.mp4")
44
 
 
45
  elif source_radio == "GAME":
46
  input_img = st.sidebar.file_uploader("이미지 νŒŒμΌμ„ μ„ νƒν•˜μ„Έμš”.", type=("jpg", "png"))
47
  if input_img is None:
48
  st.session_state.random_class = object_detection.call_class()
49
+ col1, col2 = st.columns([3, 1])
50
 
51
  with col1:
52
+ st.title(f':{st.session_state.random_class}: μžˆλŠ” 이미지λ₯Ό μ—…λ‘œλ“œ')
 
53
  with col2:
54
  if st.button('μƒˆλ‘œμš΄ 객체'):
55
  st.session_state.random_class = object_detection.call_class()
 
62
  st.header(f':{st.session_state.random_class}: 찾을 수 μ—†μŠ΅λ‹ˆλ‹€')
63
 
64
  st.image(result_img)
65
+
66
+