Update model card
Browse files
README.md
CHANGED
|
@@ -1,87 +1,80 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
tags:
|
| 4 |
-
- image-rotation
|
| 5 |
-
- orientation-estimation
|
| 6 |
-
- angle-detection
|
| 7 |
-
- circular-gaussian-distribution
|
| 8 |
-
- mambaout
|
| 9 |
-
- pytorch
|
| 10 |
-
datasets:
|
| 11 |
-
- coco
|
| 12 |
-
metrics:
|
| 13 |
-
- mae
|
| 14 |
-
pipeline_tag: image-classification
|
| 15 |
-
---
|
| 16 |
-
|
| 17 |
-
# Image Rotation Angle Estimation
|
| 18 |
-
|
| 19 |
-
**[Try the interactive demo](https://huggingface.co/spaces/maxwoe/image-rotation-angle-estimation)**
|
| 20 |
-
|
| 21 |
-
Predicts the rotation angle of an image using the **Circular Gaussian Distribution (CGD)** method with a **MambaOut Base** backbone.
|
| 22 |
-
|
| 23 |
-
The model outputs a probability distribution over 360 angle bins (1 degree resolution) and extracts the predicted angle via argmax. It handles the full 360 degree range with no boundary discontinuities.
|
| 24 |
-
|
| 25 |
-
## Available Checkpoints
|
| 26 |
-
|
| 27 |
-
| Checkpoint | Dataset | MAE | Median Error |
|
| 28 |
-
|---|---|---|---|
|
| 29 |
-
| `cgd_mambaout_base_coco2017.ckpt` | COCO 2017 | 2.84
|
| 30 |
-
| `cgd_mambaout_base_coco2014.ckpt` | COCO 2014 | 3.71
|
| 31 |
-
|
| 32 |
-
## Usage
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
```python
|
| 37 |
-
from
|
| 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 |
-
- **Output:** Probability distribution over 360 angle bins, converted to angle via argmax
|
| 82 |
-
- **Loss:** KL Divergence with soft Gaussian labels
|
| 83 |
-
- **Optimizer:** AdamW with ReduceLROnPlateau scheduler
|
| 84 |
-
|
| 85 |
-
## License
|
| 86 |
-
|
| 87 |
-
MIT
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- image-rotation
|
| 5 |
+
- orientation-estimation
|
| 6 |
+
- angle-detection
|
| 7 |
+
- circular-gaussian-distribution
|
| 8 |
+
- mambaout
|
| 9 |
+
- pytorch
|
| 10 |
+
datasets:
|
| 11 |
+
- coco
|
| 12 |
+
metrics:
|
| 13 |
+
- mae
|
| 14 |
+
pipeline_tag: image-classification
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Image Rotation Angle Estimation
|
| 18 |
+
|
| 19 |
+
**[Try the interactive demo](https://huggingface.co/spaces/maxwoe/image-rotation-angle-estimation)** | **[GitHub](https://github.com/maxwoe/image-rotation-angle-estimation)** | **[Paper](https://arxiv.org/abs/2603.25351)**
|
| 20 |
+
|
| 21 |
+
Predicts the rotation angle of an image using the **Circular Gaussian Distribution (CGD)** method with a **MambaOut Base** backbone.
|
| 22 |
+
|
| 23 |
+
The model outputs a probability distribution over 360 angle bins (1 degree resolution) and extracts the predicted angle via argmax. It handles the full 360 degree range with no boundary discontinuities.
|
| 24 |
+
|
| 25 |
+
## Available Checkpoints
|
| 26 |
+
|
| 27 |
+
| Checkpoint | Dataset | MAE | Median Error |
|
| 28 |
+
|---|---|---|---|
|
| 29 |
+
| `cgd_mambaout_base_coco2017.ckpt` | COCO 2017 | 2.84° | 0.55° |
|
| 30 |
+
| `cgd_mambaout_base_coco2014.ckpt` | COCO 2014 | 3.71° | 0.68° |
|
| 31 |
+
|
| 32 |
+
## Usage
|
| 33 |
+
|
| 34 |
+
Download the inference code from this Hub repo (`model_cgd.py`, `architectures.py`, `rotation_utils.py`), then:
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
from model_cgd import CGDAngleEstimation
|
| 38 |
+
from PIL import Image
|
| 39 |
+
|
| 40 |
+
# Load model (defaults to COCO 2017 checkpoint)
|
| 41 |
+
model = CGDAngleEstimation.from_pretrained("maxwoe/image-rotation-angle-estimation")
|
| 42 |
+
|
| 43 |
+
# Or load a specific checkpoint
|
| 44 |
+
# model = CGDAngleEstimation.from_pretrained(
|
| 45 |
+
# "maxwoe/image-rotation-angle-estimation",
|
| 46 |
+
# model_name="cgd_mambaout_base_coco2014.ckpt",
|
| 47 |
+
# )
|
| 48 |
+
|
| 49 |
+
image = Image.open("your_image.jpg")
|
| 50 |
+
angle = model.predict_angle(image)
|
| 51 |
+
print(f"Predicted rotation: {angle:.1f}°")
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
`predict_angle` accepts a PIL Image, numpy array, or file path.
|
| 55 |
+
|
| 56 |
+
## Evaluation Results (COCO 2017, 5 seeds)
|
| 57 |
+
|
| 58 |
+
| Metric | Value |
|
| 59 |
+
|---|---|
|
| 60 |
+
| MAE | 2.84° |
|
| 61 |
+
| Median Error | 0.55° |
|
| 62 |
+
| RMSE | 8.45° |
|
| 63 |
+
| P90 Error | 3.54° |
|
| 64 |
+
| P95 Error | 12.00° |
|
| 65 |
+
| Accuracy at 2° | 90.2% |
|
| 66 |
+
| Accuracy at 5° | 97.5% |
|
| 67 |
+
| Accuracy at 10° | 98.1% |
|
| 68 |
+
|
| 69 |
+
## Model Details
|
| 70 |
+
|
| 71 |
+
- **Method:** Circular Gaussian Distribution (CGD), 360 bins, sigma = 6.0°
|
| 72 |
+
- **Backbone:** MambaOut Base (`mambaout_base.in1k`), pretrained on ImageNet-1K
|
| 73 |
+
- **Input size:** 224 x 224 pixels
|
| 74 |
+
- **Output:** Probability distribution over 360 angle bins, converted to angle via argmax
|
| 75 |
+
- **Loss:** KL Divergence with soft Gaussian labels
|
| 76 |
+
- **Optimizer:** AdamW with ReduceLROnPlateau scheduler
|
| 77 |
+
|
| 78 |
+
## License
|
| 79 |
+
|
| 80 |
+
MIT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|