This project is a demonstration of DeepForest (https://github.com/weecology/DeepForest) capabilities with IGN Orthoimagery. The goal is to show the potential of DeepForest for tree detection in urban area with aerial images from the open and free IGN data.
This project use a custom script to access the IGN data base :
https://github.com/aloui-mathias/pyqgis_IGN_WMTS
An API is developped to use DeepForest inside larger project :
https://gitlab.com/natural-solutions/ecoteka-deepforest
The goal of this project is to be a demonstration for the tree detection part of the ecoTeka project :
https://gitlab.com/natural-solutions/ecoteka
To use this script, you need the python version of QGIS available with anaconda.
# Creation of the conda environment
conda env create -f environment.yml
You can print the script usage with the command :
python script/main.py --help
The script use a geojson input from overpass-turbo.eu with a request like :
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“park”
*/
[out:json][timeout:25];
// gather results
(
// query part for: “park”
node["leisure"="park"]({{bbox}});
way["leisure"="park"]({{bbox}});
relation["leisure"="park"]({{bbox}});
);
// print results
out body;
>;
out skel qt;
-
one .json with the coordinates of the polygon projected on the image.
-
two .tiff with the image from the IGN with and without the predictions
-
two .pgn which are the compressed version of the .tiff
-
one .csv with the predictions projected on the image
If you have multiple features (with the previous request multiple parks), the script will run on each feature and you will have these 5 files for each feature and also a .gejson with only the selected feature.
You can run the example in docs :
# Command to run the script
python script/main.py --example
# High resolution is vailable for the example
python script/main.py --example --high-resolution
The files in docs are the results of the above command and here is the .png :
ecoteka-deepforest-demo-video.mp4
-
The Qt application in QGIS can have troubles depending on your display settings. If you have an error with :
qt.qpa.plugin: could not load the qt platform plugin "xcb" in "" even though it was found.You need to set your environment variable QT_QPA_PLATFORM to an available plugin for your setup. The plugin "offscreen" is available for all os :
conda env config vars set QT_QPA_PLATFORM=offscreen -
If you ave an error file not found for the default geojson file, check :
- That you are inside "ecoteka-deepforest-demo/" folder
- That you have placed an "export.geojson" from overpass-turbo.eu (like the one in docs) inside "ecoteka-deepforest-demo/data/" folder
- The predictions are also converted back to the initial coodinates system
- The predictions are converted into points
- The points are also converted back to the initial coodinates system
