Skip to content

Instantly share code, notes, and snippets.

@miki998
Created April 23, 2020 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miki998/f74c682e650a1aab758d66600a54cd97 to your computer and use it in GitHub Desktop.
Save miki998/f74c682e650a1aab758d66600a54cd97 to your computer and use it in GitHub Desktop.
AGE_CLASS = {'(0,2)':0,'(4,6)':1
,'(8,13)':2,'(15,20)':3
,'(25,32)':4,'(38,43)':5
,'(48,53)':6,'(60,100)':7}
#load images
X_train, y_train = [], []
X_test, y_test = [], []
for image in os.listdir('train'):
y_train.append(image.split('_')[1].split('.')[0])
X_train.append(cv2.imread('train/'+image))
for image in os.listdir('test'):
y_test.append(image.split('_')[1].split('.')[0])
X_test.append(cv2.imread('test/'+image))
X_train, y_train = np.array(X_train), np.array(y_train)
X_test, y_test = np.array(X_test), np.array(y_test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment