Spaces:
Build error
Build error
Merge branch 'main' of https://huggingface.co/spaces/Sangjun2/ultimate_gradio
Browse files
app.py
CHANGED
@@ -18,6 +18,16 @@ import itertools
|
|
18 |
import sys
|
19 |
import time
|
20 |
import logging
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
23 |
logger = logging.getLogger()
|
@@ -654,9 +664,9 @@ current_index = 0
|
|
654 |
image_names = []
|
655 |
def show_image(current_idx):
|
656 |
image_name=image_names[current_idx]
|
657 |
-
image_path = f"./
|
658 |
if not os.path.exists(image_path):
|
659 |
-
|
660 |
return Image.open(image_path)
|
661 |
|
662 |
# 4. 버튼 클릭 이벤트 핸들러
|
|
|
18 |
import sys
|
19 |
import time
|
20 |
import logging
|
21 |
+
import subprocess
|
22 |
+
|
23 |
+
# Git LFS pull 명령어 실행
|
24 |
+
result = subprocess.run(['git', 'lfs', 'pull'], capture_output=True, text=True)
|
25 |
+
|
26 |
+
# 명령어 실행 결과 출력 (선택 사항)
|
27 |
+
if result.returncode == 0:
|
28 |
+
print("LFS 파일이 성공적으로 다운로드되었습니다.")
|
29 |
+
else:
|
30 |
+
print(f"오류 발생: {result.stderr}")
|
31 |
|
32 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
33 |
logger = logging.getLogger()
|
|
|
664 |
image_names = []
|
665 |
def show_image(current_idx):
|
666 |
image_name=image_names[current_idx]
|
667 |
+
image_path = f"./top_20_percent_images/{image_name}.jpg"
|
668 |
if not os.path.exists(image_path):
|
669 |
+
image_path = f"./bottom_20_percent_images/{image_name}.jpg"
|
670 |
return Image.open(image_path)
|
671 |
|
672 |
# 4. 버튼 클릭 이벤트 핸들러
|