This commit is contained in:
Glenn Jocher
2018-09-08 14:46:22 +02:00
parent af9864de7b
commit a284fc921d
4 changed files with 7 additions and 5 deletions
+1 -2
View File
@@ -89,8 +89,7 @@ class load_images_and_labels(): # for training
def __iter__(self):
self.count = -1
self.shuffled_vector = np.random.permutation(self.nF) # shuffled vector
# self.shuffled_vector = np.arange(self.nF) # not shuffled
self.shuffled_vector = np.random.permutation(self.nF) if self.augment else np.arange(self.nF)
return self
def __next__(self):
+1 -1
View File
@@ -40,7 +40,7 @@ def xview_class_weights(indices): # weights of each class in the training set,
def plot_one_box(x, img, color=None, label=None, line_thickness=None): # Plots one bounding box on image img
tl = line_thickness or round(0.003 * max(img.shape[0:2])) # line thickness
tl = line_thickness or round(0.002 * max(img.shape[0:2])) + 1 # line thickness
color = color or [random.randint(0, 255) for _ in range(3)]
c1, c2 = (int(x[0]), int(x[1])), (int(x[2]), int(x[3]))
cv2.rectangle(img, c1, c2, color, thickness=tl)