Skip to content

Commit

Permalink
Update datasets.py
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Mar 5, 2021
1 parent e2e785d commit 04cb07f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ def load_mosaic(self, index):
labels4, segments4 = [], []
s = self.img_size
yc, xc = [int(random.uniform(-x, 2 * s + x)) for x in self.mosaic_border] # mosaic center x, y
indices = [index] + [random.randint(0, self.n - 1) for _ in range(3)] # 3 additional image indices
indices = [index] + [self.indices[random.randint(0, self.n - 1)] for _ in range(3)] # 3 additional image indices
for i, index in enumerate(indices):
# Load image
img, _, (h, w) = load_image(self, index)
Expand Down Expand Up @@ -721,7 +721,7 @@ def load_mosaic9(self, index):

labels9, segments9 = [], []
s = self.img_size
indices = [index] + [random.randint(0, self.n - 1) for _ in range(8)] # 8 additional image indices
indices = [index] + [self.indices[random.randint(0, self.n - 1)] for _ in range(8)] # 8 additional image indices
for i, index in enumerate(indices):
# Load image
img, _, (h, w) = load_image(self, index)
Expand Down

0 comments on commit 04cb07f

Please sign in to comment.