Repository navigation
Add CPU image decoders with measured per-format backends - #12
Closed
MilkClouds wants to merge 5 commits into
Closed
MilkClouds wants to merge 5 commits into
MilkClouds wants to merge 5 commits into
Conversation
Collaborator
Author
|
Superseded by a smaller Python-level OpenCV image adapter. The replacement PR will retain the comparison findings without adding native image builds or vendored codec sources. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Image decoding now has a TorchCodec-style CPU API without a Pillow or PyTorch runtime dependency. Images use dedicated codec backends selected through pixel comparisons and release-build measurements instead of routing through FFmpeg.
decode_image,decode_jpeg/png/webp/gif/avif/heic, andImageReadMode, returning NumPy CHW/NCHW arrays. Support mode/dtype conversion, orientation, alpha, animations, JPEG lists/CMYK, PNG 8/16-bit samples, and high-depth AVIF/HEIC.pngfor PNG; libjpeg-turbo for JPEG; libwebp/libwebpdemux for WebP; giflib for GIF; and libavif/dav1d/libyuv for AVIF. Wheel builds bundle these dependencies with their licenses. HEIC continues to use optional system libheif. Audio/video retain FFmpeg.imageandlibjpeg-turbo-rs. Across 54 measured RGB inputs, the selected implementation matched TorchCodec pixels exactly; JPEG/WebP latency was roughly comparable and PNG was about 1.7x faster. This is a limited x86 workload, not a general performance or full-format parity guarantee. Experimental crates are isolated from production dependencies.Validation:
pytest --compare: 444 passed locally.-D warningspassed.See
docs/image-backends.mdfor versions, methodology, raw reports, alternatives and limitations. Python runtime dependencies remain NumPy only. This PR does not addaverage_rateor change the released version.