Update app.py
Browse files
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 |
-
|
| 65 |
-
|
| 66 |
-
if st.session_state.random_class in detected_object:
|
| 67 |
-
st.header(f':{st.session_state.random_class}: ์ฐพ์ต๋๋ค!')
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 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 |
|