Permalink
Browse files

TrainingData: Repeat the transforms up to 50 times until it returns a…

… sample with matched anchors
  • Loading branch information...
ljanyst committed Mar 5, 2018
1 parent 57e3f0f commit c292e6c3624165b31c2fd4207f7e4e6958f1f734
Showing with 7 additions and 1 deletion.
  1. +7 −1 training_data.py
@@ -89,7 +89,13 @@ def process_samples(samples):
labels = []
gt_boxes = []
for s in samples:
image, label, gt = run_transforms(s)
done = False
counter = 0
while not done and counter < 50:
image, label, gt = run_transforms(s)
num_bg = np.count_nonzero(label[:, self.num_classes])
done = num_bg < label.shape[0]
counter += 1
images.append(image.astype(np.float32))
labels.append(label.astype(np.float32))

0 comments on commit c292e6c

Please sign in to comment.