As of now, the plugin is not yet published in official QGIS repos, so you have to clone or copy this code into the python plugin directory of QGIS and manualy install.
Otherwise (for instance if you have several profiles), you can locate it by doing `Settings`>`User Profiles`>`Open active profile folder`.
Dependencies installation
Dependencies installation
--------------------------
--------------------------
To work, the plugin requires QGIS >= 3.34 (LTR) and has been tested with python 3.11.
To work, the plugin requires QGIS >= 3.34 (LTR) and has been tested with python 3.11. At first usage, a pop up should appear if necessary dependencies are not detected, that gives the option to install them automatically via `pip`.
The main dependencies are ``torchgeo``, ``timm``, ``geopandas``, ``scikit-learn`` and ``umap-learn``.
The main dependencies are ``torchgeo``, ``timm``, ``geopandas``, ``scikit-learn``. ``umap-learn`` can be used as well but as optional dependency.
The file ``requirement.txt`` in the plugin folder gives precise working versions of each dependencies.
The file ``requirement.txt`` in the plugin folder gives precise working versions of each dependencies.
If the necessary dependencies are not installed, a pop-up should appear on the first usage to propose an automated installation of the dependencies.
However, if this automated installation does not work, here are detailled instructions to install them.
However, if the automated installation does not work, here are detailled instructions to install them.
Linux
Linux
^^^^^^
^^^^^^
If you want to control your python environment to avoid conflicts with other projects, you can work in a conda environment.
If you want to control your python environment to avoid conflicts with other projects, you can work in a conda environment, where you can install QGIS.
We will provide a minimum functionning conda environment.
::
::
conda env create -f environment.yml
conda env create -f environment.yml
this creates a separate qgis installation within the environment.
.. this creates a separate qgis installation within the environment.
Alternatively, the main dependencies are installled via pip and available in the ``requirements_linux.txt`` file. Do keep in mind that there are possible conflict with geospatial dependencies (GDAL, PROJ etc).
.. Alternatively, the main dependencies are installled via pip and available in the ``requirements_linux.txt`` file.
Do keep in mind that there are possible conflict with geospatial dependencies (GDAL, PROJ etc).
Windows
Windows
...
@@ -44,7 +64,7 @@ Go to OSGeo4W Shell and install the following dependencies.
...
@@ -44,7 +64,7 @@ Go to OSGeo4W Shell and install the following dependencies.
pip install torchgeo == 0.5.2
pip install torchgeo == 0.5.2
pip install geopandas == 0.14.4
pip install geopandas == 0.14.4
pip install scikit-learn == 1.5.1
pip install scikit-learn == 1.5.1
pip install umap-learn == 0.5.6
# (optional) pip install umap-learn == 0.5.6
If you have any issue with windows, please provide your QGIS version, your python version an the dependencies currently installed in OSGeo4W.
If you have any issue with windows, please provide your QGIS version, your python version an the dependencies currently installed in OSGeo4W.
You can do that by going to OSGeo4W Shell and run the following lines :
You can do that by going to OSGeo4W Shell and run the following lines :
Our models are created using the `timm` librairy, which is widely used in deep learning research. [Here](https://timm.fast.ai/models#How-is-timm-able-to-use-pretrained-weights-and-handle-images-that-are-not-3-channel-RGB-images?) is the doc explaining how they handle non-RGB images when loading pre-trained models.
You can create an overlap by selecting a stride smaller than the sampling size of your raster. In the advanced options, you can change how the tiles will be merged afterwards.
This plugin was developped with ViTs in mind as template models. These have spatialy explicit features and divide the image into patches of typially `16x16` or `14x14` pixels. By having a smaller sampling size, you will have better resolution but with less context for the model to work with.
We've selected some state of the art models that seem to work well on our usecases so far. If you are short in RAM, prefer using the ``ViT Tiny model``, that is almost ten times smaller than the others (but can provide a less nuanced map).
.. Citation
.. ---------
Future work
Future work
------------
------------
In the short term, we aim to extend the possible reduction and clustering algorithm available (for instance using HDBSCAN as a clustering algorithm).
Acknowledgements
Acknowledgements
-----------------
-----------------
This repo benefits from `Geo-SAM <https://github.com/coolzhao/Geo-SAM>`_ and `TorchGeo <https://github.com/microsoft/torchgeo>`_. Thanks for their wonderful work.
This repo benefits from `Geo-SAM <https://github.com/coolzhao/Geo-SAM>`_ and `TorchGeo <https://github.com/microsoft/torchgeo>`_. Thanks for their wonderful work.