You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and all random things are sampled using either of these generators.
Request:
I would like to do similar thing with cv2.randn. It would be great to have something like cv2.random.default_rng(seed) or cv2.random.Random(seed),
or at least to be able to pass seed like cv2.randn(dst=gaussian_sampled_arr, mean=mean_vector, stddev=std_dev_vector, seed=seed) to the functions.
Currently we can fix seed in opencv globally with cv2.setRNGSeed(cv2_seed), but it could mess things up if other parts of the pipeline depend on the seed as well.
The text was updated successfully, but these errors were encountered:
C++ allows to create dedicated RNG object for each sequence as you want, but the RNG class is not wrapped to Python and other languages. I'll take a look if it's feasible without API change.
Context of the request
cv2.randn
is materially faster thannp.random
to generate arrays of random numbers, would love to use in Albumentations library everywhere.One limitation is reproducibility.
I prefer to fix seed for random number generator at the level of instance, and not global level.
I.e.
=> get same sequence of random transforms every time I run the code.
To make it possible Compose has under the hood:
and all random things are sampled using either of these generators.
Request:
I would like to do similar thing with
cv2.randn
. It would be great to have something likecv2.random.default_rng(seed)
orcv2.random.Random(seed)
,or at least to be able to pass seed like
cv2.randn(dst=gaussian_sampled_arr, mean=mean_vector, stddev=std_dev_vector, seed=seed)
to the functions.Currently we can fix seed in opencv globally with
cv2.setRNGSeed(cv2_seed)
, but it could mess things up if other parts of the pipeline depend on the seed as well.The text was updated successfully, but these errors were encountered: