-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
Use Conda (recommended)
- Create a new conda env
conda create --name qgis_env python=3.11
conda activate qgis_env- Install QGIS and Dependencies
conda install -c conda-forge qgis
conda install torchmetrics wandb matplotlib pillow shapely fiona rasterio scipy -c conda-forge
conda install opencv -c conda-forge
python3 -m pip install tqdm yacs
python3 -m pip install torch torchvision- Clone this repository
git clone [email protected]:umfieldrobotics/ShipwreckFinderQGISPlugin.git- Install requirements
pip install -r requirements.txt- Run qgis
qgisInstall requirements using the previous QGIS Installation
Locate the QGIS version of pip and install dependencies.
If you're using a Mac, the command may look like the following:
/Applications/QGIS.app/Contents/MacOS/bin/pip3 install --upgrade -r requirements.txtIf you're using a Linux machine, the QGIS version of Python typically runs with root privileges. You can install the requirements in the root user's workspace (not recommeneded):
sudo su
apt install python3-pip
pip3 install -r requirements.txtInstall the ShipwreckFinder plugin via .zip file
The entire plugin has been compressed into a single .zip file, which can be found here. Download this .zip file, and then run the following command in the terminal that has your Conda environment active (Anaconda shell for Windows):
qgisThis will open an instance of QGIS, running through your Conda environment so all the necessary Python libraries are installed.
Next, locate the Plugins menu in the top menu bar. Select this menu and choose the Manage and Install Plugins... option. This should bring up the menu seen to the right.
Simply select the three dots, navigate to the .zip file downloaded from earlier, and select that file. Then, click the Install Plugin button.
When the plugin is successfully installed, a bright green success banner will show at the top of the menu. At this point you can safely close out of the installation menu. The next steps are to download some test data and try running the plugin on GEOTIFF files containing real wreck sites.
There are four different models available in the ShipwreckFinder plugin, each trained with a different backbone, and each with their own strengths and weaknesses. Any of these models can be selected when using the plugin, depending on the desired output. The model weights can be found here. These files need to be placed in a specific location dependent on the operating system, and must be placed after the create_plugin.py script has been run.
Linux: ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgisplugin/core
MacOS: ~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/qgisplugin/core
Windows: %APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\qgisplugin\core
Some example bathymetric data can be found here. There are two GEOTIFFs: One is a small portion of a publicly available NOAA survey of Thunder Bay in Lake Huron, and other is a clip of a publicly available INFOMAR survey of the Celtic Sea. Download both of these files. Next, create a new QGIS project and import the GEOTIFFs.
To run the ShipwreckFinder plugin, navigate to the Raster menu in the top menu bar. Then, select the ShipwreckFinder Menu, and from there select ShipwreckFinder. This will bring up the menu seen on the right.
From here, use the drop-down menu to select your bathymetric data raster. Select your Clipping Extent using the three dots next to the text box. Chose Use Current Layer to set the extent to be the entire raster layer you have chosen, or use Select Extent on Canvas to draw an area on the raster layer. Clicking the Other parameters arrow will open a menu with more advanced parameters. Next, set up your Output path by selecting the three dots next to the text box, navigating to wherever you want the output to be placed, and naming the file.
Finally, select a model from the Select model architecture drop-down, and click Run. The result will end up on top of the bathymetric raster layer you selected to analysis.