@@ -66,7 +66,10 @@ 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 ,
71
+ [Random (i ) for i in range (self ._categories )], # nosec - disable B311
72
+ )
70
73
71
74
instances_weights = np .repeat (self ._weights , self ._instances , axis = 0 )
72
75
weight_per_img = np .tile (instances_weights , (self ._categories , 1 ))
@@ -110,7 +113,7 @@ def _generate_image_batch(
110
113
111
114
for i , param , w in zip (indices , params , weights ):
112
115
image = self ._generate_image (
113
- Random (i ),
116
+ Random (i ), # nosec - disable B311
114
117
param ,
115
118
self ._iterations ,
116
119
self ._height ,
@@ -119,7 +122,7 @@ def _generate_image_batch(
119
122
weight = w ,
120
123
)
121
124
color_image = colorize (image , net )
122
- aug_image = augment (Random (i ), color_image , background_colors )
125
+ aug_image = augment (Random (i ), color_image , background_colors ) # nosec - disable B311
123
126
save_image (
124
127
osp .join (self ._output_dir , "{:06d}.png" .format (i )), aug_image , create_dir = True
125
128
)
0 commit comments