konstantinG commited on
Commit
0a35212
1 Parent(s): b4f0c6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -8,7 +8,16 @@ import torch.nn.functional as F
8
  import pandas as pd
9
  from unzip import unzip
10
 
11
- unzip('img.zip')
 
 
 
 
 
 
 
 
 
12
 
13
  device = 'cpu'
14
  model_path = "weights/ViT-B-32.pt"
 
8
  import pandas as pd
9
  from unzip import unzip
10
 
11
+ zip_filename = 'img.zip'
12
+ target_dir = 'photos'
13
+
14
+ # Create the target directory if it doesn't exist
15
+ if not os.path.exists(target_dir):
16
+ os.makedirs(target_dir)
17
+
18
+ # Open the zip file and extract its contents to the target directory
19
+ with zipfile.ZipFile(zip_filename, 'r') as zip_ref:
20
+ zip_ref.extractall(target_dir)
21
 
22
  device = 'cpu'
23
  model_path = "weights/ViT-B-32.pt"