Skip to content Skip to sidebar Skip to footer

Creating Dataset Of Images For Image Classification

I want to create image classifier with Pandas and Scikit-Learn libs, but I want to have my own data of pictures? Since now, I have used pandas columns for features and result, but

Solution 1:

I don't think sklearn and pandas alone can read images. I would suggest that you use numpy arrays to represent images. There are libraries such as scikit-image and pillow that you can use.

pip install scikit-image

Verify installation by:

>>>import skimage>>>skimage.__version__

You can then get an image as a 3-D numpy array with:

skimage.io.imread(fname)

The first two dimensions are x and y coordinates (where [0,0] is in the top-left corner) and the third dimension has values of the colour channels. For an RGB image, there will be 3 values for each [x,y] corresponding to red, green and blue channels. For more information, see skimage docs.

Post a Comment for "Creating Dataset Of Images For Image Classification"