Update app.py
Browse files
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 |
-
|
| 15 |
-
|
| 16 |
-
|
| 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 |
-
|
| 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 |
-
|
|
|
|
| 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 |
+
|