Skip to content
Snippets Groups Projects
Commit 9566f0f8 authored by paul.tresson_ird.fr's avatar paul.tresson_ird.fr
Browse files

update docs and readme

parent 3c2a150b
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,10 @@ At first usage, a pop up should appear if necessary dependencies are not detecte ...@@ -38,6 +38,10 @@ At first usage, a pop up should appear if necessary dependencies are not detecte
You can find more detailled instructions in the documentation. You can find more detailled instructions in the documentation.
For now, if you want to use a GPU you should install torch manualy following the instructions on https://pytorch.org/get-started/locally/
Autommated GPU dependencies installation is in the works, you can try the `gpu-support` branch on this repo.
## Documentation ## Documentation
......
...@@ -6,32 +6,52 @@ Installation Guide ...@@ -6,32 +6,52 @@ Installation Guide
Plug-in installation Plug-in installation
--------------------- ---------------------
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.
this is where it probably is located :
::
# Windows
%APPDATA%\QGIS\QGIS3\profiles\default\python\plugins
# Mac
~/Library/Application\ Support/QGIS/QGIS3/profiles/default/python/plugins
# Linux
~/.local/share/QGIS/QGIS3/profiles/default/python/plugins
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 :
......
...@@ -2,26 +2,61 @@ More ...@@ -2,26 +2,61 @@ More
================ ================
Commons Issue Common Issues
--------------- ---------------
UMAP crashes
^^^^^^^^^^^^^^^
Because of these issues, UMAP is disabled by default for now.
If you're using Windows, the use of UMAP may cause the plug-in to crash QGIS when using it. If you're using Windows, the use of UMAP may cause the plug-in to crash QGIS when using it.
If this issue happens we recommend to go in the reduction.py file of this plug in and comment the line : If this issue happens we recommend to go in the reduction.py file of this plug in and comment the line :
:: ::
import umap import umap
Then save the change, reload the plug-in and try again. Then save the change, reload the plug-in and try again.
Citation
---------
FAQ
---------------
How does it handle more than three band images with pretrained models ?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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.
How can I avoid tiling effects ?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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.
How can I obtain a better resolution ?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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.
Which model should I use ?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment