Sangjun2 commited on
Commit
9632b29
ยท
verified ยท
1 Parent(s): 5ae81d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
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):