Skip to content

Add image processing utilities for HDR/SDR video preprocessing#17269

Open
metascroy wants to merge 1 commit intopytorch:mainfrom
metascroy:export-D92471879
Open

Add image processing utilities for HDR/SDR video preprocessing#17269
metascroy wants to merge 1 commit intopytorch:mainfrom
metascroy:export-D92471879

Conversation

@metascroy
Copy link
Contributor

Summary:
This diff adds a new executorch.extension.vision module with image processing utilities for preprocessing and postprocessing video frames in ML pipelines.

Key features:

  • Transfer functions: PQ (ST.2084), HLG (BT.2100), sRGB gamma
  • Color gamut conversion: BT.2020 ↔ BT.709 matrices
  • Factory methods for common pipelines: HDR10→linear, HLG→linear, SDR→linear, ImageNet normalization
  • ImagePreprocessor and ImagePostprocessor classes that produce torch.export.ExportedProgram for on-device execution

Testing:

  • Comprehensive tests validate implementations against the colour-science reference library
  • Tests cover transfer function accuracy, gamut matrix correctness, and full E2E pipelines
  • Added colour-science as a test dependency in both Buck (TARGETS) and OSS (pyproject.toml)
    This diff adds a new executorch.extension.vision module with image processing utilities for preprocessing and postprocessing video frames in ML pipelines.

Key features:

  • Transfer functions: PQ (ST.2084), HLG (BT.2100), sRGB gamma
  • Color gamut conversion: BT.2020 ↔ BT.709 matrices
  • Factory methods for common pipelines: HDR10→linear, HLG→linear, SDR→linear, ImageNet normalization
  • ImagePreprocessor and ImagePostprocessor classes that produce torch.export.ExportedProgram for on-device execution

Testing:

  • Reference correctness tests in extension/vision/test/ validate implementations against the colour-science library
  • CoreML integration tests in backends/apple/coreml/test/test_image_processing.py verify CoreML delegate matches EP output and demonstrate recommended dtype/compute precision patterns for deployment
  • Added colour-science as a test dependency in both Buck (TARGETS) and OSS (pyproject.toml)

Differential Revision: D92471879

Summary:
This diff adds a new `executorch.extension.vision` module with image processing utilities for preprocessing and postprocessing video frames in ML pipelines.

**Key features:**
- Transfer functions: PQ (ST.2084), HLG (BT.2100), sRGB gamma
- Color gamut conversion: BT.2020 ↔ BT.709 matrices
- Factory methods for common pipelines: HDR10→linear, HLG→linear, SDR→linear, ImageNet normalization
- `ImagePreprocessor` and `ImagePostprocessor` classes that produce `torch.export.ExportedProgram` for on-device execution

**Testing:**
- Comprehensive tests validate implementations against the `colour-science` reference library
- Tests cover transfer function accuracy, gamut matrix correctness, and full E2E pipelines
- Added `colour-science` as a test dependency in both Buck (TARGETS) and OSS (pyproject.toml)
This diff adds a new `executorch.extension.vision` module with image processing utilities for preprocessing and postprocessing video frames in ML pipelines.

**Key features:**
- Transfer functions: PQ (ST.2084), HLG (BT.2100), sRGB gamma
- Color gamut conversion: BT.2020 ↔ BT.709 matrices
- Factory methods for common pipelines: HDR10→linear, HLG→linear, SDR→linear, ImageNet normalization
- `ImagePreprocessor` and `ImagePostprocessor` classes that produce `torch.export.ExportedProgram` for on-device execution

**Testing:**
- Reference correctness tests in `extension/vision/test/` validate implementations against the `colour-science` library
- CoreML integration tests in `backends/apple/coreml/test/test_image_processing.py` verify CoreML delegate matches EP output and demonstrate recommended dtype/compute precision patterns for deployment
- Added `colour-science` as a test dependency in both Buck (TARGETS) and OSS (pyproject.toml)

Differential Revision: D92471879
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 6, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17269

Note: Links to docs will display an error until the docs builds have been completed.

❌ 5 New Failures, 2 Unrelated Failures

As of commit e1effb7 with merge base f48a600 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 6, 2026
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Feb 6, 2026

@metascroy has exported this pull request. If you are a Meta employee, you can view the originating Diff in D92471879.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant