oriented-det 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {oriented_det-0.2.0 → oriented_det-0.3.0}/PKG-INFO +61 -26
- {oriented_det-0.2.0 → oriented_det-0.3.0}/README.md +54 -18
- oriented_det-0.3.0/export/__init__.py +13 -0
- oriented_det-0.3.0/export/__main__.py +6 -0
- oriented_det-0.3.0/export/cli.py +94 -0
- oriented_det-0.3.0/export/nms.py +309 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/export/ort_runtime.py +6 -47
- oriented_det-0.3.0/export/postprocess.py +322 -0
- oriented_det-0.3.0/export/preprocess.py +130 -0
- oriented_det-0.3.0/export/runtime.py +222 -0
- oriented_det-0.3.0/export/scripts/__init__.py +6 -0
- oriented_det-0.3.0/export/scripts/demo.py +184 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/export/scripts/export_onnx.py +150 -43
- oriented_det-0.3.0/export/scripts/infer_onnx.py +105 -0
- oriented_det-0.3.0/export/scripts/save_predictions_onnx.py +325 -0
- oriented_det-0.3.0/export/scripts/zip_bundle.py +49 -0
- oriented_det-0.3.0/export/val_dataset.py +5 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/export/wrappers.py +61 -12
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/cli/__init__.py +7 -17
- oriented_det-0.3.0/oriented_det/cli/__main__.py +6 -0
- oriented_det-0.3.0/oriented_det/configs/_base_/datasets/fair1m.json +15 -0
- oriented_det-0.3.0/oriented_det/configs/_base_/datasets/hrsc2016.json +15 -0
- oriented_det-0.3.0/oriented_det/configs/_base_/datasets/hrsid.json +16 -0
- oriented_det-0.3.0/oriented_det/configs/_base_/datasets/ssdd.json +16 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/_base_/schedules/1x.json +7 -4
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/config.schema.json +74 -30
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/oriented_rcnn/dota_le90_1x.json +11 -7
- oriented_det-0.3.0/oriented_det/configs/oriented_rcnn/dota_le90_3x.json +9 -0
- oriented_det-0.3.0/oriented_det/configs/oriented_rcnn/fair1m_le90_1x.json +109 -0
- oriented_det-0.3.0/oriented_det/configs/oriented_rcnn/hrsc2016_le90_1x.json +115 -0
- oriented_det-0.3.0/oriented_det/configs/oriented_rcnn/hrsc2016_le90_3x.json +16 -0
- oriented_det-0.3.0/oriented_det/configs/oriented_rcnn/hrsid_le90_1x.json +115 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/rotated_faster_rcnn/dota_le90_1x.json +12 -8
- oriented_det-0.3.0/oriented_det/configs/rotated_faster_rcnn/dota_le90_3x.json +7 -0
- oriented_det-0.3.0/oriented_det/configs/rotated_faster_rcnn/fair1m_le90_1x.json +108 -0
- oriented_det-0.3.0/oriented_det/configs/rotated_faster_rcnn/hrsc2016_le90_1x.json +113 -0
- oriented_det-0.3.0/oriented_det/configs/rotated_faster_rcnn/hrsc2016_le90_3x.json +16 -0
- oriented_det-0.3.0/oriented_det/configs/rotated_faster_rcnn/hrsid_le90_1x.json +115 -0
- oriented_det-0.3.0/oriented_det/configs/rotated_faster_rcnn/ssdd_le90_1x.json +115 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/rotated_fcos/dota_le90_1x.json +26 -10
- oriented_det-0.2.0/oriented_det/configs/rotated_fcos/dota_le90_1x_kfiou_aux.json → oriented_det-0.3.0/oriented_det/configs/rotated_fcos/dota_le90_1x_l1_kfiou_aux.json +3 -1
- oriented_det-0.3.0/oriented_det/configs/rotated_fcos/dota_le90_3x.json +7 -0
- oriented_det-0.3.0/oriented_det/configs/rotated_fcos/fair1m_le90_1x.json +106 -0
- oriented_det-0.3.0/oriented_det/configs/rotated_fcos/hrsc2016_le90_1x.json +115 -0
- oriented_det-0.2.0/oriented_det/configs/oriented_rcnn/dota_le90_3x.json → oriented_det-0.3.0/oriented_det/configs/rotated_fcos/hrsc2016_le90_3x.json +3 -3
- oriented_det-0.3.0/oriented_det/configs/rotated_fcos/hrsid_le90_1x.json +112 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/rotated_retinanet/dota_le90_1x.json +30 -11
- oriented_det-0.3.0/oriented_det/configs/rotated_retinanet/dota_le90_3x.json +7 -0
- oriented_det-0.3.0/oriented_det/data/__init__.py +195 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/data/airbus_playground.py +126 -16
- oriented_det-0.3.0/oriented_det/data/build.py +291 -0
- oriented_det-0.3.0/oriented_det/data/coco_obb.py +509 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/data/dota.py +144 -41
- oriented_det-0.3.0/oriented_det/data/dota_task1.py +198 -0
- oriented_det-0.3.0/oriented_det/data/fair1m.py +843 -0
- oriented_det-0.3.0/oriented_det/data/fair1m_classes.py +126 -0
- oriented_det-0.3.0/oriented_det/data/hrsc2016.py +436 -0
- oriented_det-0.3.0/oriented_det/data/hrsid.py +379 -0
- oriented_det-0.3.0/oriented_det/data/lookalike.py +65 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/data/preprocessing.py +61 -2
- oriented_det-0.3.0/oriented_det/data/rotates.py +95 -0
- oriented_det-0.3.0/oriented_det/data/ssdd.py +661 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/data/transforms.py +5 -175
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/geometry/transforms.py +4 -5
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/__init__.py +4 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/faster_rcnn_inference.py +3 -1
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/oriented_rcnn.py +58 -46
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/oriented_roi.py +94 -41
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/oriented_rpn.py +190 -46
- oriented_det-0.3.0/oriented_det/models/retinanet_assign.py +220 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/rotated_fcos.py +93 -8
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/rotated_retinanet.py +367 -243
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/utils.py +292 -13
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/pretrained/hub.py +1 -1
- oriented_det-0.3.0/oriented_det/pretrained/manifest.json +102 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/runtime/checkpoint.py +21 -19
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/runtime/collate.py +97 -10
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/runtime/inference.py +121 -62
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/train/__init__.py +6 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/train/config.py +426 -38
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/train/engine.py +12 -33
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/train/utils.py +53 -4
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/utils/viz.py +5 -1
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det.egg-info/PKG-INFO +61 -26
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det.egg-info/SOURCES.txt +58 -22
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det.egg-info/requires.txt +5 -7
- {oriented_det-0.2.0 → oriented_det-0.3.0}/pyproject.toml +10 -12
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_airbus_playground.py +190 -0
- oriented_det-0.3.0/tests/test_class_tile_oversampling.py +167 -0
- oriented_det-0.3.0/tests/test_coco_obb.py +136 -0
- oriented_det-0.3.0/tests/test_config_behavior.py +342 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_config_model_wiring.py +159 -26
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_cosine_tail_scheduler.py +45 -3
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_deploy_generate_description.py +16 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_dota.py +33 -0
- oriented_det-0.3.0/tests/test_dota_task1.py +231 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_evaluation.py +18 -0
- oriented_det-0.3.0/tests/test_fair1m.py +423 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_geometry_transforms.py +2 -2
- oriented_det-0.3.0/tests/test_hard_tile_oversampling.py +136 -0
- oriented_det-0.3.0/tests/test_hrsc2016.py +286 -0
- oriented_det-0.3.0/tests/test_hrsid.py +154 -0
- oriented_det-0.3.0/tests/test_lookalike.py +490 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_models.py +236 -11
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_piecewise_schedule.py +9 -9
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_preprocessing.py +39 -1
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_pretrained_hub.py +74 -27
- oriented_det-0.3.0/tests/test_retinanet_assign.py +240 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_roi.py +15 -13
- oriented_det-0.3.0/tests/test_sigmoid_focal_class_weights.py +213 -0
- oriented_det-0.3.0/tests/test_sliding_window_margin.py +131 -0
- oriented_det-0.3.0/tests/test_ssdd.py +246 -0
- oriented_det-0.3.0/tests/test_tile_dota.py +70 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_train_flips.py +11 -9
- oriented_det-0.3.0/tests/test_train_rotates.py +86 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_training_config_strict.py +136 -12
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_utils_viz.py +1 -0
- oriented_det-0.3.0/tests/test_wizard.py +141 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/app.py +10 -3
- oriented_det-0.3.0/tools/coco_to_dota.py +172 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/dataset_stats.py +5 -40
- oriented_det-0.3.0/tools/dota_task1_submit.py +219 -0
- oriented_det-0.3.0/tools/fair1m_to_dota.py +131 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/generate_airbus_playground_csv.py +10 -0
- oriented_det-0.3.0/tools/hrsc_to_dota.py +80 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/image_demo.py +4 -8
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/lr_finder.py +53 -45
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/playground_to_dota.py +13 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/preview_augmentation.py +25 -49
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/save_predictions.py +197 -108
- oriented_det-0.3.0/tools/ssdd_to_dota.py +95 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/tile_dota.py +98 -14
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/train.py +478 -181
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/viewer_annotations.py +2 -1
- oriented_det-0.2.0/export/__init__.py +0 -9
- oriented_det-0.2.0/export/contract.json +0 -73
- oriented_det-0.2.0/export/postprocess.py +0 -228
- oriented_det-0.2.0/export/scripts/__init__.py +0 -6
- oriented_det-0.2.0/export/scripts/build_faster_rcnn_savedmodel.py +0 -134
- oriented_det-0.2.0/export/scripts/export_tf.py +0 -187
- oriented_det-0.2.0/export/scripts/onnx_to_savedmodel.py +0 -35
- oriented_det-0.2.0/export/scripts/predict_savedmodel.py +0 -99
- oriented_det-0.2.0/export/scripts/save_predictions_tf.py +0 -457
- oriented_det-0.2.0/export/scripts/to_tflite.py +0 -32
- oriented_det-0.2.0/export/tests/test_export_cli.py +0 -201
- oriented_det-0.2.0/export/tests/test_export_onnx_optional.py +0 -82
- oriented_det-0.2.0/export/tests/test_export_wrappers.py +0 -165
- oriented_det-0.2.0/export/tests/test_faster_rcnn_export_parity.py +0 -205
- oriented_det-0.2.0/export/tests/test_keras_detect_bundle.py +0 -130
- oriented_det-0.2.0/export/tests/test_oriented_rcnn_export_parity.py +0 -312
- oriented_det-0.2.0/export/tests/test_ort_runtime.py +0 -101
- oriented_det-0.2.0/export/tests/test_postprocess.py +0 -50
- oriented_det-0.2.0/export/tests/test_rotated_fcos_export_parity.py +0 -220
- oriented_det-0.2.0/export/tf_serving_model.py +0 -176
- oriented_det-0.2.0/export/val_dataset.py +0 -116
- oriented_det-0.2.0/oriented_det/configs/rotated_faster_rcnn/dota_le90_3x.json +0 -9
- oriented_det-0.2.0/oriented_det/configs/rotated_fcos/dota_le90_1x_riou.json +0 -11
- oriented_det-0.2.0/oriented_det/configs/rotated_fcos/dota_le90_3x.json +0 -27
- oriented_det-0.2.0/oriented_det/configs/rotated_fcos/dota_le90_3x_kfiou_aux.json +0 -15
- oriented_det-0.2.0/oriented_det/configs/rotated_fcos/dota_le90_3x_riou.json +0 -15
- oriented_det-0.2.0/oriented_det/configs/rotated_retinanet/dota_le90_3x.json +0 -30
- oriented_det-0.2.0/oriented_det/data/__init__.py +0 -99
- oriented_det-0.2.0/oriented_det/pretrained/manifest.json +0 -78
- oriented_det-0.2.0/tests/test_config_behavior.py +0 -178
- oriented_det-0.2.0/tests/test_sliding_window_margin.py +0 -47
- oriented_det-0.2.0/tests/test_transforms.py +0 -107
- {oriented_det-0.2.0 → oriented_det-0.3.0}/LICENSE +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/__init__.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/cli/train.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/_base_/augmentation.json +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/_base_/datasets/dota_le90.json +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/_base_/fp16.json +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/_base_/models/oriented_rcnn_r50.json +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/_base_/models/rotated_faster_rcnn_r50.json +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/_base_/models/rotated_fcos_r50.json +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/_base_/models/rotated_retinanet_r50.json +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/configs/_base_/preprocessing.json +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/data/dota_classes.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/data/evaluation.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/data/flips.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/data/tiling.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/geometry/__init__.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/geometry/poly.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/geometry/qbox.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/geometry/rbox.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/backbones/__init__.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/backbones/resnet_fpn.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/backbones/utils.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/bbox_coder.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/horizontal_roi_coder.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/models/oriented_rcnn_inference.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/ops/__init__.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/ops/diff_iou_rotated.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/ops/gaussian_angle.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/ops/gpu_ops.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/ops/iou.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/ops/kfiou.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/ops/nms.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/ops/probiou.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/ops/rotated_ops.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/ops/utils.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/pretrained/__init__.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/runtime/__init__.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/train/grouped_ce.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/train/piecewise_schedule.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/train/profiler.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/utils/__init__.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/utils/config.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/utils/device.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/utils/logging.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det/utils/progress.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det.egg-info/dependency_links.txt +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det.egg-info/entry_points.txt +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/oriented_det.egg-info/top_level.txt +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/setup.cfg +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_annotation_csv.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_bbox_coder.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_diff_iou_rotated.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_dota_tile_roots.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_exact_rotated_iou.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_gaussian_angle.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_geometry.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_gpu_ops.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_grouped_ce.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_iou.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_kfiou.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_metrics_margin_filter.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_nms.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_ops_utils.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_optimizer_param_groups.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_probiou.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_rpn.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_score_thresholds.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_source_provenance.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_tiling.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_train.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_utils_config.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_vendored_configs_sync.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tests/test_viewer_gradio_compat.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/__init__.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/annotation_csv.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/compare_hbb_obb_counts.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/dota_labels_to_comma.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/filter_predictions_by_gt.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/free_gpu.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/generate_oriented_annotations.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/hbb_to_obb.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/measure_sampled_riou_error.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/pretrained_download.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/publish_checkpoint.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/sync_vendored_configs.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/train_example.py +0 -0
- {oriented_det-0.2.0 → oriented_det-0.3.0}/tools/train_multi_gpu.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oriented-det
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: A lightweight, modern PyTorch library for rotated object detection in aerial and satellite imagery
|
|
5
5
|
Author: Jeff Faudi, DL4EO
|
|
6
6
|
Maintainer: Jeff Faudi, DL4EO
|
|
@@ -11,6 +11,7 @@ Project-URL: Repository, https://github.com/DL4EO/oriented-det
|
|
|
11
11
|
Project-URL: Issues, https://github.com/DL4EO/oriented-det/issues
|
|
12
12
|
Project-URL: Bug Tracker, https://github.com/DL4EO/oriented-det/issues
|
|
13
13
|
Project-URL: DL4EO, https://dl4eo.com
|
|
14
|
+
Project-URL: Blog, https://deeplearning.earth
|
|
14
15
|
Keywords: computer-vision,object-detection,rotated-detection,oriented-detection,pytorch,aerial-imagery,satellite-imagery,remote-sensing,dota,geospatial
|
|
15
16
|
Classifier: Development Status :: 3 - Alpha
|
|
16
17
|
Classifier: Intended Audience :: Developers
|
|
@@ -26,9 +27,9 @@ Requires-Python: >=3.10
|
|
|
26
27
|
Description-Content-Type: text/markdown
|
|
27
28
|
License-File: LICENSE
|
|
28
29
|
Requires-Dist: setuptools<82,>=65.0
|
|
29
|
-
Requires-Dist: torch>=2.
|
|
30
|
-
Requires-Dist: torchvision>=0.
|
|
31
|
-
Requires-Dist: numpy
|
|
30
|
+
Requires-Dist: torch>=2.4.0
|
|
31
|
+
Requires-Dist: torchvision>=0.19.0
|
|
32
|
+
Requires-Dist: numpy>=1.24
|
|
32
33
|
Requires-Dist: Pillow>=9.0
|
|
33
34
|
Requires-Dist: albumentations>=1.3.0
|
|
34
35
|
Requires-Dist: tqdm>=4.65.0
|
|
@@ -39,10 +40,8 @@ Requires-Dist: shapely>=2.0.0
|
|
|
39
40
|
Provides-Extra: viewer
|
|
40
41
|
Requires-Dist: gradio==6.8.0; extra == "viewer"
|
|
41
42
|
Provides-Extra: export
|
|
42
|
-
Requires-Dist: onnx
|
|
43
|
-
Requires-Dist: onnxruntime
|
|
44
|
-
Requires-Dist: onnx2tf>=1.22.0; extra == "export"
|
|
45
|
-
Requires-Dist: tensorflow>=2.14.0; extra == "export"
|
|
43
|
+
Requires-Dist: onnx<2,>=1.14.0; extra == "export"
|
|
44
|
+
Requires-Dist: onnxruntime>=1.16.0; extra == "export"
|
|
46
45
|
Provides-Extra: dev
|
|
47
46
|
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
48
47
|
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
@@ -63,17 +62,28 @@ Dynamic: license-file
|
|
|
63
62
|
|
|
64
63
|
**OrientedDet** is a lightweight, modern PyTorch library for **rotated object detection** in aerial and satellite imagery. It focuses on clean geometry, reliable operators, simple datasets, and practical baseline models—without the complexity of large detection frameworks. OrientedDet is designed for researchers, practitioners, and geospatial developers who need accurate rotation-aware detectors with a minimal API.
|
|
65
64
|
|
|
65
|
+
<p align="center">
|
|
66
|
+
<img src="demo/out/demo_detections.png" alt="Oriented R-CNN detections on diagonally parked buses in an aerial parking lot" width="720">
|
|
67
|
+
</p>
|
|
68
|
+
|
|
69
|
+
<p align="center"><em>Oriented R-CNN on the bundled <code>demo/demo.jpg</code> tile — rotated boxes follow vehicle heading instead of swallowing neighbours in axis-aligned rectangles.</em></p>
|
|
70
|
+
|
|
71
|
+
**Docs:** [dl4eo.github.io/oriented-det](https://dl4eo.github.io/oriented-det/) · **Blog:** [deeplearning.earth](https://deeplearning.earth) · **Company:** [dl4eo.com](https://dl4eo.com) (consulting and custom development)
|
|
72
|
+
|
|
66
73
|
## Features
|
|
67
74
|
|
|
68
75
|
- **Geometry**: Rotated bounding boxes (rbox: cx, cy, w, h, angle), quadrilateral boxes (qbox), polygon ↔ rbox ↔ hbox conversions, angle normalization (le90, 0–180°), flip/rotate/scale transforms, visualization helpers
|
|
69
76
|
- **IoU & NMS**: Rotated IoU and oriented NMS (CPU with optional GPU kernels when available); AABB pre-filtering; `obb_to_xyxy` / HBB conversion
|
|
70
|
-
- **Datasets**: DOTA polygon loader (pattern, split file, or separate folders), image tiling, label filtering, ignore masks, oriented mAP evaluation
|
|
77
|
+
- **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
|
|
71
78
|
- **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`
|
|
72
79
|
- **Training**: JSON configs + **`odet train`**, mixed precision (AMP), gradient accumulation, checkpointing, best-metric tracking, TensorBoard, optional curriculum learning and profiling
|
|
80
|
+
- **ONNX export**: pre-NMS ONNX + Python NMS (`python -m export` / `make export-onnx`); consumers run ONNX Runtime only
|
|
81
|
+
|
|
82
|
+
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/).
|
|
73
83
|
|
|
74
84
|
## Installation
|
|
75
85
|
|
|
76
|
-
- **Python** >= 3.
|
|
86
|
+
- **Python** >= 3.10. Use [uv](https://docs.astral.sh/uv/) to install Python versions and manage the virtual environment.
|
|
77
87
|
- From the repo root (Linux with CUDA 12.1):
|
|
78
88
|
|
|
79
89
|
```bash
|
|
@@ -85,8 +95,8 @@ cd ~/oriented-det
|
|
|
85
95
|
uv venv --python 3.12
|
|
86
96
|
source .venv/bin/activate
|
|
87
97
|
|
|
88
|
-
# Install PyTorch with CUDA 12.1 from PyTorch's index (2.
|
|
89
|
-
uv pip install "torch>=2.
|
|
98
|
+
# Install PyTorch with CUDA 12.1 from PyTorch's index (2.4.0 or a higher version is fine)
|
|
99
|
+
uv pip install "torch>=2.4.0" "torchvision>=0.19.0" --index-url https://download.pytorch.org/whl/cu121
|
|
90
100
|
|
|
91
101
|
# Install dependencies and the project in editable mode
|
|
92
102
|
uv pip install -r requirements.txt
|
|
@@ -97,7 +107,8 @@ uv pip install -e .
|
|
|
97
107
|
- From PyPI: `pip install oriented-det`
|
|
98
108
|
- For development and tests: `uv pip install -e ".[dev]"`
|
|
99
109
|
- For the Gradio prediction viewer: `uv pip install -e ".[viewer]"` or `pip install "oriented-det[viewer]"`
|
|
100
|
-
- For **
|
|
110
|
+
- For **ONNX export**: `uv pip install -e ".[export]"` then `python -m export --help` (see [ONNX export](docs/examples/export.md))
|
|
111
|
+
- 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).
|
|
101
112
|
- Verify: `pytest tests/test_geometry.py tests/test_iou.py tests/test_nms.py`
|
|
102
113
|
|
|
103
114
|
## Quick start
|
|
@@ -143,8 +154,7 @@ After that, copy-pasted commands and unmodified configs that reference `/path/to
|
|
|
143
154
|
| **Configs** | [`configs/`](configs/) | Experiment JSON (`_base_` inheritance, schema in `configs/config.schema.json`) |
|
|
144
155
|
| **Runs** | `runs/<model_type>/<timestamp>/` | Checkpoints, `config.json` snapshot, `train.log` (created at train time; not shipped in the repo) |
|
|
145
156
|
| **Docs** | [`docs/`](docs/) | MkDocs user guide and API reference |
|
|
146
|
-
| **
|
|
147
|
-
| **Examples** | [`demo/`](demo/), [`pretrained/`](pretrained/) | Demo images; registered checkpoints (large `.pth` files are usually gitignored) |
|
|
157
|
+
| **Examples** | [`demo/`](demo/), [`pretrained/`](pretrained/), [`notebooks/`](notebooks/), [`export/`](export/) | Demo images; Hub checkpoints; Kaggle FAIR1M tutorial notebook; ONNX export producer (`python -m export`) |
|
|
148
158
|
|
|
149
159
|
**`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`).
|
|
150
160
|
|
|
@@ -155,19 +165,34 @@ After that, copy-pasted commands and unmodified configs that reference `/path/to
|
|
|
155
165
|
Full documentation is in the **docs/** folder and can be built and served with MkDocs:
|
|
156
166
|
|
|
157
167
|
- **Build/serve**: `make docs` or `make docs-serve` (see [docs/README.md](docs/README.md)); or `uv pip install -e ".[docs]"` then `mkdocs serve`.
|
|
158
|
-
- **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).
|
|
168
|
+
- **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).
|
|
169
|
+
- **Blog**: [DeepLearning.Earth](https://deeplearning.earth) — curated posts below (code, metrics, inference knobs).
|
|
170
|
+
|
|
171
|
+
| Topic | Post |
|
|
172
|
+
|-------|------|
|
|
173
|
+
| Why OrientedDet / Apache 2.0 stack | [https://deeplearning.earth/posts/2026-06-22_oriented-det_v0_1_0_sovereign_oriented_object_detection_for_eo/](https://deeplearning.earth/posts/2026-06-22_oriented-det_v0_1_0_sovereign_oriented_object_detection_for_eo/) |
|
|
174
|
+
| Visual detections (15 DOTA classes) | [https://deeplearning.earth/posts/2026-06-23_oriented_rcnn_detections_for_the_15_dota_classes/](https://deeplearning.earth/posts/2026-06-23_oriented_rcnn_detections_for_the_15_dota_classes/) |
|
|
175
|
+
| `odet image-demo` on Apple Silicon | [https://deeplearning.earth/posts/2026-06-25_oriented_object_detection_on_macos_in_pure_python/](https://deeplearning.earth/posts/2026-06-25_oriented_object_detection_on_macos_in_pure_python/) |
|
|
176
|
+
| Sliding-window inference (`demo/large.jpg`) | [https://deeplearning.earth/posts/2026-06-29_announcing_the_final_oriented_det_pretrained_model/](https://deeplearning.earth/posts/2026-06-29_announcing_the_final_oriented_det_pretrained_model/) |
|
|
177
|
+
| Sentinel-2 ships (`--zoom`, class filter) | [https://deeplearning.earth/posts/2026-06-25_zero-shot_ship_detection_on_a_copernicus_sentinel-2_tile_with_oriented_rcnn/](https://deeplearning.earth/posts/2026-06-25_zero-shot_ship_detection_on_a_copernicus_sentinel-2_tile_with_oriented_rcnn/) |
|
|
178
|
+
| Sampled rIoU, ProbIoU, Faster R-CNN Task 1 | [https://deeplearning.earth/posts/2026-07-10_rotated_faster_rcnn_probiou_dota/](https://deeplearning.earth/posts/2026-07-10_rotated_faster_rcnn_probiou_dota/) |
|
|
179
|
+
| Zoo / MMRotate parity | [https://deeplearning.earth/posts/2026-07-11_oriented-det_v0_1_1_prob_iou_mmrotate_parity_and_the_updated_zoo/](https://deeplearning.earth/posts/2026-07-11_oriented-det_v0_1_1_prob_iou_mmrotate_parity_and_the_updated_zoo/) |
|
|
180
|
+
| Rotated FCOS, decoded rIoU, four-family zoo | [https://deeplearning.earth/posts/2026-08-28_oriented-det_v0_2_0_rotated_fcos_decoded_riou_and_the_updated_zoo/](https://deeplearning.earth/posts/2026-08-28_oriented-det_v0_2_0_rotated_fcos_decoded_riou_and_the_updated_zoo/) |
|
|
181
|
+
| 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/) |
|
|
182
|
+
| 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/) |
|
|
183
|
+
| 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/) |
|
|
159
184
|
|
|
160
185
|
## Documentation by folder
|
|
161
186
|
|
|
162
187
|
| Folder | README | Description |
|
|
163
188
|
|--------|--------|-------------|
|
|
164
|
-
| [
|
|
165
|
-
| [demo/](demo/) | [demo/README.md](demo/README.md) | Demo images; `odet image-demo` or `make demo` with the latest `runs/` checkpoint |
|
|
189
|
+
| [demo/](demo/) | [demo/README.md](demo/README.md) | Demo images; `odet image-demo` or `make demo` with the latest `runs/` checkpoint. Write-ups: [macOS image-demo](https://deeplearning.earth/posts/2026-06-25_oriented_object_detection_on_macos_in_pure_python/) · [sliding-window (`demo/large.jpg`)](https://deeplearning.earth/posts/2026-06-29_announcing_the_final_oriented_det_pretrained_model/) |
|
|
166
190
|
| [pretrained/](pretrained/) | [pretrained/README.md](pretrained/README.md) | Registered checkpoints for fine-tunes; large `.pth` files are usually gitignored |
|
|
167
191
|
| [oriented_det/cli/](oriented_det/cli/) | [oriented_det/cli/README.md](oriented_det/cli/README.md) | **`odet`** entry point and subcommand list |
|
|
168
192
|
| [tools/](tools/) | [tools/README.md](tools/README.md) | CLI script implementations (invoked by `odet`; see [Repository layout](#repository-layout)) |
|
|
169
193
|
| [configs/](configs/) | [configs/README.md](configs/README.md) | DOTA configs and **pretrain model zoo** (`_base_` inheritance) |
|
|
170
194
|
| [deploy/example/](deploy/example/) | [deploy/example/README.md](deploy/example/README.md) | Minimal DOTA deploy smoke image |
|
|
195
|
+
| [export/](export/) | [export/README.md](export/README.md) | ONNX export producer (`python -m export`); consumer bundle in gitignored `onnx_export/` |
|
|
171
196
|
| [docs/](docs/) | [docs/README.md](docs/README.md) | MkDocs source; full user guide and API reference |
|
|
172
197
|
|
|
173
198
|
## Training and evaluation
|
|
@@ -178,15 +203,19 @@ Install once: `uv pip install -e .`. Then:
|
|
|
178
203
|
|------|---------|
|
|
179
204
|
| Train | `odet train --config configs/oriented_rcnn/dota_le90_1x.json` or `make train` |
|
|
180
205
|
| Multi-GPU | `make train-multi-gpu` (`torchrun` + cuDNN on `LD_LIBRARY_PATH`) |
|
|
181
|
-
| Tile DOTA | `odet tile-dota /path/to/
|
|
206
|
+
| Tile DOTA | `odet tile-dota /path/to/data/DOTA-v1.0/train` |
|
|
207
|
+
| HRSC2016 → DOTA (optional) | `odet hrsc-to-dota --data-root /path/to/data/HRSC2016 --output-dir /path/to/data/HRSC2016-dota` |
|
|
208
|
+
| SSDD → DOTA (optional) | `odet ssdd-to-dota --data-root /path/to/data/Official-SSDD-OPEN --output-dir /path/to/data/SSDD-dota` |
|
|
209
|
+
| COCO polygons → DOTA | `odet coco-to-dota --ann-file instances.json --image-dir images --output-dir out` |
|
|
182
210
|
| Val predictions | `odet preds --experiment-dir runs/oriented_rcnn/<timestamp>` or `make preds` |
|
|
183
|
-
| Offline mAP | `make eval-val` or `make preds` then `make metrics
|
|
211
|
+
| 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. |
|
|
212
|
+
| ONNX export | `make export-onnx` or `python -m export onnx ...` (see [export/README.md](export/README.md)) |
|
|
184
213
|
|
|
185
|
-
DOTA configs: per-model `dota_le90_1x.json`
|
|
214
|
+
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).
|
|
186
215
|
|
|
187
216
|
## Pretrained weights and evaluation
|
|
188
217
|
|
|
189
|
-
- Place exported best checkpoints under **`pretrained/`** or use Hub slugs (`odet pretrained download oriented_rcnn_dota_le90_3x` or `
|
|
218
|
+
- Place exported best checkpoints under **`pretrained/`** or use Hub slugs (`odet pretrained download oriented_rcnn_dota_le90_3x`, `rotated_faster_rcnn_dota_le90_1x`, `rotated_faster_rcnn_dota_le90_3x`, `rotated_fcos_dota_le90_1x`, or `oriented_rcnn_hrsc2016_le90_3x` / `rotated_faster_rcnn_hrsc2016_le90_3x` / `rotated_fcos_hrsc2016_le90_3x`). See [pretrained/README.md](pretrained/README.md) and [configs/README.md](configs/README.md#dota-pretrained-models-model-zoo). Zoo write-ups: [v0.1.1](https://deeplearning.earth/posts/2026-07-11_oriented-det_v0_1_1_prob_iou_mmrotate_parity_and_the_updated_zoo/) · [v0.2.0 FCOS](https://deeplearning.earth/posts/2026-08-28_oriented-det_v0_2_0_rotated_fcos_decoded_riou_and_the_updated_zoo/) · [optical satellite demo](https://deeplearning.earth/posts/2026-09-06_oriented_det_optical_satellite_demo/).
|
|
190
219
|
- **Tiled validation:** after training, run `make preds` then `make metrics`. Published mAP reports: [`docs/eval-reports/`](docs/eval-reports/) (git). Raw detections for the viewer: gitignored [`predictions/`](predictions/).
|
|
191
220
|
|
|
192
221
|
## Important notes
|
|
@@ -201,8 +230,8 @@ See **[docs/roadmap.md](docs/roadmap.md)** for the full public plan. Summary:
|
|
|
201
230
|
|
|
202
231
|
- **v0.1** (shipped): Geometry, IoU/NMS, DOTA, three ResNet-FPN detectors, config training, Hub pretrained weights
|
|
203
232
|
- **v0.1.1** (shipped): ProbIoU Faster R-CNN 1×/3× on Hub
|
|
204
|
-
- **v0.2** (shipped): Rotated FCOS (anchor-free single-stage); Hub `
|
|
205
|
-
- **v0.3
|
|
233
|
+
- **v0.2** (shipped): Rotated FCOS (anchor-free single-stage); Hub `rotated_fcos_dota_le90_1x` (73.07% official Task 1)
|
|
234
|
+
- **v0.3** (shipped): HRSC2016 loader + Hub 3× zoo (Oriented R-CNN 90.41%, Faster R-CNN 88.77%, FCOS 88.34% eval-val); FAIR1M loader + 1× recipes; SSDD + HRSID SAR loaders + 1× recipes (SSDD Faster R-CNN held-out **90.34%**, HRSID **78.55%**; train locally, no SAR Hub)
|
|
206
235
|
- **v0.4**: RTMDet-R and native YOLO-OBB (AGPL-free production tier)
|
|
207
236
|
- **v0.5+**: Swin-FPN backbone; optional fused CUDA kernels; hosted docs
|
|
208
237
|
|
|
@@ -210,9 +239,13 @@ See **[docs/roadmap.md](docs/roadmap.md)** for the full public plan. Summary:
|
|
|
210
239
|
|
|
211
240
|
Contributions are welcome. Run tests with `pytest`, format with `black` and `ruff`. See [docs/contributing.md](docs/contributing.md) for guidelines.
|
|
212
241
|
|
|
242
|
+
## Consulting and custom development
|
|
243
|
+
|
|
244
|
+
OrientedDet is Apache-2.0 open source. For **consulting, training workshops, or custom development** (dataset design, on-prem training, production packaging), see **[DL4EO](https://dl4eo.com)**.
|
|
245
|
+
|
|
213
246
|
## Publishing to PyPI
|
|
214
247
|
|
|
215
|
-
Version **0.
|
|
248
|
+
Version **0.3.0** — tag releases as **`v0.3.0`** (git) matching `version` in `pyproject.toml`.
|
|
216
249
|
|
|
217
250
|
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`**.
|
|
218
251
|
|
|
@@ -243,7 +276,7 @@ make check-configs
|
|
|
243
276
|
pytest tests/ -q
|
|
244
277
|
```
|
|
245
278
|
|
|
246
|
-
Bump version in `pyproject.toml` and `docs/changelog.md` if needed (currently **0.
|
|
279
|
+
Bump version in `pyproject.toml` and `docs/changelog.md` if needed (currently **0.3.0**).
|
|
247
280
|
|
|
248
281
|
#### 3. Build locally
|
|
249
282
|
|
|
@@ -318,6 +351,8 @@ Notes:
|
|
|
318
351
|
|
|
319
352
|
**Apache-2.0** — Copyright © Jeff Faudi and [DL4EO](https://dl4eo.com). See [LICENSE](LICENSE) for details.
|
|
320
353
|
|
|
354
|
+
The framework license does not grant rights to the **DOTA** or **HRSC** datasets. See [Apache 2.0 vs DOTA / HRSC dataset terms](https://deeplearning.earth/posts/2026-09-10_oriented_det_apache_license_versus_dota/).
|
|
355
|
+
|
|
321
356
|
## Acknowledgements
|
|
322
357
|
|
|
323
358
|
Design and APIs are informed by MMRotate, MMDetection, Detectron2, and related work in oriented object detection; **pretrained checkpoints in `pretrained/` are OrientedDet exports from this codebase**, not MMRotate zoo bundles.
|
|
@@ -2,17 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
**OrientedDet** is a lightweight, modern PyTorch library for **rotated object detection** in aerial and satellite imagery. It focuses on clean geometry, reliable operators, simple datasets, and practical baseline models—without the complexity of large detection frameworks. OrientedDet is designed for researchers, practitioners, and geospatial developers who need accurate rotation-aware detectors with a minimal API.
|
|
4
4
|
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="demo/out/demo_detections.png" alt="Oriented R-CNN detections on diagonally parked buses in an aerial parking lot" width="720">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center"><em>Oriented R-CNN on the bundled <code>demo/demo.jpg</code> tile — rotated boxes follow vehicle heading instead of swallowing neighbours in axis-aligned rectangles.</em></p>
|
|
10
|
+
|
|
11
|
+
**Docs:** [dl4eo.github.io/oriented-det](https://dl4eo.github.io/oriented-det/) · **Blog:** [deeplearning.earth](https://deeplearning.earth) · **Company:** [dl4eo.com](https://dl4eo.com) (consulting and custom development)
|
|
12
|
+
|
|
5
13
|
## Features
|
|
6
14
|
|
|
7
15
|
- **Geometry**: Rotated bounding boxes (rbox: cx, cy, w, h, angle), quadrilateral boxes (qbox), polygon ↔ rbox ↔ hbox conversions, angle normalization (le90, 0–180°), flip/rotate/scale transforms, visualization helpers
|
|
8
16
|
- **IoU & NMS**: Rotated IoU and oriented NMS (CPU with optional GPU kernels when available); AABB pre-filtering; `obb_to_xyxy` / HBB conversion
|
|
9
|
-
- **Datasets**: DOTA polygon loader (pattern, split file, or separate folders), image tiling, label filtering, ignore masks, oriented mAP evaluation
|
|
17
|
+
- **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
|
|
10
18
|
- **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`
|
|
11
19
|
- **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
|
|
21
|
+
|
|
22
|
+
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/).
|
|
12
23
|
|
|
13
24
|
## Installation
|
|
14
25
|
|
|
15
|
-
- **Python** >= 3.
|
|
26
|
+
- **Python** >= 3.10. Use [uv](https://docs.astral.sh/uv/) to install Python versions and manage the virtual environment.
|
|
16
27
|
- From the repo root (Linux with CUDA 12.1):
|
|
17
28
|
|
|
18
29
|
```bash
|
|
@@ -24,8 +35,8 @@ cd ~/oriented-det
|
|
|
24
35
|
uv venv --python 3.12
|
|
25
36
|
source .venv/bin/activate
|
|
26
37
|
|
|
27
|
-
# Install PyTorch with CUDA 12.1 from PyTorch's index (2.
|
|
28
|
-
uv pip install "torch>=2.
|
|
38
|
+
# Install PyTorch with CUDA 12.1 from PyTorch's index (2.4.0 or a higher version is fine)
|
|
39
|
+
uv pip install "torch>=2.4.0" "torchvision>=0.19.0" --index-url https://download.pytorch.org/whl/cu121
|
|
29
40
|
|
|
30
41
|
# Install dependencies and the project in editable mode
|
|
31
42
|
uv pip install -r requirements.txt
|
|
@@ -36,7 +47,8 @@ uv pip install -e .
|
|
|
36
47
|
- From PyPI: `pip install oriented-det`
|
|
37
48
|
- For development and tests: `uv pip install -e ".[dev]"`
|
|
38
49
|
- For the Gradio prediction viewer: `uv pip install -e ".[viewer]"` or `pip install "oriented-det[viewer]"`
|
|
39
|
-
- For **
|
|
50
|
+
- For **ONNX export**: `uv pip install -e ".[export]"` then `python -m export --help` (see [ONNX export](docs/examples/export.md))
|
|
51
|
+
- 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).
|
|
40
52
|
- Verify: `pytest tests/test_geometry.py tests/test_iou.py tests/test_nms.py`
|
|
41
53
|
|
|
42
54
|
## Quick start
|
|
@@ -82,8 +94,7 @@ After that, copy-pasted commands and unmodified configs that reference `/path/to
|
|
|
82
94
|
| **Configs** | [`configs/`](configs/) | Experiment JSON (`_base_` inheritance, schema in `configs/config.schema.json`) |
|
|
83
95
|
| **Runs** | `runs/<model_type>/<timestamp>/` | Checkpoints, `config.json` snapshot, `train.log` (created at train time; not shipped in the repo) |
|
|
84
96
|
| **Docs** | [`docs/`](docs/) | MkDocs user guide and API reference |
|
|
85
|
-
| **
|
|
86
|
-
| **Examples** | [`demo/`](demo/), [`pretrained/`](pretrained/) | Demo images; registered checkpoints (large `.pth` files are usually gitignored) |
|
|
97
|
+
| **Examples** | [`demo/`](demo/), [`pretrained/`](pretrained/), [`notebooks/`](notebooks/), [`export/`](export/) | Demo images; Hub checkpoints; Kaggle FAIR1M tutorial notebook; ONNX export producer (`python -m export`) |
|
|
87
98
|
|
|
88
99
|
**`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`).
|
|
89
100
|
|
|
@@ -94,19 +105,34 @@ After that, copy-pasted commands and unmodified configs that reference `/path/to
|
|
|
94
105
|
Full documentation is in the **docs/** folder and can be built and served with MkDocs:
|
|
95
106
|
|
|
96
107
|
- **Build/serve**: `make docs` or `make docs-serve` (see [docs/README.md](docs/README.md)); or `uv pip install -e ".[docs]"` then `mkdocs serve`.
|
|
97
|
-
- **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).
|
|
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).
|
|
109
|
+
- **Blog**: [DeepLearning.Earth](https://deeplearning.earth) — curated posts below (code, metrics, inference knobs).
|
|
110
|
+
|
|
111
|
+
| Topic | Post |
|
|
112
|
+
|-------|------|
|
|
113
|
+
| Why OrientedDet / Apache 2.0 stack | [https://deeplearning.earth/posts/2026-06-22_oriented-det_v0_1_0_sovereign_oriented_object_detection_for_eo/](https://deeplearning.earth/posts/2026-06-22_oriented-det_v0_1_0_sovereign_oriented_object_detection_for_eo/) |
|
|
114
|
+
| Visual detections (15 DOTA classes) | [https://deeplearning.earth/posts/2026-06-23_oriented_rcnn_detections_for_the_15_dota_classes/](https://deeplearning.earth/posts/2026-06-23_oriented_rcnn_detections_for_the_15_dota_classes/) |
|
|
115
|
+
| `odet image-demo` on Apple Silicon | [https://deeplearning.earth/posts/2026-06-25_oriented_object_detection_on_macos_in_pure_python/](https://deeplearning.earth/posts/2026-06-25_oriented_object_detection_on_macos_in_pure_python/) |
|
|
116
|
+
| Sliding-window inference (`demo/large.jpg`) | [https://deeplearning.earth/posts/2026-06-29_announcing_the_final_oriented_det_pretrained_model/](https://deeplearning.earth/posts/2026-06-29_announcing_the_final_oriented_det_pretrained_model/) |
|
|
117
|
+
| Sentinel-2 ships (`--zoom`, class filter) | [https://deeplearning.earth/posts/2026-06-25_zero-shot_ship_detection_on_a_copernicus_sentinel-2_tile_with_oriented_rcnn/](https://deeplearning.earth/posts/2026-06-25_zero-shot_ship_detection_on_a_copernicus_sentinel-2_tile_with_oriented_rcnn/) |
|
|
118
|
+
| Sampled rIoU, ProbIoU, Faster R-CNN Task 1 | [https://deeplearning.earth/posts/2026-07-10_rotated_faster_rcnn_probiou_dota/](https://deeplearning.earth/posts/2026-07-10_rotated_faster_rcnn_probiou_dota/) |
|
|
119
|
+
| Zoo / MMRotate parity | [https://deeplearning.earth/posts/2026-07-11_oriented-det_v0_1_1_prob_iou_mmrotate_parity_and_the_updated_zoo/](https://deeplearning.earth/posts/2026-07-11_oriented-det_v0_1_1_prob_iou_mmrotate_parity_and_the_updated_zoo/) |
|
|
120
|
+
| Rotated FCOS, decoded rIoU, four-family zoo | [https://deeplearning.earth/posts/2026-08-28_oriented-det_v0_2_0_rotated_fcos_decoded_riou_and_the_updated_zoo/](https://deeplearning.earth/posts/2026-08-28_oriented-det_v0_2_0_rotated_fcos_decoded_riou_and_the_updated_zoo/) |
|
|
121
|
+
| 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/) |
|
|
122
|
+
| 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/) |
|
|
123
|
+
| 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/) |
|
|
98
124
|
|
|
99
125
|
## Documentation by folder
|
|
100
126
|
|
|
101
127
|
| Folder | README | Description |
|
|
102
128
|
|--------|--------|-------------|
|
|
103
|
-
| [
|
|
104
|
-
| [demo/](demo/) | [demo/README.md](demo/README.md) | Demo images; `odet image-demo` or `make demo` with the latest `runs/` checkpoint |
|
|
129
|
+
| [demo/](demo/) | [demo/README.md](demo/README.md) | Demo images; `odet image-demo` or `make demo` with the latest `runs/` checkpoint. Write-ups: [macOS image-demo](https://deeplearning.earth/posts/2026-06-25_oriented_object_detection_on_macos_in_pure_python/) · [sliding-window (`demo/large.jpg`)](https://deeplearning.earth/posts/2026-06-29_announcing_the_final_oriented_det_pretrained_model/) |
|
|
105
130
|
| [pretrained/](pretrained/) | [pretrained/README.md](pretrained/README.md) | Registered checkpoints for fine-tunes; large `.pth` files are usually gitignored |
|
|
106
131
|
| [oriented_det/cli/](oriented_det/cli/) | [oriented_det/cli/README.md](oriented_det/cli/README.md) | **`odet`** entry point and subcommand list |
|
|
107
132
|
| [tools/](tools/) | [tools/README.md](tools/README.md) | CLI script implementations (invoked by `odet`; see [Repository layout](#repository-layout)) |
|
|
108
133
|
| [configs/](configs/) | [configs/README.md](configs/README.md) | DOTA configs and **pretrain model zoo** (`_base_` inheritance) |
|
|
109
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/` |
|
|
110
136
|
| [docs/](docs/) | [docs/README.md](docs/README.md) | MkDocs source; full user guide and API reference |
|
|
111
137
|
|
|
112
138
|
## Training and evaluation
|
|
@@ -117,15 +143,19 @@ Install once: `uv pip install -e .`. Then:
|
|
|
117
143
|
|------|---------|
|
|
118
144
|
| Train | `odet train --config configs/oriented_rcnn/dota_le90_1x.json` or `make train` |
|
|
119
145
|
| Multi-GPU | `make train-multi-gpu` (`torchrun` + cuDNN on `LD_LIBRARY_PATH`) |
|
|
120
|
-
| Tile DOTA | `odet tile-dota /path/to/
|
|
146
|
+
| Tile DOTA | `odet tile-dota /path/to/data/DOTA-v1.0/train` |
|
|
147
|
+
| HRSC2016 → DOTA (optional) | `odet hrsc-to-dota --data-root /path/to/data/HRSC2016 --output-dir /path/to/data/HRSC2016-dota` |
|
|
148
|
+
| SSDD → DOTA (optional) | `odet ssdd-to-dota --data-root /path/to/data/Official-SSDD-OPEN --output-dir /path/to/data/SSDD-dota` |
|
|
149
|
+
| COCO polygons → DOTA | `odet coco-to-dota --ann-file instances.json --image-dir images --output-dir out` |
|
|
121
150
|
| Val predictions | `odet preds --experiment-dir runs/oriented_rcnn/<timestamp>` or `make preds` |
|
|
122
|
-
| Offline mAP | `make eval-val` or `make preds` then `make metrics
|
|
151
|
+
| 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)) |
|
|
123
153
|
|
|
124
|
-
DOTA configs: per-model `dota_le90_1x.json`
|
|
154
|
+
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).
|
|
125
155
|
|
|
126
156
|
## Pretrained weights and evaluation
|
|
127
157
|
|
|
128
|
-
- Place exported best checkpoints under **`pretrained/`** or use Hub slugs (`odet pretrained download oriented_rcnn_dota_le90_3x` or `
|
|
158
|
+
- Place exported best checkpoints under **`pretrained/`** or use Hub slugs (`odet pretrained download oriented_rcnn_dota_le90_3x`, `rotated_faster_rcnn_dota_le90_1x`, `rotated_faster_rcnn_dota_le90_3x`, `rotated_fcos_dota_le90_1x`, or `oriented_rcnn_hrsc2016_le90_3x` / `rotated_faster_rcnn_hrsc2016_le90_3x` / `rotated_fcos_hrsc2016_le90_3x`). See [pretrained/README.md](pretrained/README.md) and [configs/README.md](configs/README.md#dota-pretrained-models-model-zoo). Zoo write-ups: [v0.1.1](https://deeplearning.earth/posts/2026-07-11_oriented-det_v0_1_1_prob_iou_mmrotate_parity_and_the_updated_zoo/) · [v0.2.0 FCOS](https://deeplearning.earth/posts/2026-08-28_oriented-det_v0_2_0_rotated_fcos_decoded_riou_and_the_updated_zoo/) · [optical satellite demo](https://deeplearning.earth/posts/2026-09-06_oriented_det_optical_satellite_demo/).
|
|
129
159
|
- **Tiled validation:** after training, run `make preds` then `make metrics`. Published mAP reports: [`docs/eval-reports/`](docs/eval-reports/) (git). Raw detections for the viewer: gitignored [`predictions/`](predictions/).
|
|
130
160
|
|
|
131
161
|
## Important notes
|
|
@@ -140,8 +170,8 @@ See **[docs/roadmap.md](docs/roadmap.md)** for the full public plan. Summary:
|
|
|
140
170
|
|
|
141
171
|
- **v0.1** (shipped): Geometry, IoU/NMS, DOTA, three ResNet-FPN detectors, config training, Hub pretrained weights
|
|
142
172
|
- **v0.1.1** (shipped): ProbIoU Faster R-CNN 1×/3× on Hub
|
|
143
|
-
- **v0.2** (shipped): Rotated FCOS (anchor-free single-stage); Hub `
|
|
144
|
-
- **v0.3
|
|
173
|
+
- **v0.2** (shipped): Rotated FCOS (anchor-free single-stage); Hub `rotated_fcos_dota_le90_1x` (73.07% official Task 1)
|
|
174
|
+
- **v0.3** (shipped): HRSC2016 loader + Hub 3× zoo (Oriented R-CNN 90.41%, Faster R-CNN 88.77%, FCOS 88.34% eval-val); FAIR1M loader + 1× recipes; SSDD + HRSID SAR loaders + 1× recipes (SSDD Faster R-CNN held-out **90.34%**, HRSID **78.55%**; train locally, no SAR Hub)
|
|
145
175
|
- **v0.4**: RTMDet-R and native YOLO-OBB (AGPL-free production tier)
|
|
146
176
|
- **v0.5+**: Swin-FPN backbone; optional fused CUDA kernels; hosted docs
|
|
147
177
|
|
|
@@ -149,9 +179,13 @@ See **[docs/roadmap.md](docs/roadmap.md)** for the full public plan. Summary:
|
|
|
149
179
|
|
|
150
180
|
Contributions are welcome. Run tests with `pytest`, format with `black` and `ruff`. See [docs/contributing.md](docs/contributing.md) for guidelines.
|
|
151
181
|
|
|
182
|
+
## Consulting and custom development
|
|
183
|
+
|
|
184
|
+
OrientedDet is Apache-2.0 open source. For **consulting, training workshops, or custom development** (dataset design, on-prem training, production packaging), see **[DL4EO](https://dl4eo.com)**.
|
|
185
|
+
|
|
152
186
|
## Publishing to PyPI
|
|
153
187
|
|
|
154
|
-
Version **0.
|
|
188
|
+
Version **0.3.0** — tag releases as **`v0.3.0`** (git) matching `version` in `pyproject.toml`.
|
|
155
189
|
|
|
156
190
|
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`**.
|
|
157
191
|
|
|
@@ -182,7 +216,7 @@ make check-configs
|
|
|
182
216
|
pytest tests/ -q
|
|
183
217
|
```
|
|
184
218
|
|
|
185
|
-
Bump version in `pyproject.toml` and `docs/changelog.md` if needed (currently **0.
|
|
219
|
+
Bump version in `pyproject.toml` and `docs/changelog.md` if needed (currently **0.3.0**).
|
|
186
220
|
|
|
187
221
|
#### 3. Build locally
|
|
188
222
|
|
|
@@ -257,6 +291,8 @@ Notes:
|
|
|
257
291
|
|
|
258
292
|
**Apache-2.0** — Copyright © Jeff Faudi and [DL4EO](https://dl4eo.com). See [LICENSE](LICENSE) for details.
|
|
259
293
|
|
|
294
|
+
The framework license does not grant rights to the **DOTA** or **HRSC** datasets. See [Apache 2.0 vs DOTA / HRSC dataset terms](https://deeplearning.earth/posts/2026-09-10_oriented_det_apache_license_versus_dota/).
|
|
295
|
+
|
|
260
296
|
## Acknowledgements
|
|
261
297
|
|
|
262
298
|
Design and APIs are informed by MMRotate, MMDetection, Detectron2, and related work in oriented object detection; **pretrained checkpoints in `pretrained/` are OrientedDet exports from this codebase**, not MMRotate zoo bundles.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""ONNX export package for OrientedDet. CLI: ``python -m export``.
|
|
2
|
+
|
|
3
|
+
Inference (``demo`` / ``infer``) needs only numpy, Pillow, and onnxruntime —
|
|
4
|
+
see ``requirements-runtime.txt``. The same consumer modules are copied into
|
|
5
|
+
``onnx_export/`` at export. Exporting a checkpoint still needs oriented-det
|
|
6
|
+
plus ``requirements-export.txt``.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from .cli import install_hint
|
|
12
|
+
|
|
13
|
+
__all__ = ["install_hint"]
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"""Standalone CLI for ONNX export (``python -m export``)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import importlib
|
|
6
|
+
import sys
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Dict, List, Optional, Tuple
|
|
9
|
+
|
|
10
|
+
# Maps subcommand name -> (module path, argv[0] for the target script)
|
|
11
|
+
_COMMANDS: Dict[str, Tuple[str, str]] = {
|
|
12
|
+
"onnx": ("export.scripts.export_onnx", "export-onnx"),
|
|
13
|
+
"infer": ("export.scripts.infer_onnx", "export-infer"),
|
|
14
|
+
"demo": ("export.scripts.demo", "export-demo"),
|
|
15
|
+
"preds": ("export.scripts.save_predictions_onnx", "export-preds"),
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
# Former odet / export-tf names. Export is not an odet subcommand.
|
|
19
|
+
_ALIASES = {
|
|
20
|
+
"export-onnx": "onnx",
|
|
21
|
+
"export-infer": "infer",
|
|
22
|
+
"export-demo": "demo",
|
|
23
|
+
"export-preds": "preds",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def install_hint() -> str:
|
|
28
|
+
root = Path(__file__).resolve().parent
|
|
29
|
+
runtime = root / "requirements-runtime.txt"
|
|
30
|
+
export = root / "requirements-export.txt"
|
|
31
|
+
return (
|
|
32
|
+
f"Infer/demo (no oriented-det): pip install -r {runtime}\n"
|
|
33
|
+
f"Export from a checkpoint: pip install -r {export} (plus oriented-det)"
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _print_help() -> None:
|
|
38
|
+
print("Usage: python -m export <command> [options]")
|
|
39
|
+
print("Run from the oriented-det repo root. Not an odet subcommand.")
|
|
40
|
+
print("demo / infer do not need oriented-det.")
|
|
41
|
+
print("")
|
|
42
|
+
print("Commands:")
|
|
43
|
+
for name in sorted(_COMMANDS):
|
|
44
|
+
print(f" {name}")
|
|
45
|
+
print("")
|
|
46
|
+
print("Examples:")
|
|
47
|
+
print(
|
|
48
|
+
" python -m export onnx --config path/to/config.json "
|
|
49
|
+
"--checkpoint path/to/model.pth --output ./onnx_export/model.onnx"
|
|
50
|
+
)
|
|
51
|
+
print(
|
|
52
|
+
" python -m export infer --onnx ./onnx_export/model.onnx "
|
|
53
|
+
"--images ./tiles --output ./onnx_export/predictions"
|
|
54
|
+
)
|
|
55
|
+
print(" python -m export demo")
|
|
56
|
+
print("")
|
|
57
|
+
print(install_hint())
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def _ensure_sys_path() -> None:
|
|
61
|
+
repo_root = Path(__file__).resolve().parents[1]
|
|
62
|
+
if str(repo_root) not in sys.path:
|
|
63
|
+
sys.path.insert(0, str(repo_root))
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _invoke(module_path: str, prog: str, args: List[str]) -> None:
|
|
67
|
+
_ensure_sys_path()
|
|
68
|
+
try:
|
|
69
|
+
mod = importlib.import_module(module_path)
|
|
70
|
+
except ImportError as e:
|
|
71
|
+
raise SystemExit(f"Failed to import {module_path}: {e}\n{install_hint()}") from e
|
|
72
|
+
if not hasattr(mod, "main"):
|
|
73
|
+
raise SystemExit(f"{module_path} has no main()")
|
|
74
|
+
sys.argv = [prog] + args
|
|
75
|
+
mod.main()
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def main(argv: Optional[List[str]] = None) -> None:
|
|
79
|
+
argv = list(sys.argv[1:] if argv is None else argv)
|
|
80
|
+
if not argv or argv[0] in ("-h", "--help"):
|
|
81
|
+
_print_help()
|
|
82
|
+
return
|
|
83
|
+
cmd, rest = argv[0], argv[1:]
|
|
84
|
+
cmd = _ALIASES.get(cmd, cmd)
|
|
85
|
+
if cmd not in _COMMANDS:
|
|
86
|
+
print(f"Unknown command: {cmd}", file=sys.stderr)
|
|
87
|
+
_print_help()
|
|
88
|
+
raise SystemExit(2)
|
|
89
|
+
module_path, prog = _COMMANDS[cmd]
|
|
90
|
+
_invoke(module_path, prog, rest)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
if __name__ == "__main__":
|
|
94
|
+
main()
|