Extract Google Drive zip from Google colab notebook

前端 未结 12 1560
醉梦人生
醉梦人生 2020-12-25 12:29

I already have a zip of (2K images) dataset on a google drive. I have to use it in a ML training algorithm. Below Code extracts the content in a string format:



        
12条回答
  •  攒了一身酷
    2020-12-25 13:20

    Try this:

    !unpack file.zip
    

    If its now working or file is 7z try below

    !apt-get install p7zip-full
    !p7zip -d file_name.tar.7z
    !tar -xvf file_name.tar
    

    Or

    !pip install pyunpack
    !pip install patool
    
    from pyunpack import Archive
    Archive(‘file_name.tar.7z’).extractall(‘path/to/’)
    !tar -xvf file_name.tar
    

提交回复
热议问题