개정판 ca84c19d
issue #1366: training test
DTI_PID/WebServer/symbol_training/src/doftech_dataset.py | ||
---|---|---|
54 | 54 |
self.anno_list.extend(new_label_list) |
55 | 55 |
|
56 | 56 |
def rescale_func(self, img_list, anno_list): |
57 |
scale_array = [0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3] |
|
57 |
#scale_array = [0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3] |
|
58 |
scale_array = [0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.0, 1.0, 1.0] |
|
58 | 59 |
|
59 | 60 |
new_image_list = [] |
60 | 61 |
new_label_list = [] |
... | ... | |
67 | 68 |
new_label = [] |
68 | 69 |
if obj[0] - cut_range > 0 and obj[1] - cut_range > 0 and obj[2] + cut_range > 0 and obj[ |
69 | 70 |
3] + cut_range > 0: |
70 |
random_int = random.randint(0, 6)
|
|
71 |
random_int = random.randint(0, 9)
|
|
71 | 72 |
|
72 | 73 |
cut_xmin = obj[0] - cut_range |
73 | 74 |
cut_ymin = obj[1] - cut_range |
... | ... | |
130 | 131 |
origin_image = cv2.cvtColor(origin_image, cv2.COLOR_BGR2RGB) |
131 | 132 |
if self.is_training: |
132 | 133 |
if self.use_rotation: |
133 |
angle_array = [0,30,45,60,90,120,135,150,180,210,240,255,270,300,330,345,360] |
|
134 |
random_int = random.randint(0,16) |
|
134 |
#angle_array = [0,30,45,60,90,120,135,150,180,210,240,255,270,300,330,345,360] |
|
135 |
angle_array = [0,30,45,60,90,120,135,150,180,210,240,255,270,300,330,345, 0,90,180,270, 0,90,180,270, 0,90,180,270,] |
|
136 |
random_int = random.randint(0,27) |
|
135 | 137 |
transformations = Compose([Rotate(angle_array[random_int], self.image_size)]) |
136 | 138 |
else : |
137 | 139 |
transformations = Compose([Resize(self.image_size)]) |
내보내기 Unified diff