Skip to content

Sijin-Li/GeneralCodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GeneralCodes

Introduction

for studying; CNN preprocessing Codes here are programmed by myself and are used to simplify the processing in the daily study.

Plan

samples in jupyter notebook

  • reading and saving geotiff TiffReadClipWrite.py
  • clipping the complete file to small patches TiffReadClipWrite.py
  • selecting specific files according to user requirements and moving them to a new path SelectPatch.py
  • producing training patches with special data types (such as samples for pix2pix which needs concatenating two individual samples) ConcatenateSamples.py
  • transfer RGB images to HSV and segment shadows according a threshold in V band. (for the gully detection based on UAV images with a large areas of shadows) ShadowExtraction.py
  • mosaic small patches into complete image through GDAL. GDALmosaic.py
  • read spatial reference in original imagery and write it in target imagery. WriteSpatialReference.py
  • read .pt(h) model file and transfer it to other type of models (.h5/.onnx) TransforPTtoothermodel.py

General CNNs

I used UNet, ResNet, ResUNet, pix2pix before, and I'll put them here in the next few weeks.

in this folder, you could use several net structure including RESUNET, RESUNET_PLUS_PLUS, UNET, AttU_Net in one train.py file. You could adjust the parameter of "MODELTYPE" in .yaml file to select different net structure.

  • UNet
  • ResUNet

(the adjusted version1: add testing code; user can determine the learning rate, step size for the decrease of lr, validation steps, input paths and other parameters in .yaml file.)

  • Tips: using mask_crop (background: 0, target: 255)
  • pix2pix

I will focus on this repo in the next few weeks. in the current version, I rewrote the generator structure and used ResUNet (in keras Model) as the generator. The discriminator has not been changed until now.

Useful repositories

Unet-Segmentation-Pytorch-Nest-of-Unets

pytorch including UNet, RCNN-UNet, Attention Unet, RCNN-Attention Unet and Nested UNet in Models.py.

UNet Zoon

in pytorch

GAN Zoo

a collection of GAN repositories.

GAN Zoo Pytorch version

All GAN completed by pytorch.

FFT network

I am not clear about it now.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors