torch / image

An Image toolbox for Torch.
Other
208 stars 141 forks source link

Only scale output in image.crop if dst is provded #138

Closed colesbury closed 8 years ago

colesbury commented 8 years ago

This speeds up calls to image.crop that don't pass a dst image

deltheil commented 8 years ago

I was thinking it could have been useful to detect that source and destination dimensions are equal at image.scale level (and thus copy the input and early exit), but anyway this avoids the need of copying.

colesbury commented 8 years ago

@andresy or @soumith, would you please review this? I'm seeing about ~20%-30% reduction in CPU usage by removing the often unnecessary scale.

soumith commented 8 years ago

Cedric is now a reviewer of this repo as well.

colesbury commented 8 years ago

👍