--- license: mit language: - en library_name: onnx tags: - face-detection - centerface - dynamic-input-shape - rootreal --- # CenterFace — dynamic-input-shape ONNX (RootReal-curated) A **dynamic-input-shape** ONNX export of **CenterFace** (anchor-free face detection + 5-point landmarks), curated by RootReal to fix [Forgejo #11856](https://git.rootreal.io/textpast/rootreal/issues/11856). ## Why this exists The upstream [`Star-Clouds/CenterFace`](https://github.com/Star-Clouds/CenterFace) export (`centerface.onnx`, MIT) declared a **fully static** input `input.1 = [10, 3, 32, 32]` (fixed batch of 10 AND fixed 32×32 spatial dims). ONNX Runtime therefore rejects any real detection tensor `(1, 3, H, W)`: ``` INVALID_ARGUMENT: Got invalid dimensions for input: input.1 index: 0 Got: 1 Expected: 10 index: 2 Got: H Expected: 32 index: 3 Got: W Expected: 32 ``` The CenterFace graph is **purely convolutional** (60 Conv / 59 BatchNormalization / 42 Relu / 13 Add / 3 ConvTranspose / 1 Sigmoid — no Reshape/Flatten/Tile that could bake in static shape values), so the static shape is **purely an export artifact**. This model rewrites `input.1` to **`[batch(dynamic), 3, height(dynamic), width(dynamic)]`** with **zero weight/node change** — the canonical equivalent of passing `dynamic_axes={'input.1': {0:'batch', 2:'height', 3:'width'}}` to `torch.onnx.export`, without needing PyTorch. ## Provenance / reproduction - **Derived from:** `Star-Clouds/CenterFace` `models/onnx/centerface.onnx` (MIT). - **Upstream sha256:** `77e394b51108381b4c4f7b4baf1c64ca9f4aba73e5e803b2636419578913b5fe` - **This artifact sha256:** `884bf341ce5ba95a30667f86eaa36f24d62041d9d28002eee3bb6926701924bf` - **Size:** 7,532,788 bytes (362 initializers + 178 nodes, byte-identical to upstream). - **Reproduce:** `infrastructure/scripts/ml/centerface-rewrite-input-shape-dynamic.py` in the [RootReal repo](https://git.rootreal.io/textpast/rootreal) regenerates this file byte-for-byte from the upstream MIT source. ## Accuracy WIDER FACE val Easy/Medium/Hard: 0.935 / 0.924 / 0.875 (unchanged from upstream — only the input shape declaration differs; the trained weights are identical). ## Migration note Hosted under a personal namespace (`SCKEMPER/centerface-dynamic`) because the RootReal Hugging Face org (`rootreal/`) was not writable at curation time. Migration target: `rootreal/centerface` (pending org access). The model is a deterministic MIT derivation fully reproducible from the upstream source via the committed script, so re-hosting is trivial.