File size: 3,931 Bytes
31e2a6c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | ---
license: other
license_name: apple-amlr
license_link: https://huggingface.co/AXERA-TECH/sharp-ax8860/blob/main/LICENSE_MODEL
pipeline_tag: image-to-3d
tags:
- gaussian-splatting
- 3dgs
- novel-view-synthesis
- axera
- ax8860
- npu
---
# SHARP on AX8860
Single image β 3D Gaussian Splatting **on the AX8860 NPU in ~1.6 s**: Apple's [SHARP](https://github.com/apple/ml-sharp) model converted for the AXERA AX8860.
εεΌ η
§η β 3D ι«ζ―οΌ3DGSοΌοΌ**AX8860 η«―δΎ§ηΊ¦ 1.6 η§**γ
Code (C++ / C API / Python / web demo): **[github.com/AXERA-TECH/sharp-ax8860](https://github.com/AXERA-TECH/sharp-ax8860)**
<p align="center"><img src="assets/ant.webp" width="808" alt="left: input photo, right: 3D Gaussians generated on AX8860, rendered from moving viewpoints"></p>
<p align="center"><sub>Left: input photo Β· Right: 3D Gaussians generated on the AX8860 board, rendered from new viewpoints</sub></p>
## Performance
| Stage | Time (ms) | Where |
|---|---:|---|
| JPEG decode (hardware JDEC) | 20β60 | VDEC |
| Pre-process | ~70 | CPU |
| ViT Γ36 (DINOv2-L, FP8) | ~760 | NPU |
| Tail (DPT + Gaussian decoder, U16) | ~490 | NPU |
| Depth head last layer (FP32) | ~50 | CPU |
| Post-process | ~160 | CPU |
| Write SPZ / PLY | ~170 / ~65 | CPU |
| **End-to-end** | **~1600β1700** | |
AX8860, 4 NPU cores, SDK V0.6.0. Model loading (once): ~0.8 s. Output: 1,179,648 Gaussians, SPZ 12β17 MB or PLY 66 MB.
Quality vs. the official FP32 model on GPU (renderings from 4 shifted viewpoints, photos not used for calibration): median PSNR **41.9 dB** on 29 COCO photos, **33.9 dB** on 50 DIV2K photos.
## Files
```
models/
βββ fp8vit/ # DINOv2-L ViT (patch + image encoder): FP8 kernels + weight banks
βββ sharp_tail.axmodel # DPT decoder + Gaussian decoder, U16
βββ h4_wb.bin # last 1x1 conv of the depth head (fp32, run on the CPU)
bin/
βββ sharp_ax # command line tool (aarch64, glibc >= 2.38)
βββ libsharp_ax.so # C API for Python / other languages
python/
βββ sharp_ax.py # ctypes binding
βββ web_demo.py # browser demo served from the board
βββ web_demo.html
```
## Usage
```bash
# command line: .spz = SPZ v2, .ply = same PLY layout as ml-sharp
LD_LIBRARY_PATH=/opt/lib ./bin/sharp_ax -m models -i photo.jpg -o photo.spz
# Python (standard library only)
cp bin/libsharp_ax.so python/ && cd python
python3 -c "from sharp_ax import Sharp; print(Sharp('../models').run('photo.jpg', 'photo.spz'))"
# web demo: open http://<board-ip>:8080, upload a photo, view the result in the browser
python3 web_demo.py -m ../models --port 8080
```
The `.spz` result can also be opened in viewers such as [SuperSplat](https://superspl.at/editor).
## Model derivative and license
*Apple Machine Learning Research Model is licensed under the Apple Machine Learning Research Model License Agreement.*
These files are **model derivatives** of Apple's SHARP checkpoint, released under the [Apple Machine Learning Research Model License](LICENSE_MODEL) β **for non-commercial research purposes only**. This project is not affiliated with or endorsed by Apple.
Changes made to the original model:
- Split into a ViT part (DINOv2-L patch and image encoders, run 35 + 1 times per image) and a decoder part (DPT + Gaussian decoder).
- ViT weights and activations quantized to FP8 and run with custom NPU kernels.
- Decoder compiled with pulsar2 using U16 activations (INT8 weights), calibrated on 80 photos; 16-bit tensors above 128 MiB split along channels; the image is fed as a 2Γ2 space-to-depth tensor.
- The last 1Γ1 convolution of the depth head is taken out of the NPU graph and computed on the CPU in FP32.
- Pre- and post-processing re-implemented in C++; optional SPZ output (quantized positions/attributes).
Demo photo: [Pexels](https://www.pexels.com) (Niko Desmon).
|