🔨 [Update] Padding color, align with origin v9
Browse files
yolo/tools/data_augmentation.py
CHANGED
@@ -29,7 +29,7 @@ class AugmentationComposer:
|
|
29 |
|
30 |
|
31 |
class PadAndResize:
|
32 |
-
def __init__(self, image_size, background_color=(
|
33 |
"""Initialize the object with the target image size."""
|
34 |
self.target_width, self.target_height = image_size
|
35 |
self.background_color = background_color
|
@@ -99,7 +99,7 @@ class Mosaic:
|
|
99 |
more_data = self.parent.get_more_data(3) # get 3 more images randomly
|
100 |
|
101 |
data = [(image, boxes)] + more_data
|
102 |
-
mosaic_image = Image.new("RGB", (2 * img_sz, 2 * img_sz))
|
103 |
vectors = np.array([(-1, -1), (0, -1), (-1, 0), (0, 0)])
|
104 |
center = np.array([img_sz, img_sz])
|
105 |
all_labels = []
|
|
|
29 |
|
30 |
|
31 |
class PadAndResize:
|
32 |
+
def __init__(self, image_size, background_color=(114, 114, 114)):
|
33 |
"""Initialize the object with the target image size."""
|
34 |
self.target_width, self.target_height = image_size
|
35 |
self.background_color = background_color
|
|
|
99 |
more_data = self.parent.get_more_data(3) # get 3 more images randomly
|
100 |
|
101 |
data = [(image, boxes)] + more_data
|
102 |
+
mosaic_image = Image.new("RGB", (2 * img_sz, 2 * img_sz), (114, 114, 114))
|
103 |
vectors = np.array([(-1, -1), (0, -1), (-1, 0), (0, 0)])
|
104 |
center = np.array([img_sz, img_sz])
|
105 |
all_labels = []
|