Update app.py
Browse files
app.py
CHANGED
|
@@ -96,11 +96,11 @@ def display_images(images):
|
|
| 96 |
st.image(blurred_img, caption=os.path.basename(file_path), use_column_width=True)
|
| 97 |
else:
|
| 98 |
if file_ext in [".jpg", ".png"]:
|
| 99 |
-
st.image(file_path, caption=os.path.basename(file_path), use_column_width=True)
|
| 100 |
col1, col2 = st.columns([4, 1])
|
| 101 |
with col1:
|
| 102 |
if file_ext in [".jpg", ".png"]:
|
| 103 |
-
st.image(file_path, caption=os.path.basename(file_path), use_column_width=True)
|
| 104 |
with col2:
|
| 105 |
if col2.button("削除", key=file_path):
|
| 106 |
os.remove(file_path)
|
|
@@ -148,7 +148,7 @@ display_images(current_page_files)
|
|
| 148 |
# Blurのトグルを更新
|
| 149 |
st.session_state.blur_option = st.checkbox("NSFW画像にBlurをかける", value=st.session_state.blur_option)
|
| 150 |
|
| 151 |
-
# CSVに保存ボタン
|
| 152 |
if st.button("CSVに保存"):
|
| 153 |
csv_filename = "gradio_predictions_and_timestamps.csv"
|
| 154 |
with open(csv_filename, mode='w', newline='', encoding='utf-8') as csv_file:
|
|
|
|
| 96 |
st.image(blurred_img, caption=os.path.basename(file_path), use_column_width=True)
|
| 97 |
else:
|
| 98 |
if file_ext in [".jpg", ".png"]:
|
| 99 |
+
st.image(Image.open(file_path), caption=os.path.basename(file_path), use_column_width=True)
|
| 100 |
col1, col2 = st.columns([4, 1])
|
| 101 |
with col1:
|
| 102 |
if file_ext in [".jpg", ".png"]:
|
| 103 |
+
st.image(Image.open(file_path), caption=os.path.basename(file_path), use_column_width=True)
|
| 104 |
with col2:
|
| 105 |
if col2.button("削除", key=file_path):
|
| 106 |
os.remove(file_path)
|
|
|
|
| 148 |
# Blurのトグルを更新
|
| 149 |
st.session_state.blur_option = st.checkbox("NSFW画像にBlurをかける", value=st.session_state.blur_option)
|
| 150 |
|
| 151 |
+
# CSVに保存# CSVに保存ボタン
|
| 152 |
if st.button("CSVに保存"):
|
| 153 |
csv_filename = "gradio_predictions_and_timestamps.csv"
|
| 154 |
with open(csv_filename, mode='w', newline='', encoding='utf-8') as csv_file:
|