-
Notifications
You must be signed in to change notification settings - Fork 8
/
unzip.py
24 lines (20 loc) · 1.01 KB
/
unzip.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
This code is a part of the DeepLesion course project for the Deep Learning course (CS 682), Spring 2019 at John's Hopkins University.
The project team consists of Aniruddha Tamhane, Parv Saxena and Wei-Lun Huang.
The course was taught by Matthias Unberath and TA'd by Jie-Ying Wu and Gao Cong.
The project was sponsored by Google Cloud and Intuitive Surgicals.
"""
"""Command: python3 Deep-Lesion/unzip.py /media/parv/Seagate\ Backup\ Plus\ Drive/DeepL_Dataset/ /media/parv/Seagate\ Backup\ Plus\ Drive/DeepL_Dataset/Extracted\ /
"""
import zipfile
import os
import sys
download_directory = str(sys.argv[1]) # Directory containing the zipped image files
unzip_directory = str(sys.argv[2]) # Directory to unzip the zipped image files
for idx in range(1, 20):
full_fn = os.path.join(download_directory,'Images_png_%02d.zip' % (idx+1))
zip_ref = zipfile.ZipFile(full_fn)
zip_ref.extractall(unzip_directory+'/'+str(idx+1))
zip_ref.close()
#os.remove(full_fn)
print('Unzipped directory '+ str(idx+1))