Skip to content

Adapting Meta AI's Segment Anything to PV Systems Detection Downstream Task

License

Notifications You must be signed in to change notification settings

kandelak/SolarSAM

 
 

Repository files navigation

SolarSAM - Deep Learning for PV Systems Detection

drawing

Resolution-Detection Trade-Off

drawing

Prerequisites

Aerial Imagery with .TIF Extension 
Geometry Masks in .geojson Format 
SAM Model Checkpoint downloaded from https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth
Put the downloaded checkpoint into pretrained/ folder

Preprocessing - Creating Train, Validation and Testing Datasets

Go to preproccessing Folder and Create python environment using requirements.txt (Preprocessing uses different set of packages than trainig and must be done only once) 
After Activating the newly created Environment run: 
python run --tif-folder $ABSOLUTE_PATH_TO_WHERE_TIF_IMAGES_RESIDE --geojson-folder $ABSOLUTE_PATH_WHERE_GEOMETRY_MASKS_RESIDE
This will create and put resutls into ./temp folder
copy load folder from ./temp and put it into the root workspace path
load folder contains everython you need for training, validation, and testing 

Training:

Go to workspace Folder and Create python environment using requirements.txt
Activate that workspace and run:
torchrun train.py --config configs/sam-vit-b.yaml

Testing:

python test.py --model $ABSOLUTE_PATH_TO_THE_TRAINED_MODEL ----dataset ('val_dataset'|'test_dataset')

About

Adapting Meta AI's Segment Anything to PV Systems Detection Downstream Task

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 97.9%
  • Python 2.1%