Training-free Spatially Grounded Geometric Shape Encoding
Project description
Training-free Spatially Grounded Geometric Shape Encoding (Technical Report)
Yuhang He
Microsoft Research
Quick Test
-
To build up the environment
pip install requirements.txt. -
Run
quick_test.pyto experience shape geometry encoding, shape pose encoding and their joint encoding.#Run all tests:: python quick_test.py #Run a specific subset with debug output:: python quick_test.py --tests pose geometry --verbose
-
XShapeCorpus dataset generation, go to README.md.
XShapeEnc Summary
| Method | arbitrary shape? | high frequency? | training-free? | task-agnostic? | spatial-context? |
|---|---|---|---|---|---|
| AngularSweep | ✗ | ✗ | ✓ | ✗ | ✓ |
| Poly2Vec | ✗ | ✗ | ✗ | ✗ | ✓ |
| Space2Vec | ✗ | ✗ | ✗ | ✗ | ✓ |
| DeepSDF | ✓ | ✓ | ✗ | ✓ | ✗ |
| 2DPE | ✗ | ✗ | ✗ | ✓ | ✓ |
| ShapeEmbed | ✓ | ✓ | ✗ | ✓ | ✗ |
| ShapeDist | ✓ | ✗ | ✓ | ✓ | ✗ |
| XShapeEnc (Ours) | ✓ | ✓ | ✓ | ✓ | ✓ |
As shown in the table above, XShapeEnc encodes an arbitrary 2D geometric shape associated with a spatial position (e.g., x-, y- coordinate, scale) within a unified framework. It is totally training-free, task-agnostic and frequency-rich, while enjoying the advantage of controllable emphasis between shape geometry and shape pose encoding. In summary, it provides flexible encoding:
| Options | Can XShapeEnc do? |
|---|---|
| Just Shape Rotation Invariant Feature | Yes |
| Just Shape Rotation Variant Feature | Yes |
| Just Shape Geometry Encoding | Yes |
| Just Shape Pose Encoding | Yes |
| Shape Geometry and Pose Joint Encoding | Yes |
XShapeEnc Pipeline
XShapeEnc encoding pipeline is shown in the Figure above. It can independently encode shape geometry, shape pose or geometry-pose jointly. The whole encoding framework is based on Zernike basis. The shape pose requires to be first converted into harmonic pose field so as to be encodable by Zernike basis.
Experiment
-
Inter-Shape Polygon-Polygon Topological Relation Classification
We run experiment on spatially grounded polygon pair topological relation classification. As shown in the figure above, we classify 5 main relations: Disjoint, Within, Overlap, Touch and Equal. The polygon shapes are from Singapore and New York building bird-eye-view (BEV) map. The result is shown in the table below,
Method Singapore New York PointSet 0.670 0.564 ShapeContexts 0.581 0.525 AngularSweep 0.606 0.546 Space2Vec 0.706 0.632 ResNet18 0.674 0.753 ViT 0.669 0.752 CLIP 0.700 0.779 Poly2Vec 0.702 0.684 XShapeEnc (Ours) 0.760 0.768 From this table, we can see that XShapeEnc maintains highly competitive performance.
-
Invertibility Visualization
We test XShapeEnc's invertibility property by running encoding-to-shape inversion from various commonly used encodng length: 64, 128, 256, 512, 1024, 2048, 4096. The result is shown in the Figure above, from which we can observe that larger encoding length leads to higher-fielity shape recovery.
-
Shape Geometry Clustering Visualization
We test XShapeEnc's shape geometry encoding inter- and intra- geometry discriminability by running t-SNE clustering on augmented 4 complex shapes. As shown in the figure above, XShapeEnc maintains the discriminability while most of the comparing baselines loosing such discriminability.
Cite XShapeEnc
@inproceedings{yuhheXShapeEnc2026,
title={Training-free Spatially Grounded Geometric Shape Encoding (Technical Report)},
author={He, Yuhang},
booktitle={arXiv:2604.07522},
year={2026}}
Contact
Email: yuhanghe[at]microsoft.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xshapeenc-0.1.0.tar.gz.
File metadata
- Download URL: xshapeenc-0.1.0.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bef3d02491dad64a1d4acf6abdf31090f9960907d501ecf320ef8c16818710ce
|
|
| MD5 |
abf2f16a290d89f3c8da1f1bc7376198
|
|
| BLAKE2b-256 |
4d420ef62d980ac183a76c7791a9fd92c01e9ae30005a4af7df6836c0db59a3e
|
File details
Details for the file xshapeenc-0.1.0-py3-none-any.whl.
File metadata
- Download URL: xshapeenc-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0549cd519bf0ee3ed16a61d85b5983f8b519cd8e2edee7c0bb3f576248a83811
|
|
| MD5 |
b18d8b44e2b8cb818cbe4938f7b9a733
|
|
| BLAKE2b-256 |
9aeaf05e3389b232790859969810c50c0886c5853aa30ba4f804fae45d3619e5
|