This project implements density map based method for dense object counting, specifically applied to tree counting in aerial images.
- Utilizes a U-Net architecture for density map prediction
- Implements Density map generation (DMG) model for ground truth generation
- Supports training, validation, and testing phases
- Includes visualization tools for density maps
-
Run the setup script:
sh ./startup.sh
This script will:
- Create and activate a virtual environment
- Install all required packages
- Download the Yosemite Tree Dataset
- Preprocess the dataset
The pretrained models are included in the ./phases directory.
To train the model, run:
python train.py
You can override config parameters using command-line arguments:
python train.py --override data_dir=./new_data_path lr=1e-4
To test the model:
python test.py --model_folder ./path_to_model_folder
The config.json
file contains all the hyperparameters and settings for the model. You can modify this file to change the model's behavior.
models/
: Contains the U-Net and DMG model implementationsdatasets/
: Includes the TreeCountingDataset classutils/
: Helper functions and classes for training and evaluationtrain.py
: Main script for training the modeltest.py
: Script for evaluating the model on the test setvisualizer.py
: Script for visualizing density maps