Skip to content

njanirudh/Geo-Segmentation-Pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vision Impulse Test

Goal of this project is to prototype and showcase a segmentation model on a custom geo-dataset.

Design Choices

  • Pytorch along with Pytorch Lightning [1] is used for prototyping the model. Pytorch Lightning is used to scale the model training on multiple GPUs/TPUs.
  • Due to time / computational constraints, the model was trained only for 50 epochs and the results obtained can be further improved.
  • UNet architecture similar to [2] was used for the task. Due to unavailability of pre-trained models trained on required classes, we preferred custom model.
  • The trainer supports both 3 channels (RGB) and 12 channels (bands) for training and inference.
  • Note: We used [0-11] zero indexed counting for channels/bands.

Code

  • 'src/main.py' can be used for training and inference.
  • 'src/sandbox' contains prototype code.
  • Code is designed to be modular. This will make prototyping different models, hyperparameter tuning easier.
  • Due to time constraint we have not written a commandline application for running training and inference.
  • DATASET_PATH can be replaced by path to {Dataset}. The dataset folder contains {Dataset/images} and {Dataset/labels}.
  • The code for graphing loss values are still in progress.

Input Image

The input 'tif.' image contains 12 channels.


Individual channels with countours:


RGB image (Channel 4,3,2):

From exif data [3]:

  • Pixel Scale < 10 10 0 >
  • Model Tie Point < 0 0 0 726830 5544990 0 >
  • Gt Model Type < Projected >
  • Gt Raster Type < Pixel Is Area >
  • Gt Citation < WGS 84 / UTM zone 31N >
  • Geog Citation < WGS 84 >
  • Geog Angular Units < Angular Degree >

Result

Example output after inference.

The (left) image shows the output of the model trained only on the RGB channels (4,3,2)
The (right) image shows the output of model trained on all the channels (1-12)

Since the model is not trained till convergance, the results are not directly usable.

References

  1. https://pytorch-lightning.readthedocs.io/en/latest/
  2. https://medium.com/analytics-vidhya/creating-a-very-simple-u-net-model-with-pytorch-for-semantic-segmentation-of-satellite-images-223aa216e705
  3. https://www.metadata2go.com
  4. https://www.pcigeomatics.com/geomatica-help/COMMON/concepts/TiePoint_explain.html

About

Prototype segmentation model in Pytorch-Lightning.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages