Skip to content

Commit

Permalink
Remove dependency from tqdm
Browse files Browse the repository at this point in the history
  • Loading branch information
ndrplz committed Oct 15, 2017
1 parent c4f8fc2 commit f1b8646
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions capstone_traffic_light_classifier/traffic_light_dataset.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import cv2
import numpy as np
from glob import glob
from tqdm import tqdm
from os.path import join


Expand All @@ -21,11 +20,13 @@ def init_from_files(self, dataset_root, resize=(256, 256)):
self.dataset_npy = []
frame_list = glob(join(self.root, '*', '*.jpg'))

for frame_path in tqdm(frame_list, desc='Loading frames'):
print('Loading frames...')
for frame_path in frame_list:
frame = cv2.imread(frame_path)
frame = cv2.resize(frame, resize[::-1]) # cv2 invert rows and cols
label = self.infer_label_from_frame_path(frame_path)
self.dataset_npy.append([frame, label])
print('Done.')

self.initialized = True

Expand Down

0 comments on commit f1b8646

Please sign in to comment.