Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,16 @@ def clear_images():
|
|
| 37 |
return None, None
|
| 38 |
|
| 39 |
# Gradio 인터페이스 구성
|
| 40 |
-
with gr.Blocks(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
gr.Markdown("# 이미지 배경 제거기")
|
| 42 |
gr.Markdown("이미지를 업로드하면 배경이 자동으로 제거됩니다.")
|
| 43 |
|
|
@@ -55,11 +64,11 @@ with gr.Blocks() as demo:
|
|
| 55 |
|
| 56 |
# 배경 제거 버튼
|
| 57 |
with gr.Row():
|
| 58 |
-
btn_remove = gr.Button("배경 제거")
|
| 59 |
btn_remove.click(fn=remove_background, inputs=input_image, outputs=output_image)
|
| 60 |
|
| 61 |
# 초기화 버튼 추가
|
| 62 |
-
btn_reset = gr.Button("초기화")
|
| 63 |
btn_reset.click(fn=clear_images, inputs=None, outputs=[input_image, output_image])
|
| 64 |
|
| 65 |
# 예제 이미지
|
|
@@ -72,7 +81,5 @@ with gr.Blocks() as demo:
|
|
| 72 |
label="예제 이미지"
|
| 73 |
)
|
| 74 |
|
| 75 |
-
# gr.Markdown("© 2024 이미지 배경 제거기")
|
| 76 |
-
|
| 77 |
if __name__ == "__main__":
|
| 78 |
demo.launch()
|
|
|
|
| 37 |
return None, None
|
| 38 |
|
| 39 |
# Gradio 인터페이스 구성
|
| 40 |
+
with gr.Blocks(css="""
|
| 41 |
+
#btn-remove {
|
| 42 |
+
background-color: #4CAF50; /* 초록색 */
|
| 43 |
+
color: white;
|
| 44 |
+
}
|
| 45 |
+
#btn-reset {
|
| 46 |
+
background-color: #f44336; /* 빨간색 */
|
| 47 |
+
color: white;
|
| 48 |
+
}
|
| 49 |
+
""") as demo:
|
| 50 |
gr.Markdown("# 이미지 배경 제거기")
|
| 51 |
gr.Markdown("이미지를 업로드하면 배경이 자동으로 제거됩니다.")
|
| 52 |
|
|
|
|
| 64 |
|
| 65 |
# 배경 제거 버튼
|
| 66 |
with gr.Row():
|
| 67 |
+
btn_remove = gr.Button("배경 제거", elem_id="btn-remove") # elem_id로 버튼 스타일 지정
|
| 68 |
btn_remove.click(fn=remove_background, inputs=input_image, outputs=output_image)
|
| 69 |
|
| 70 |
# 초기화 버튼 추가
|
| 71 |
+
btn_reset = gr.Button("초기화", elem_id="btn-reset") # elem_id로 버튼 스타일 지정
|
| 72 |
btn_reset.click(fn=clear_images, inputs=None, outputs=[input_image, output_image])
|
| 73 |
|
| 74 |
# 예제 이미지
|
|
|
|
| 81 |
label="예제 이미지"
|
| 82 |
)
|
| 83 |
|
|
|
|
|
|
|
| 84 |
if __name__ == "__main__":
|
| 85 |
demo.launch()
|