Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,6 @@ from transformers import pipeline # 새로 추가된 import
|
|
14 |
load_dotenv()
|
15 |
|
16 |
|
17 |
-
|
18 |
# 기존 코드 유지 (로깅, 함수 등 모든 기능 코드)
|
19 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
20 |
logger = logging.getLogger(__name__)
|
@@ -1187,14 +1186,14 @@ with gr.Blocks(css=custom_css) as demo:
|
|
1187 |
bg_remove_status = gr.Textbox(label="상태", lines=2, elem_classes="custom-input")
|
1188 |
bg_remove_btn = gr.Button('✂️ 배경 제거하기', elem_classes="custom-button primary")
|
1189 |
|
1190 |
-
# 이미지 필터 탭
|
1191 |
with gr.TabItem("🖌️ 이미지 필터", elem_classes="tab-content"):
|
1192 |
with gr.Row(equal_height=True):
|
1193 |
# 왼쪽 열: 비율 3
|
1194 |
with gr.Column(scale=3, elem_classes="panel"):
|
1195 |
gr.HTML('<div class="section-title"><i class="fas fa-sliders-h"></i> 이미지 필터 설정</div>')
|
1196 |
# 이미지 업로드
|
1197 |
-
filter_input_image = gr.Image(type="pil", label="이미지 업로드", elem_classes="image-container")
|
1198 |
|
1199 |
# 조정 슬라이더
|
1200 |
with gr.Group():
|
@@ -1211,14 +1210,13 @@ with gr.Blocks(css=custom_css) as demo:
|
|
1211 |
# 오른쪽 열: 비율 7
|
1212 |
with gr.Column(scale=7, elem_classes="panel"):
|
1213 |
gr.HTML('<div class="section-title"><i class="fas fa-image"></i> 필터 적용 결과</div>')
|
1214 |
-
# 처리된 이미지 출력
|
1215 |
-
filter_output_image = gr.Image(type="pil", label="처리된 이미지", elem_classes="image-container")
|
1216 |
|
1217 |
-
#
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
download_output = gr.File(label="JPG 이미지 다운로드")
|
1222 |
|
1223 |
# 이미지 처리 함수 연결
|
1224 |
inputs = [
|
|
|
14 |
load_dotenv()
|
15 |
|
16 |
|
|
|
17 |
# 기존 코드 유지 (로깅, 함수 등 모든 기능 코드)
|
18 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
19 |
logger = logging.getLogger(__name__)
|
|
|
1186 |
bg_remove_status = gr.Textbox(label="상태", lines=2, elem_classes="custom-input")
|
1187 |
bg_remove_btn = gr.Button('✂️ 배경 제거하기', elem_classes="custom-button primary")
|
1188 |
|
1189 |
+
# 이미지 필터 탭 UI 개선
|
1190 |
with gr.TabItem("🖌️ 이미지 필터", elem_classes="tab-content"):
|
1191 |
with gr.Row(equal_height=True):
|
1192 |
# 왼쪽 열: 비율 3
|
1193 |
with gr.Column(scale=3, elem_classes="panel"):
|
1194 |
gr.HTML('<div class="section-title"><i class="fas fa-sliders-h"></i> 이미지 필터 설정</div>')
|
1195 |
# 이미지 업로드
|
1196 |
+
filter_input_image = gr.Image(type="pil", label="이미지 업로드", elem_classes="image-container", height=400)
|
1197 |
|
1198 |
# 조정 슬라이더
|
1199 |
with gr.Group():
|
|
|
1210 |
# 오른쪽 열: 비율 7
|
1211 |
with gr.Column(scale=7, elem_classes="panel"):
|
1212 |
gr.HTML('<div class="section-title"><i class="fas fa-image"></i> 필터 적용 결과</div>')
|
1213 |
+
# 처리된 이미지 출력 - 높이를 입력 이미지와 동일하게 설정
|
1214 |
+
filter_output_image = gr.Image(type="pil", label="처리된 이미지", elem_classes="image-container", height=400)
|
1215 |
|
1216 |
+
# 다운로드 버튼 - "결과이미지저장" 섹션으로 변경하고 파일 다운로드를 그 아래에 배치
|
1217 |
+
gr.HTML('<div class="section-title"><i class="fas fa-download"></i> 결과이미지저장</div>')
|
1218 |
+
download_button = gr.Button("결과이미지저장", elem_classes="custom-button primary")
|
1219 |
+
download_output = gr.File(label="JPG 이미지 다운로드")
|
|
|
1220 |
|
1221 |
# 이미지 처리 함수 연결
|
1222 |
inputs = [
|