import zipfile
zip_ref = zipfile.ZipFile('/tmp/horse-or-human.zip')
zip_ref.extractall('/tmp/horse-or-human')

코랩환경에서 했다. 먼저 zipfile을 import한다. zipfile.ZipFile에 압축파일이 있는 경로를 대입해준다.

이것을 변수 zip_ref로 저장한뒤 exttractall에 압축풀 경로를 지정해주면 경로에다 압축 파일이 풀어진다.

+ Recent posts