Skip to content

Instantly share code, notes, and snippets.

@soumya997
Last active March 30, 2020 04:28
Show Gist options
  • Select an option

  • Save soumya997/3e02b31806495553a143cf9348d30fcf to your computer and use it in GitHub Desktop.

Select an option

Save soumya997/3e02b31806495553a143cf9348d30fcf to your computer and use it in GitHub Desktop.
Z,X=[],[]
IMG_SIZE=150
FLOWER_SUNFLOWER_DIR='../input/flowers-recognition/flowers/flowers/sunflower'
def assign_label(img,flower_type):
return flower_type
def make_train_data(flower_type,DIR):
for img in tqdm(os.listdir(DIR)):
label=assign_label(img,flower_type)
path = os.path.join(DIR,img)
img = cv2.imread(path,cv2.IMREAD_COLOR)
img = cv2.resize(img, (IMG_SIZE,IMG_SIZE))#Resizing the image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment