Giter VIP home page Giter VIP logo

7z_on_array's Introduction

7z_on_array

Python library to unzip 7z files straight to numpy arrays

this small library has the objective of dealing with .7z files without the need to extract them to the HD. It uses the 7zip bash program to unzip files directly into nemory and than convert them to arrays

It is directed to treat the image files that were sent on kaggle competition CIFAR but it may be changed to deal with other zipped files.

On the first test, if I had to decompress and read each file, it would take 2 hours to complete.

Using this library, it took 1 minute.

Requirements

7zip bash tool. If you have Anaconda installed, you will have already numpy and pil [http://superuser.com/questions/548349/how-can-i-install-7zip-so-i-can-run-it-from-terminal-on-os-x](how to intall 7zip)

references and places to find help

[http://stackoverflow.com/questions/646286/python-pil-how-to-write-png-image-to-string](Stack post) [https://docs.python.org/2/library/stringio.html](String io) [http://stackoverflow.com/questions/11552926/how-to-read-raw-png-from-an-array-in-python-opencv/17547525#17547525](Open cv and raw image) [http://stackoverflow.com/questions/25186591/having-cv2-imread-reading-images-from-file-objects-or-memory-stream-like-data-h](Memory strings as files)

How to use

Just copy the directory to the same directory where your original code is.

Then:

    import 7z_on_array

    file_name = '~/Machine Learning/Kaggle/CIFAR/train.7z'
    f_info = get_files_info(file_name)
    raw_data = uncompress_file(file_name)
    data = get_files_array(f_info, raw_data)

7z_on_array's People

Contributors

adrianow avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.