Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -652,7 +652,19 @@ def load_image_checklist(file):
|
|
652 |
# 3. ํ์ฌ ์ธ๋ฑ์ค๋ฅผ ์ถ์ ํ๊ธฐ ์ํ ๋ณ์
|
653 |
current_index = 0
|
654 |
image_names = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
655 |
def show_image(current_idx):
|
|
|
|
|
|
|
|
|
656 |
image_name=image_names[current_idx]
|
657 |
image_path = f"./images/{image_name}.jpg"
|
658 |
if not os.path.exists(image_path):
|
|
|
652 |
# 3. ํ์ฌ ์ธ๋ฑ์ค๋ฅผ ์ถ์ ํ๊ธฐ ์ํ ๋ณ์
|
653 |
current_index = 0
|
654 |
image_names = []
|
655 |
+
|
656 |
+
def unzip_images(zip_file_path, extract_to='images'):
|
657 |
+
if not os.path.exists(extract_to):
|
658 |
+
os.makedirs(extract_to)
|
659 |
+
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
|
660 |
+
zip_ref.extractall(extract_to)
|
661 |
+
|
662 |
+
|
663 |
def show_image(current_idx):
|
664 |
+
zip_file_path = './img_data.zip'
|
665 |
+
images_folder = './images'
|
666 |
+
if not os.path.exists(images_folder):
|
667 |
+
unzip_images(zip_file_path, images_folder)
|
668 |
image_name=image_names[current_idx]
|
669 |
image_path = f"./images/{image_name}.jpg"
|
670 |
if not os.path.exists(image_path):
|