Pipeline for training data creation, training and inference of a MaskRCNN to detect electyricxal substations in the Netherlands using NSO Superview - 0.5 m resolution
-
conda: environment.yml
-
Procedure torch, torchvision, detectron2
pip3 install \ torch==1.10.2 \ torchvision==0.11.3 -extra-index-url https://download.pytorch.org/whl/cu113 python -m pip install detectron2 -f \ https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.html
-
On cluster use:
module load 2022 module load CUDA/11.3.1
-
Test environment by importing:
import detectron2 import torch import cv2 as cv import numpy as np from osgeo import gdal from detectron2 import model_zoo from detectron2.engine import DefaultPredictor from detectron2.config import get_cfg
-
Verify torch, torchvision, cuda compatibility by running:
python -m detectron2.utils.collect_env See: https://stackoverflow.com/questions/70831932/cant-connect-to-gpu-when-building-pytorch-projects or Python -c "import uutils; uutils.torch_uu.gpu_test() see: https://stackoverflow.com/questions/66992585/how-does-one-use-pytorch-cuda-with-an-a100-gpu
- Aim at the preperation of the imagery and annotation for DL training
- download NSO rasters
- Extract and filter OSM data for electrical substations
-
Create tiles of satelite imagery and annotation for DL model training
-
Should be added to overide the gdal .ini file in conda env:
osmconf.ini
-
Also in subs_detection/scripts/extract_osm_sub.py:
gdal.SetConfigOption("OSM_CONFIG_FILE", os.path.join('..',"osmconf.ini"))"