OMIDet: Occlusion-Aware Morphology–Instance Disentanglement for Urban Tree Detection in Street-View Imagery
This is the official PyTorch implementation of the above publication.
OMIDet: Occlusion-Aware Morphology–Instance Disentanglement for Urban Tree Detection in Street-View Imagery
Abstract: Accurately detecting individual trees from images is fundamental for urban ecological monitoring and digital forest management. Although query-based detectors have achieved state-of-the-art performance, severe occlusion caused by complex urban objects often confuses feature representations of queries, hindering both instance separation and structural localization. To address this issue, we argue that accurate detection of occluded trees requires not only reliable structural perception but also effective feature separation among different instances. To this end, we propose an Occlusion-Aware Morphology–Instance Disentanglement Detector (OMIDet). Specifically, we first design a Tree Morphology Prior Decoder that decomposes each query into canopy-guided and trunk-guided components, enabling the model to better exploit complementary structural cues from visible tree regions. Secondly, we propose an Overlap-Guided Instance Contrast Loss, which helps to separate foreground and background features and distinguish those instances that are highly overlapping in physical space. Experiments on benchmark datasets demonstrate that our method significantly improves tree detection under severe occlusion. Compared with existing methods, OMIDet establishes a new state of the art, achieving 51.21% AP and 77.97% AP50. It surpasses DEIMv2, the strongest competing model, by 3.94% AP and 3.50% AP50, and demonstrates better generalization ability.
- 2026-07-20: Code are available! 🎉
The code has been trained on:
- Ubuntu 22.04
- CUDA 11.8
- Python 3.11.14
- Pytorch 2.5.1
- GeForce RTX 4090
$\times$ 1.
Create the conda environment:
conda env create -f environment.yaml
conda activate detect
We used two datasets for training and evaluation.
We refined the original UTD provided by Yongzhe Wang, and the optimized annotations can be accessed at Google Drive.
RoboFlow dataset is available at the Roboflow Website. Our reorganized dataset is available from Google Drive.
You should put these datasets in folder 'data/'.
You can download the pretrained model from Google Drive, and put it in folder outputs/.
To train OMINet, you should prepare the dataset, and replace the "img_folder" to your data path. Then, you use the follow command:
$ python train.py --config configs/deimv2/with_all_clean.yml
# for UTD
$ python train.py --config configs/deimv2/with_all_roboflow.yml
# for RoboFlowTo eval OMINet on two benchmarks, you can use the following commands:
$ python test_occlusion.py --config configs/deimv2/with_all_clean.yml --checkpoint outputs/UTD/best_stg2.pth --output-dir outputs/UTD/evaluationWe sincerely thank the excellent projects:
