Tree Detector enables you to plot trees in OpenStreetMap (OSM) extremely efficiently. Using a Faster R-CNN model, finetuned on satellite imagery of trees, Tree Detector suggests trees that a user can easily accept.
As the model weights are ~166MB, this repository stores them with Git LFS. Install it and activate it once before cloning:
brew install git-lfs # macOS
git lfs install
git clone https://github.com/paul-rabel/tree_detector.gitIf you already cloned without Git LFS, first install it, then run git lfs pull inside the repository to get the actual weights.
| Requirement | Simple Usage | More Training |
|---|---|---|
| Chrome | ✅ | |
| Python 3.10+ | ✅ | ✅ |
| torch | ✅ | ✅ |
| torchvision | ✅ | ✅ |
| Pillow | ✅ | ✅ |
| numpy | ✅ | |
| pycocotools | ✅ | |
| Jupyter / Notebook | ✅ | |
| tkinter | ✅ |
To install all (except Chrome & tkinter), run:
pip install -r requirements.txt- Change to Developer Mode in Chrome Extensions
- Upload (Load Unpack)
./extension
- Activate the server (s.t. the browser extension can communicate with the backend)
python server/server.py- Open OpenStreetMap and click the
Editbutton - Activate the browser extension in chrome
- For best performance use zoom level
$18 - 21$ - Keep the left iD sidebar open - the tool needs it
- For best performance use zoom level
Each component has its own README:
extension/— the Chrome extension: screenshots the map, overlays detections, and plots accepted trees in the iD editor.server/— the local detection server: receives screenshots, runs the model, returns bounding boxes.model/— the Faster R-CNN model, fine-tuned weights, inference code, and the training notebook.model/Training Classifier/— tooling to label satellite images for (re)training.

