Add PlantNet-300K fine-grained plant identification sample (CompiledModel GPU)#202
Open
john-rocky wants to merge 6 commits into
Open
Add PlantNet-300K fine-grained plant identification sample (CompiledModel GPU)#202john-rocky wants to merge 6 commits into
john-rocky wants to merge 6 commits into
Conversation
…odel GPU) PlantNet-300K ResNet18 (cpoisson/plantnet300k-resnet18, Apache-2.0; NeurIPS 2021 plantnet/PlantNet-300K) — fine-grained identification of 1081 plant species, running fully on the LiteRT CompiledModel GPU at ~16 ms/frame on a Pixel 8a. Plain torchvision ResNet18 (pure CNN) -> fully GPU-compatible (37/37 nodes on the delegate, 1 partition) with one patch: ZeroPadMaxPool (the ResNet stem maxpool's -inf PADV2 is rejected as 'PADV2: src has wrong size', replaced by an explicit 0-pad + unpadded maxpool, exact post-ReLU). CPU-exact vs PyTorch (corr 0.99999999999); device Mali GPU corr 0.99999, top-1 match. Sample at compiled_model_api/image_classification/plantnet_kotlin_gpu (android app + conversion scripts), with a deterministic bundled plant photo demo.
john-rocky
force-pushed
the
plantnet-plant-identification-sample
branch
from
July 6, 2026 20:58
2141caf to
0f812c8
Compare
Merge hard-wrapped lines (paragraphs, list items, blockquotes) into single lines so the markdown renders as normal prose. Tables, code blocks, and content are unchanged.
… conversion script, copyright 2026
Wrap every line in the conversion scripts to the 80-column limit of the Google Python Style Guide and add Args/Returns sections to the module-level function docstrings. No behavior changes.
Restructure the app to the image_segmentation reference: a thin ComponentActivity host over a MainViewModel + immutable UiState, UI strings moved to res/values, a Gradle version catalog, and status-bar inset padding. Inference/model code is unchanged.
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.
PlantNet-300K (NeurIPS 2021) ResNet18 (cpoisson/plantnet300k-resnet18, Apache-2.0) — fine-grained identification of 1081 plant species, running fully on the LiteRT
CompiledModelGPU at ~16 ms/frame on a Pixel 8a. The first fine-grained classifier in the samples.Plain torchvision ResNet18 (pure CNN) → fully GPU-compatible (37/37 nodes on the delegate, 1 partition; device corr 0.99999, top-1 match) with one patch: the ResNet stem
MaxPool2d(padding=1)lowers to a PADV2 with-infpadding (PADV2: src has wrong sizeon the Mali delegate), replaced by an explicit 0-pad + unpadded maxpool (exact since the maxpool input is post-ReLU ≥ 0). CPU-exact vs PyTorch (corr 0.99999999999).Model: litert-community/PlantNet-300K-ResNet18-LiteRT (47 MB).
Sample at
compiled_model_api/image_classification/plantnet_kotlin_gpu(android app + conversion scripts), with a deterministic bundled plant photo demo.