From c8e6f23a31e89e11f52d4ba2521bb1efd8804fb0 Mon Sep 17 00:00:00 2001 From: iperov Date: Wed, 11 Aug 2021 10:06:18 +0400 Subject: [PATCH] fix SampleProcessor --- samplelib/SampleProcessor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/samplelib/SampleProcessor.py b/samplelib/SampleProcessor.py index 45931e7..986c44b 100644 --- a/samplelib/SampleProcessor.py +++ b/samplelib/SampleProcessor.py @@ -84,19 +84,20 @@ class SampleProcessor(object): LandmarksProcessor.draw_landmarks (sample_bgr, sample_landmarks, (0, 1, 0)) params_per_resolution = {} - warp_rnd_state = np.random.RandomState (sample_rnd_seed-1) + warp_rnd_state = np.random.RandomState (sample_rnd_seed-1) for opts in output_sample_types: resolution = opts.get('resolution', None) if resolution is None: continue - params_per_resolution[resolution] = imagelib.gen_warp_params(resolution, + if resolution not in params_per_resolution: + params_per_resolution[resolution] = imagelib.gen_warp_params(resolution, sample_process_options.random_flip, rotation_range=sample_process_options.rotation_range, scale_range=sample_process_options.scale_range, tx_range=sample_process_options.tx_range, ty_range=sample_process_options.ty_range, rnd_state=warp_rnd_state) - + outputs_sample = [] for opts in output_sample_types: sample_type = opts.get('sample_type', SPST.NONE)