Soure code for the paper:
Arpit Bahety, Rohit Saluja, Ravi Kiran Sarvadevabhatla, Anbumani Subramanian and C.V. Jawahar "Automatic Quantification and Visualization of Street Trees." In Proceedings of 12th Indian Conference on Computer Vision, Graphics and Image Processing (ICVGIP’21), Chetan Arora, Parag Chaudhuri,and Subhransu Maji (Eds.). ACM, New York, NY, USA, Article 90. [https://cdn.iiit.ac.in/cdn/cvit.iiit.ac.in/images/ConferencePapers/2021/Automatic_tree.pdf]
|
Poster
![]() |
![]() |
---|
Input videos will need a GPS metadata file i.e. corresponding .gpx file. Please put the video and its .gpx file in the same folder
- Clone the repo. cd into the repo
- Create a virtual environement and run requirements.txt
python preprocess.py --video-path {path of your video file} --gpx-filename {gpx filename} --segment-duration {duration of video segments in seconds}
Example:python preprocess.py --video-path ~/Desktop/GH017798.mp4 --gpx-filename GH017798.gpx --segment-duration 180
The output of this command will be:
python run_inference.py --path {path of the folder created in step 3}
Example:python run_inference.py --path ~/Desktop/GH017798/
python create_gps_points.py --path {path of the folder created in step 3}
Example:python create_gps_points.py --path ~/Desktop/GH017798/
- To generate the Category Map:
python create_map.py
Here we don't need to divide the full video into smaller segments as we don't care about color coding every segment, but we just need to store the counted tree's GPS locations. (As of now we need to separately perform the Density Map generation due to inefficient implementation. This can be improved later). To Note: you need the "points.txt" file for this step which is generated in step 3 in the previous section.
- Comment out the following line in detect.py: print(text, file=open('tree_count.txt', "a+"))
python detect.py --source {path of your video file} --weights runs/train/exp7/weights/best.pt
Example:python preprocess.py --source ~/Desktop/GH017798.mp4 --weights runs/train/exp7/weights/best.pt
This will give a file as an output - "tree_gps.txt". Copy and paste this file in the folder (for our example): ~/Desktop/GH017798/python preprocess_kdr.py --path {path to the folder}
Example:python preprocess_kdr.py --path ~/Desktop/GH017798/
\ This will give a file as an output - "tree_density.txt"- Open R studio and run DR_demo.R
Model | AP@50 | MAE | TCDCA |
---|---|---|---|
Faster RCNN | 81.09% | 6.12 | 74.19% |
YOLOv4 | 82.50% | 4.35 | 90.32% |
YOLOv5s | 79.29% | 7.22 | 67.74% |
YOLOv5l | 83.74% | 3.09 | 96.77% |
If you use our code, please cite in the following BibTeX format:
@inproceedings{bahety2021automatic,
title={Automatic {Q}uantification and {V}isualization of {S}treet {T}rees},
author={Bahety, Arpit and Saluja, Rohit and Sarvadevabhatla, Ravi Kiran and Subramanian, Anbumani and Jawahar, CV},
booktitle={Proceedings of the Twelfth Indian Conference on Computer Vision, Graphics and Image Processing},
pages={1--9},
year={2021}
}