Skip to content

Add 6DRepNet head pose estimation sample (CompiledModel GPU) - #211

Open
john-rocky wants to merge 5 commits into
google-ai-edge:mainfrom
john-rocky:sixdrepnet-head-pose-sample
Open

Add 6DRepNet head pose estimation sample (CompiledModel GPU)#211
john-rocky wants to merge 5 commits into
google-ai-edge:mainfrom
john-rocky:sixdrepnet-head-pose-sample

Conversation

@john-rocky

Copy link
Copy Markdown
Contributor

6DRepNet (ICIP 2022, MIT) regresses a continuous 6D rotation from a face crop — yaw / pitch / roll for driver-monitoring, AR, and attention — running fully on the LiteRT CompiledModel GPU at ~21 ms/frame on a Pixel 8a. The first head-pose sample.

Deploy-mode RepVGG (re-parameterized to plain 3×3 convs + ReLU) is a pure CNN → fully GPU-compatible (36/36 nodes on the delegate, 1 partition; device corr 0.9993) with zero patches. The 6D → Gram-Schmidt rotation matrix → Euler decode runs host-side. CPU-exact vs PyTorch (corr 1.0). Input [1,3,224,224] RGB ImageNet-norm face crop, output [1,6].

Model: litert-community/6DRepNet-HeadPose-LiteRT.

Sample at compiled_model_api/head_pose_estimation/sixdrepnet_kotlin_gpu (android app + conversion scripts), with a deterministic bundled-face 3D-axes demo.

6DRepNet (thohemp/6DRepNet, ICIP 2022, MIT) regresses a continuous 6D rotation from a face crop — yaw/pitch/roll for driver-monitoring, AR, and attention — running fully on the LiteRT CompiledModel GPU at ~21 ms/frame on a Pixel 8a. First head-pose sample.

Deploy-mode RepVGG (re-parameterized to plain convs) is a pure CNN → fully GPU-compatible (36/36 nodes, 1 partition; device corr 0.9993) with zero patches. The 6D -> Gram-Schmidt rotation matrix -> Euler decode runs host-side. CPU-exact vs PyTorch (corr 1.0). Input [1,3,224,224] RGB ImageNet-norm face crop, output [1,6].

Sample at compiled_model_api/head_pose_estimation/sixdrepnet_kotlin_gpu (android app + conversion scripts), with a deterministic bundled-face 3D-axes demo.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant