[DOC] Document common computer vision patterns#19518
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19518
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 New Failure, 5 Unrelated Failures, 1 Unclassified FailureAs of commit 57a6fb7 with merge base e25369b ( NEW FAILURE - The following job has failed:
UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but was 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. |
|
@pytorchbot label "release notes: none" |
GregoryComer
left a comment
There was a problem hiding this comment.
Overall, this looks really good. I tagged a couple of platform-specific experts on the Android and iOS details. Thanks!
|
|
||
| The following Kotlin helper resizes a `Bitmap`, reads RGB pixels, applies ImageNet-style normalization, and packs the result as `NCHW` `float32` data for `Tensor.fromBlob`. | ||
|
|
||
| ```kotlin |
There was a problem hiding this comment.
@psiddh @kirklandsign Could you take a look at the Android-specific code here? Thanks!
|
|
||
| The following Swift helper draws a `UIImage` into an RGB buffer, normalizes it, and creates a channels-first `Tensor<Float>`. | ||
|
|
||
| ```swift |
There was a problem hiding this comment.
@shoumikhin @metascroy Could you take a look at the iOS code here? Thanks!
Fixes #8831
Summary
NCHWversusNHWCtensor layouts.Bitmapand iOSUIImageimage-to-tensor examples, plus quick guidance for classifier, segmentation, detection, and instance segmentation outputs.Test plan
git diff --check origin/main..HEADpython -m compileall -q docs/source/conf.py docs/source/custom_directives.pycd docs && MPLCONFIGDIR=/tmp/matplotlib-executorch-8831 PYTHONPATH=../pip-out/lib.linux-x86_64-cpython-312 python -m sphinx -D plot_gallery=0 -b html --keep-going source _build/html source/working-with-cv-models.md source/advanced-topics-section.md source/pathway-advanced.md source/getting-started.mdWARNING,ERROR,CRITICAL,system-message, orproblematicartifactscc @mergennachin @AlannaBurke @byjlw