Skip to content

WHU-USI3DV/TreeDetection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is the official PyTorch implementation of the above publication.

🔭 Introduction

OMIDet: Occlusion-Aware Morphology–Instance Disentanglement for Urban Tree Detection in Street-View Imagery

teaser

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.

🆕 News

  • 2026-07-20: Code are available! 🎉

💻 Requirements

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.

🔧 Installation

Create the conda environment:

conda env create -f environment.yaml
conda activate detect

💾 Datasets

We used two datasets for training and evaluation.

UTD

We refined the original UTD provided by Yongzhe Wang, and the optimized annotations can be accessed at Google Drive.

RoboFlow

RoboFlow dataset is available at the Roboflow Website. Our reorganized dataset is available from Google Drive.

You should put these datasets in folder 'data/'.

🚅 Pretrained model

You can download the pretrained model from Google Drive, and put it in folder outputs/.

⏳ Train

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 RoboFlow

✏️ Test

To 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/evaluation

🔗 Related Projects

We sincerely thank the excellent projects:

  • DEIMv2 for the whole code organization.
  • OD-UTDNet for the original dataset collect;

About

OMIDet: Occlusion-Aware Morphology–Instance Disentanglement for Urban Tree Detection in Street-View Imagery

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages