--- title: LEVIRDetNet emoji: 🛰️ colorFrom: indigo colorTo: purple sdk: gradio sdk_version: 6.31.0 app_file: app.py pinned: false license: other short_description: 159-category aerial object detection with LEVIRDetNet python_version: "3.10" startup_duration_timeout: 45m --- # LEVIRDetNet — Universal Remote Sensing Object Detection Demo of **LEVIRDetNet-159**, the foundation detector from [LEVIRDet: A Million-Scale 159-Category Dataset and Foundation Model for Universal Remote Sensing Object Detection](https://huggingface.co/papers/2606.25312) ([code](https://github.com/QinzheYang/LEVIRDet-release)). Upload an aerial / satellite image and the model returns bounding boxes over 159 categories — a hierarchy spanning 30 base classes (plane, ship, vehicle, storage tank, harbor …) down to fine types (A220, Boeing-737, Airliner, Small_leisure_craft, warship classes such as CV / DD / LCS …). ## What the demo does - Loads the complete `yangqinzhe/LEVIRDetNet-159` checkpoint (DINOv3 ViT-S/16 backbone + RTDETR hybrid encoder + 6-layer DEIMv2 decoder + hierarchy-aware head + online GSD predictor) into GPU memory. - Resizes the input to 1024 × 1024 (keep_ratio=False), one image per batch, and draws predicted boxes in **original-image coordinates** with the mmdet `DetLocalVisualizer` — the same pipeline as the authors' `levir_image_demo.py`. - Two numerical guards from the reference implementation are replicated: a neutral zero prior for single-image batches and the inactive-query reference-point NaN repair after query grouping. ## Example images The bundled samples come from the LEVIRDet release repository (`assets/demo_samples/`), released alongside the dataset, code and checkpoints. ## Model card - Checkpoint: [`yangqinzhe/LEVIRDetNet-159`](https://huggingface.co/yangqinzhe/LEVIRDetNet-159) (`best_coco_weighted_bbox_mAP_epoch_110_159class.pth`) - Architecture: `DEIMV2GSDGuided` — DEIMv2 with DINOv3 ViT-S/16 (`dinov3_vits16plus`), GSD-conditioned FiLM query modulation, hierarchical prediction head (path-score collapse, no NMS).