Skip to content

Instantly share code, notes, and snippets.

@aialenti
Created February 14, 2019 22:05
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 aialenti/5b879f2000eabfde70302dc51622429c to your computer and use it in GitHub Desktop.
Save aialenti/5b879f2000eabfde70302dc51622429c to your computer and use it in GitHub Desktop.
# Modules used by the function
#import numpy as np
#from src.commons import utils
#from constants import
# Stack images
pixel_matrix = None
fitted_model = None
for idx, row in data.iterrows():
# Load the image using OpenCV and converting from BGR to RGB
img = utils.load_image('{}/{}.jpg'.format(IMAGE_RESHAPED_FOLDER, row.title))
reshaped = img.reshape((-1, 3))
if pixel_matrix is None:
pixel_matrix = reshaped
else:
pixel_matrix = np.concatenate((pixel_matrix, reshaped))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment