Skip to content

pyramid module functions upcasts single precision floats to double precision #4190

Closed

Description

@rfezzani

Description

Because of the use of skimage.transform.resize, the functions of the module skimage.transform.pyramid upcast single precision float arrays to double precision.

PR #4128 solves this issue.

Way to reproduce

>>> from skimage.transform import pyramids
>>> a = np.random.rand(5).astype('float32')
>>> pyramids.pyramid_reduce(a).dtype
dtype('float64')
>>> pyramids.pyramid_expand(a).dtype
dtype('float64')
>>> [img.dtype for img in pyramids.pyramid_gaussian(a)]
[dtype('float32'), dtype('float64'), dtype('float64'), dtype('float64')]
>>> [img.dtype for img in pyramids.pyramid_laplacian(a)]
[dtype('float64'), dtype('float64'), dtype('float64'), dtype('float64')]

Version information

3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0]
Linux-4.15.0-64-generic-x86_64-with-debian-buster-sid
scikit-image version: 0.16.dev0
numpy version: 1.16.4

Activity

  1. hmaarrfk commented on Sep 26, 2019

    @hmaarrfk
    Member

    Nice finds, and fixed!!!!

  2. rfezzani commented on Oct 1, 2019

    @rfezzani
    MemberAuthor

    Fixed by #4128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions