Skip to content

Commit 83aed6c

Browse files
committed
Release v0.3.1: Rotated RetinaNet Hub default is OBB (Task 1 71.72% / 73.89%); circum-HBB moves to *_hbb.
1 parent e9e63f4 commit 83aed6c

90 files changed

Lines changed: 234813 additions & 45102 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ tools/test_*
1515

1616
# Local deploy overrides (copy from description_overrides.example.json in each deploy tree)
1717
deploy/description_overrides.json
18+
deploy/example/app/config.json
19+
deploy/example/app/description.json
20+
deploy/example/app/weights/
1821

1922
# Training and prediction folders
2023
runs/

‎Makefile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ IMAGE_DEMO_DEVICE ?= cuda:0
4141
IMAGE_DEMO_OUT_DIR ?= demo/out
4242
DEMO_DIR ?= demo
4343

44-
# ONNX export (python -m export; see export/README.md). Independent of CONFIG used by make train.
44+
# ONNX export (odet export; see export/README.md). Independent of CONFIG used by make train.
4545
EXPORT_CONFIG ?= configs/rotated_fcos/dota_le90_1x.json
4646
EXPORT_CKPT ?= pretrained/rotated_fcos_r50_fpn_dota_le90_1x-a87b6dba.pth
4747
EXPORT_MODE ?= rotated_fcos_pre_nms
@@ -102,7 +102,7 @@ help:
102102
@echo " make viewer - Gradio viewer (VIEWER_PRED_DIR= or latest predictions/; see docs/eval-reports/)"
103103
@echo " make demo - image_demo on all top-level images in DEMO_DIR ($(DEMO_DIR)) → $(IMAGE_DEMO_OUT_DIR)/"
104104
@echo ""
105-
@echo "=== ONNX export (python -m export; not an odet subcommand) ==="
105+
@echo "=== ONNX export (odet export; ONNX only) ==="
106106
@echo " make export-onnx - checkpoint → onnx_export/model.onnx + consumer sidecars"
107107
@echo " make export-demo - bundled plane image + NMS assertions"
108108
@echo " make export-verify - ORT zeros smoke on onnx_export/model.onnx"
@@ -513,7 +513,7 @@ clean:
513513
test:
514514
PYTHONPATH=$(PYTHONPATH) $(PYTEST) $(TESTS)
515515

516-
# --- ONNX export (python -m export; artifacts in onnx_export/) ---
516+
# --- ONNX export (odet export; artifacts in onnx_export/) ---
517517
# Usage:
518518
# make export-onnx
519519
# make export-onnx EXPERIMENT=runs/rotated_fcos/<timestamp>

‎README.md‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- **Datasets**: DOTA polygon loader (pattern, split file, or separate folders), **HRSC2016** native XML loader, **FAIR1M** 37-class XML loader (+ convert/tile tutorial), **SSDD** and **HRSID** SAR ship loaders (finetune DOTA 1× Hub locally; no SAR zoo), image tiling, label filtering, ignore masks, oriented mAP evaluation
1818
- **Models**: **Oriented R-CNN** ([Xie et al., ICCV 2021](https://openaccess.thecvf.com/content/ICCV2021/html/Xie_Oriented_R-CNN_for_Object_Detection_ICCV_2021_paper.html); horizontal RPN + MidpointOffset → oriented RoIAlign + oriented ROI head), **Rotated Faster R-CNN** (Ren et al., NeurIPS 2015 two-stage baseline with horizontal RPN + horizontal RoIAlign + rotated ROI head; MMRotate reference), **Rotated RetinaNet** ([Lin et al., ICCV 2017](https://openaccess.thecvf.com/content_ICCV_2017/papers/Lin_Focal_Loss_for_ICCV_2017_paper.pdf); oriented anchors, sigmoid focal loss), **Rotated FCOS** (anchor-free single-stage; distance-angle coder, centerness, L1 / KFIoU / decoded rIoU); ResNet + FPN backbones; selective loading of external checkpoints where configs wire `checkpoint.load_from_checkpoint`
1919
- **Training**: JSON configs + **`odet train`**, mixed precision (AMP), gradient accumulation, checkpointing, best-metric tracking, TensorBoard, optional curriculum learning and profiling
20-
- **ONNX export**: pre-NMS ONNX + Python NMS (`python -m export` / `make export-onnx`); consumers run ONNX Runtime only
20+
- **ONNX export**: pre-NMS ONNX + Python NMS (`odet export` / `make export-onnx`); consumers run ONNX Runtime only
2121

2222
Hands-on write-ups (code, metrics, inference knobs) live on **[DeepLearning.Earth](https://deeplearning.earth)** — especially the [15 DOTA class tour](https://deeplearning.earth/posts/2026-06-23_oriented_rcnn_detections_for_the_15_dota_classes/), [sampled rIoU and ProbIoU](https://deeplearning.earth/posts/2026-07-10_rotated_faster_rcnn_probiou_dota/), [Rotated FCOS / v0.2.0](https://deeplearning.earth/posts/2026-08-28_oriented-det_v0_2_0_rotated_fcos_decoded_riou_and_the_updated_zoo/), and [macOS FCOS vs Oriented R-CNN](https://deeplearning.earth/posts/2026-09-02_rotated_fcos_vs_oriented_rcnn_on_macos/).
2323

@@ -47,7 +47,7 @@ uv pip install -e .
4747
- From PyPI: `pip install oriented-det`
4848
- For development and tests: `uv pip install -e ".[dev]"`
4949
- For the Gradio prediction viewer: `uv pip install -e ".[viewer]"` or `pip install "oriented-det[viewer]"`
50-
- For **ONNX export**: `uv pip install -e ".[export]"` then `python -m export --help` (see [ONNX export](docs/examples/export.md))
50+
- For **ONNX export**: `uv pip install -e ".[export]"` then `odet export --help` (see [ONNX export](docs/examples/export.md))
5151
- For **macOS Apple Silicon** or **CPU-only**, see [Installation](docs/getting-started/installation.md) and the [macOS walkthrough](https://deeplearning.earth/posts/2026-06-25_oriented_object_detection_on_macos_in_pure_python/) (`odet image-demo` on MPS, no CUDA toolchain).
5252
- Verify: `pytest tests/test_geometry.py tests/test_iou.py tests/test_nms.py`
5353

@@ -94,7 +94,7 @@ After that, copy-pasted commands and unmodified configs that reference `/path/to
9494
| **Configs** | [`configs/`](configs/) | Experiment JSON (`_base_` inheritance, schema in `configs/config.schema.json`) |
9595
| **Runs** | `runs/<model_type>/<timestamp>/` | Checkpoints, `config.json` snapshot, `train.log` (created at train time; not shipped in the repo) |
9696
| **Docs** | [`docs/`](docs/) | MkDocs user guide and API reference |
97-
| **Examples** | [`demo/`](demo/), [`pretrained/`](pretrained/), [`notebooks/`](notebooks/), [`export/`](export/) | Demo images; Hub checkpoints; Kaggle FAIR1M tutorial notebook; ONNX export producer (`python -m export`) |
97+
| **Examples** | [`demo/`](demo/), [`pretrained/`](pretrained/), [`notebooks/`](notebooks/), [`export/`](export/) | Demo images; Hub checkpoints; Kaggle FAIR1M tutorial notebook; ONNX export producer (`odet export`) |
9898

9999
**`odet` vs `tools/`:** Installing the package registers the `odet` command. It loads modules under `tools/` (for example `tools.train`, `tools.save_predictions`). Shared inference and collate code lives in [`oriented_det/runtime/`](oriented_det/runtime/). You do not need two workflows — use **`odet`** (or **`make`**, which calls `odet`).
100100

@@ -105,7 +105,7 @@ After that, copy-pasted commands and unmodified configs that reference `/path/to
105105
Full documentation is in the **docs/** folder and can be built and served with MkDocs:
106106

107107
- **Build/serve**: `make docs` or `make docs-serve` (see [docs/README.md](docs/README.md)); or `uv pip install -e ".[docs]"` then `mkdocs serve`.
108-
- **Guides**: [Getting Started](docs/getting-started/installation.md), [User Guide](docs/user-guide/geometry.md), [API Reference](docs/api/geometry.md), [Examples](docs/examples/inference.md), [ONNX export](docs/examples/export.md).
108+
- **Guides**: [Getting Started](docs/getting-started/installation.md), [User Guide](docs/user-guide/geometry.md), [API Reference](docs/api/geometry.md), [Examples](docs/examples/inference.md), [Docker deploy](docs/examples/deploy.md), [ONNX export](docs/examples/export.md).
109109
- **Blog**: [DeepLearning.Earth](https://deeplearning.earth) — curated posts below (code, metrics, inference knobs).
110110

111111
| Topic | Post |
@@ -121,6 +121,8 @@ Full documentation is in the **docs/** folder and can be built and served with M
121121
| FCOS vs Oriented R-CNN (MPS latency, thresholds) | [https://deeplearning.earth/posts/2026-09-02_rotated_fcos_vs_oriented_rcnn_on_macos/](https://deeplearning.earth/posts/2026-09-02_rotated_fcos_vs_oriented_rcnn_on_macos/) |
122122
| Side-by-side browser demo (three 1× checkpoints) | [https://deeplearning.earth/posts/2026-09-06_oriented_det_optical_satellite_demo/](https://deeplearning.earth/posts/2026-09-06_oriented_det_optical_satellite_demo/) |
123123
| Apache 2.0 vs DOTA / HRSC dataset terms | [https://deeplearning.earth/posts/2026-09-10_oriented_det_apache_license_versus_dota/](https://deeplearning.earth/posts/2026-09-10_oriented_det_apache_license_versus_dota/) |
124+
| Docker deploy (Tile Geo Process) | [https://deeplearning.earth/posts/2026-10-05_deploy_oriented_det_in_docker/](https://deeplearning.earth/posts/2026-10-05_deploy_oriented_det_in_docker/) |
125+
| ONNX export (no PyTorch on infer) | [https://deeplearning.earth/posts/2026-10-08_onnx_export_without_pytorch/](https://deeplearning.earth/posts/2026-10-08_onnx_export_without_pytorch/) |
124126

125127
## Documentation by folder
126128

@@ -131,8 +133,8 @@ Full documentation is in the **docs/** folder and can be built and served with M
131133
| [oriented_det/cli/](oriented_det/cli/) | [oriented_det/cli/README.md](oriented_det/cli/README.md) | **`odet`** entry point and subcommand list |
132134
| [tools/](tools/) | [tools/README.md](tools/README.md) | CLI script implementations (invoked by `odet`; see [Repository layout](#repository-layout)) |
133135
| [configs/](configs/) | [configs/README.md](configs/README.md) | DOTA configs and **pretrain model zoo** (`_base_` inheritance) |
134-
| [deploy/example/](deploy/example/) | [deploy/example/README.md](deploy/example/README.md) | Minimal DOTA deploy smoke image |
135-
| [export/](export/) | [export/README.md](export/README.md) | ONNX export producer (`python -m export`); consumer bundle in gitignored `onnx_export/` |
136+
| [deploy/example/](deploy/example/) | [deploy/example/README.md](deploy/example/README.md) | Sanic Tile Geo Process Docker image (DOTA smoke) |
137+
| [export/](export/) | [export/README.md](export/README.md) | ONNX export producer (`odet export`); consumer bundle in gitignored `onnx_export/` |
136138
| [docs/](docs/) | [docs/README.md](docs/README.md) | MkDocs source; full user guide and API reference |
137139

138140
## Training and evaluation
@@ -149,7 +151,7 @@ Install once: `uv pip install -e .`. Then:
149151
| COCO polygons → DOTA | `odet coco-to-dota --ann-file instances.json --image-dir images --output-dir out` |
150152
| Val predictions | `odet preds --experiment-dir runs/oriented_rcnn/<timestamp>` or `make preds` |
151153
| Offline mAP | `make eval-val` or `make preds` then `make metrics`. DOTA: leaky val tiles (real test is Task 1). HRSC/FAIR1M/SSDD/HRSID: held-out test/val. |
152-
| ONNX export | `make export-onnx` or `python -m export onnx ...` (see [export/README.md](export/README.md)) |
154+
| ONNX export | `odet export onnx ...` or `make export-onnx` (see [export/README.md](export/README.md)) |
153155

154156
DOTA configs: per-model `dota_le90_1x.json` under [configs/](configs/) (3× where published; Faster R-CNN and FCOS DOTA are 1×). Run `odet --help` for all subcommands. Makefile shortcuts and script-level options: [tools/README.md](tools/README.md). Config reference: [docs/user-guide/configuration.md](docs/user-guide/configuration.md), [configs/config.schema.json](configs/config.schema.json), [configs/README.md](configs/README.md).
155157

@@ -185,7 +187,7 @@ OrientedDet is Apache-2.0 open source. For **consulting, training workshops, or
185187

186188
## Publishing to PyPI
187189

188-
Version **0.3.0** — tag releases as **`v0.3.0`** (git) matching `version` in `pyproject.toml`.
190+
Version **0.3.1** — tag releases as **`v0.3.1`** (git) matching `version` in `pyproject.toml`.
189191

190192
Configs: edit **`configs/`** at the repo root, then **`make sync-configs`** so **`oriented_det/configs/`** stays in sync (see **`oriented_det/configs/vendored_manifest.txt`**). CI runs **`make check-configs`**.
191193

@@ -216,7 +218,7 @@ make check-configs
216218
pytest tests/ -q
217219
```
218220

219-
Bump version in `pyproject.toml` and `docs/changelog.md` if needed (currently **0.3.0**).
221+
Bump version in `pyproject.toml` and `docs/changelog.md` if needed (currently **0.3.1**).
220222

221223
#### 3. Build locally
222224

‎configs/README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ Do **not** call HRSC, FAIR1M, SSDD, or HRSID `make eval-val` leaky. That word is
2424
|-------|--------|----------|----------------|
2525
| Oriented R-CNN 1× | [oriented_rcnn/dota_le90_1x.json](oriented_rcnn/dota_le90_1x.json) | `oriented_rcnn_dota_le90_1x` | **76.73%** official Task 1 |
2626
| Oriented R-CNN 3× | [oriented_rcnn/dota_le90_3x.json](oriented_rcnn/dota_le90_3x.json) | `oriented_rcnn_dota_le90_3x` | **74.88%** official Task 1 |
27-
| Rotated RetinaNet 1× (HBB) | [rotated_retinanet/dota_le90_1x.json](rotated_retinanet/dota_le90_1x.json) | `rotated_retinanet_dota_le90_1x` | **67.87%** official Task 1 |
28-
| Rotated RetinaNet 3× (HBB) | [rotated_retinanet/dota_le90_3x.json](rotated_retinanet/dota_le90_3x.json) | `rotated_retinanet_dota_le90_3x` | **70.70%** official Task 1 |
27+
| Rotated RetinaNet 1× (OBB) | [rotated_retinanet/dota_le90_1x.json](rotated_retinanet/dota_le90_1x.json) | `rotated_retinanet_dota_le90_1x` | **71.72%** official Task 1 |
28+
| Rotated RetinaNet 3× (OBB) | [rotated_retinanet/dota_le90_3x.json](rotated_retinanet/dota_le90_3x.json) | `rotated_retinanet_dota_le90_3x` | **73.89%** official Task 1 |
29+
| Rotated RetinaNet 1× (HBB) | [rotated_retinanet/dota_le90_1x_hbb.json](rotated_retinanet/dota_le90_1x_hbb.json) | `rotated_retinanet_dota_le90_1x_hbb` | **67.87%** official Task 1 |
30+
| Rotated RetinaNet 3× (HBB) | [rotated_retinanet/dota_le90_3x_hbb.json](rotated_retinanet/dota_le90_3x_hbb.json) | `rotated_retinanet_dota_le90_3x_hbb` | **70.70%** official Task 1 |
2931
| Rotated Faster R-CNN 1× | [rotated_faster_rcnn/dota_le90_1x.json](rotated_faster_rcnn/dota_le90_1x.json) | `rotated_faster_rcnn_dota_le90_1x` | **74.42%** official Task 1 |
3032
| Rotated Faster R-CNN 3× | [rotated_faster_rcnn/dota_le90_3x.json](rotated_faster_rcnn/dota_le90_3x.json) | `rotated_faster_rcnn_dota_le90_3x` | **74.48%** official Task 1 |
3133
| Rotated FCOS 1× rIoU | [rotated_fcos/dota_le90_1x.json](rotated_fcos/dota_le90_1x.json) | `rotated_fcos_dota_le90_1x` | **73.07%** official Task 1 |
@@ -125,7 +127,7 @@ All options, types, and defaults: **[config.schema.json](config.schema.json)** (
125127
| `model` | backbone, fpn_*, anchor_*, target_means/stds, roi_* (loss, batch, iou, schedule, **roi_proj_xy**), rpn_*, use_hbb_for_matching, add_gt_as_proposals, **rpn_nms_threshold** (proposal NMS), **final_nms_iou_threshold** / **final_nms_iou_schedule_*** (post–ROI-head NMS), **final_nms_use_cpu** (exact polygon final NMS on CPU), nms_class_agnostic, max_detections_per_image, inference_pre_nms_score_threshold |
126128
| `training` | **lr_scheduler_type** first, then lr_scheduler_*, lr_warmup_steps, lr_scaling_*, use_lr_param_groups, lr_mult_*, then num_epochs, learning_rate, momentum, weight_decay, use_amp, gradient_accumulation_steps, max_grad_norm, loss_weights. See [Training — Learning rate scheduling](../docs/user-guide/training.md#learning-rate-scheduling) and [_base_/schedules/README.md](_base_/schedules/README.md). |
127129
| `evaluation` | **`train_val_score_threshold`** (in-train val / mAP / `best_mAP`; legacy alias `score_threshold`), **`preds_score_threshold`** for **`odet preds` / `make eval-val`** (null → **0.05**), iou_threshold, compute_map_*; **`final_nms_iou_threshold`** for eval-val NMS only (DOTA+HRSC: **0.1**, MMRotate test parity) |
128-
| `production` | Optional **deploy / `image_demo`** overrides: `score_threshold` via `resolve_inference_score_threshold` (does **not** override train-val mAP; `odet preds` ignores it). DOTA 1× recipes set this to eval-val global F1 − **0.05** (Oriented R-CNN **0.55**, Faster R-CNN **0.6**, RetinaNet **0.35**, FCOS **0.2**); 3× inherits those floors. HRSC 1× recipes do the same (Oriented R-CNN / Faster R-CNN **0.85**, FCOS **0.2**). `per_class_score_threshold` merges on top of `evaluation` for preds/deploy only (`merge_per_class_score_thresholds`; mAP IoU is `evaluation.iou_threshold` only). **Decode (deploy / `image_demo`)** — RPN/NMS/threshold fields patch the loaded model via `apply_inference_config_to_model` (DOTA+HRSC+FAIR1M: final NMS **0.1**). **`odet preds`** prefers `evaluation.final_nms_iou_threshold` when set. Not applied during `tools/train.py` (training uses `model.*`, final NMS **0.1**). **Deploy / tiling** — `overlap_pixels`, `ignore_margin_pixels`, canvas flags (see **config.schema.json**). |
130+
| `production` | Optional **deploy / `image_demo`** overrides: `score_threshold` via `resolve_inference_score_threshold` (does **not** override train-val mAP; `odet preds` ignores it). DOTA 1× recipes set this to eval-val global F1 − **0.05** (Oriented R-CNN **0.55**, Faster R-CNN **0.6**, RetinaNet OBB **0.25** / HBB **0.35**, FCOS **0.2**); 3× inherits those floors. HRSC 1× recipes do the same (Oriented R-CNN / Faster R-CNN **0.85**, FCOS **0.2**). `per_class_score_threshold` merges on top of `evaluation` for preds/deploy only (`merge_per_class_score_thresholds`; mAP IoU is `evaluation.iou_threshold` only). **Decode (deploy / `image_demo`)** — RPN/NMS/threshold fields patch the loaded model via `apply_inference_config_to_model` (DOTA+HRSC+FAIR1M: final NMS **0.1**). **`odet preds`** prefers `evaluation.final_nms_iou_threshold` when set. Not applied during `tools/train.py` (training uses `model.*`, final NMS **0.1**). **Deploy / tiling** — `overlap_pixels`, `ignore_margin_pixels`, canvas flags (see **config.schema.json**). |
129131
| `checkpoint` | load_from_checkpoint, load_from_experiment, **discover_previous_run**, resume_from_checkpoint_epoch, load_optimizer_state, load_scheduler_state, load_include_prefixes, load_exclude_prefixes, start_epoch, best_metric, higher_is_better |
130132
| `loss` | loss_type (`focal_weighted` now also scales FCOS/RetinaNet sigmoid focal per class; `background_weight` is ROI-only), class_weight_method, background_weight, focal_alpha, focal_gamma, label_smoothing, **roi_grouped_ce_*** (coarse-to-fine ROI classifier curriculum in one run) |
131133
| `preprocessing` | resize_mode, target_size, normalize_mean, normalize_std, pad_size_divisor, enable_flip_horizontal, enable_flip_vertical, enable_flip_diagonal, enable_random_rotate, random_rotate_prob, random_rotate_angle_range |

0 commit comments

Comments
 (0)