Skip to content

Instantly share code, notes, and snippets.

@aravindpai aravindpai/11_7.py
Created Mar 30, 2020

Embed
What would you like to do?
import os
import cv2
import numpy as np
import pandas as pd
folders=os.listdir('data/')
images=[]
labels= []
for folder in folders:
files=os.listdir('data/'+folder)
for file in files:
img=cv2.imread('data/'+folder+'/'+file,0)
img=cv2.resize(img,(25,25))
images.append(img)
labels.append(int(folder))
images = np.array(images)
features = images.reshape(len(images),-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.