ML Scenario Speedup: Make UnpackIntoRgbPlanes and PackFromRgbPlanes public APIs #2350
Unanswered
georg-jung
asked this question in
Ideas
Replies: 1 comment 1 reply
-
I'm not against exposing this functionality but we need to get the API right. The main reason why this is internal is the asymmetry between the pack and unpack methods: pack consumes byte buffers while unpack will produce float buffers. In this form it feels like an implementation detail of our Jpeg codec rather than a well-designed generic solution that can be made public. Doesn't this asymmetry limit you or force you to do pre/post conversions? Can you present some specific use-cases (best with sample code/pseudocode)? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
rel: #1955
rel: #1462
I think it would be great to make
PackFromRgbPlanes
andUnpackIntoRgbPlanes
publicly available.src/ImageSharp/PixelFormats/PixelOperations%7BTPixel%7D.cs
This way it would be easy to create efficient, vectorized code that transforms image data loaded using ImageSharp to arbitrary tensor formats for machine learning scenarios. The code to support this use case seems to already exist as far is I can tell, it simply is no
public
API but aninternal
one.If I'm overlooking any well-suited public APIs please point me in the right direction :)
Beta Was this translation helpful? Give feedback.
All reactions