Giter Club home page Giter Club logo

idx2numpy_array's Introduction

idx2numpy_array

To convert idx formatted files to numpy array ::

1. For the file idx2nparray_py3.py ::

Just run the code with the proper file path in the dictionary filename

This code is a mixture of the above two.

I have stacked blocks of 10000 images after reading the data of 10000X28X28 bytes = 7840000 bytes at once.

And the time taken for reading 7840000 bytes at once and stacking them all in 6 iterations in a single numpy array to form a 3D array was about 5 seconds on my laptop.

The numpy arrays can further be converted to images using other libraries like opencv, PIL or scipy.

But for using in a CNN, keeping in the np.ndarray format will be useful. I guess!!

To convert numpy array to image ::

Run the file ndarr2img.py

Takes about less than 20 seconds for the trainiing images and much less than that for the test images.

Just enter the right path

The iamges will be saved in '.jpg' format

And the labels will be saved in '.npy' format

idx2numpy_array's People

Contributors

sadimanna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

idx2numpy_array's Issues

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.