Evizero / Augmentor.jl

A fast image augmentation library in Julia for machine learning.
https://evizero.github.io/Augmentor.jl/
Other
138 stars 47 forks source link

unnecessary type promotion #62

Closed AlfTetzlaff closed 3 years ago

AlfTetzlaff commented 4 years ago

Hi, playing around with the package I just saw that it is often not type stable, e.g. putting in an image containing Float32 it returns a Float64 image. Affected functions I have tested:

Resize Rotate Shear Zoom

I think working on this issue would increase the performance even more.

Edit: Example:

raw = rand(Float32,8,100,100)
img = view(reinterpret(SVector{8,Float32}, raw), 1,:,:)  # now its an AbstractMatrix
imgcp = copy(img)  # for demo purposes
pl = Rotate(123)
aug = augment(imgcp, pl)
typeof(aug) == typeof(imgcp)
maxfreu commented 4 years ago

This issue is probably upstream and related to #359 in Interpolations.jl.

AlfTetzlaff commented 3 years ago

Closing, as the fix in Interpolations.jl has been merged.