Guest User

Untitled

a guest
Apr 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. def load_carDats():
  2. import cv2
  3. import os
  4. # file_paths = {'neg':'./INRIAPerson/Train/neg/', 'pos':'./INRIAPerson/Train/pos/'}
  5. file_paths = {'neg': './INRIAPerson/TrainImages/', 'pos': './INRIAPerson/Train/pos/'}
  6. samples = []
  7. for keys, file_path in file_paths.items():
  8. files = os.listdir(file_path)
  9. for file_name in files:
  10. data = cv2.imread(file_path + file_name, 0).reshape(-1) / 255
  11. label = 0 if keys == 'neg' else 1
  12. samples.append((data, label))
  13. return samples
Add Comment
Please, Sign In to add comment