@@ -66,7 +66,9 @@ def generate_dataset(self) -> None:
66
66
67
67
mp_ctx = get_context ("spawn" ) # On Mac 10.15 and Python 3.7 fork leads to hangs
68
68
with mp_ctx .Pool (processes = self ._cpu_count ) as pool :
69
- params = pool .map (self ._generate_category , [Random (i ) for i in range (self ._categories )])
69
+ params = pool .map (
70
+ self ._generate_category , [Random (i ) for i in range (self ._categories )]
71
+ ) # nosec - disable B311
70
72
71
73
instances_weights = np .repeat (self ._weights , self ._instances , axis = 0 )
72
74
weight_per_img = np .tile (instances_weights , (self ._categories , 1 ))
@@ -110,7 +112,7 @@ def _generate_image_batch(
110
112
111
113
for i , param , w in zip (indices , params , weights ):
112
114
image = self ._generate_image (
113
- Random (i ),
115
+ Random (i ), # nosec - disable B311
114
116
param ,
115
117
self ._iterations ,
116
118
self ._height ,
@@ -119,7 +121,7 @@ def _generate_image_batch(
119
121
weight = w ,
120
122
)
121
123
color_image = colorize (image , net )
122
- aug_image = augment (Random (i ), color_image , background_colors )
124
+ aug_image = augment (Random (i ), color_image , background_colors ) # nosec - disable B311
123
125
save_image (
124
126
osp .join (self ._output_dir , "{:06d}.png" .format (i )), aug_image , create_dir = True
125
127
)
0 commit comments