Strange behavior when trying to guess pixel type of non-image objects
Currently when propagating pixel type, we try to read every value in parameters as an input file, without check what kind of param it is.
We should only guess the pixel type of input images when propagating the dtype.
I just added a small function __is_input_image_key
, also the function return at the fist found image pixel type, instead of applying get_pixel_type
to all parameters.
This result in a significant speedup of initializing objects with preserve_dtype=True
Edited by Vincent Delbar