Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def load_carDats():
- import cv2
- import os
- # file_paths = {'neg':'./INRIAPerson/Train/neg/', 'pos':'./INRIAPerson/Train/pos/'}
- file_paths = {'neg': './INRIAPerson/TrainImages/', 'pos': './INRIAPerson/Train/pos/'}
- samples = []
- for keys, file_path in file_paths.items():
- files = os.listdir(file_path)
- for file_name in files:
- data = cv2.imread(file_path + file_name, 0).reshape(-1) / 255
- label = 0 if keys == 'neg' else 1
- samples.append((data, label))
- return samples
Add Comment
Please, Sign In to add comment