Git Product home page Git Product logo

sshuair / torchsat Goto Github PK

View Code? Open in Web Editor NEW
381.0 20.0 48.0 42.34 MB

🔥TorchSat 🌏 is an open-source deep learning framework for satellite imagery analysis based on PyTorch.

Home Page: https://torchsat.readthedocs.io

License: MIT License

Python 99.68% Dockerfile 0.32%
pytorch deep-learning satellite satellite-imagery torchvision remote-sensing data-augmentation classification semantic-segmentation

torchsat's Introduction


TorchSat is an open-source deep learning framework for satellite imagery analysis based on PyTorch.

This project is still work in progress. If you want to know the latest progress, please check the develop branch.

Hightlight

  • 😉 Support multi-channels(> 3 channels, e.g. 8 channels) images and TIFF file as input.
  • 😋 Convenient data augmentation method for classification, sementic segmentation and object detection.
  • 😍 Lots of models for satellite vision tasks, such as ResNet, DenseNet, UNet, PSPNet, SSD, FasterRCNN ...
  • 😃 Lots of common satellite datasets loader.
  • 😮 Training script for common satellite vision tasks.

Install

  • source: python3 setup.py install

How to use

Features

Data augmentation

We suppose all the input images, masks and bbox should be NumPy ndarray. The data shape should be [height, width] or [height, width, channels].

pixel level

Pixel-level transforms only change the input image and will leave any additional targets such as masks, bounding boxes unchanged. It support all channel images. Some transforms only support specific input channles.

Transform Image masks BBoxes
ToTensor
Normalize
ToGray
GaussianBlur
RandomNoise
RandomBrightness
RandomContrast

spatial-level

Spatial-level transforms will simultaneously change both an input image as well as additional targets such as masks, bounding boxes. It support all channel images.

Transform Image masks BBoxes
Resize
Pad
RandomHorizontalFlip
RandomVerticalFlip
RandomFlip
CenterCrop
RandomCrop
RandomResizedCrop
ElasticTransform
RandomRotation
RandomShift

Models

Classification

All models support multi-channels as input (e.g. 8 channels).

  • VGG: vgg11, vgg11_bn, vgg13, vgg13_bn, vgg16, vgg16_bn, vgg19_bn, vgg19
  • ResNet: resnet18, resnet34, resnet50, resnet101, resnet152, resnext50_32x4d,resnext101_32x8d, wide_resnet50_2, wide_resnet101_2
  • DenseNet: densenet121, densenet169, densenet201
  • Inception: inception_v3
  • MobileNet: mobilenet_v2
  • EfficientNet: efficientnet_b0, efficientnet_b1, efficientnet_b2, efficientnet_b3,efficientnet_b4, efficientnet_b5, efficientnet_b6, efficientnet_b7
  • ResNeSt: resnest50, resnest101, resnest200, resnest269

Sementic Segmentation

  • UNet: unet, unet34, unet101, unet152 (with resnet as backbone.)

Dataloader

Classification

Showcase

If you extend this repository or build projects that use it, we'd love to hear from you.

Reference

Note

  • If you are looking for the torchvision-enhance, please checkout the enhance branch. But it was deprecated.

torchsat's People

Contributors

sshuair avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

torchsat's Issues

Is this project dead?

Hi,

Are there any plans for continuing development on this project or is it dead?

Thanks.

UNet input size dimension does not match error

code

import torch
from torchsat.models.segmentation import unet34

model = unet34(2)
inputs = torch.randn((1,3,800,800))
outputs = model(inputs)

error message:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-7-62f9f3e6e8e0> in <module>
      1 model = unet34(2)
      2 inputs = torch.randn((1,3,800,800))
----> 3 outputs = model(inputs)

/usr/local/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    491             result = self._slow_forward(*input, **kwargs)
    492         else:
--> 493             result = self.forward(*input, **kwargs)
    494         for hook in self._forward_hooks.values():
    495             hook_result = hook(self, input, result)

/usr/local/lib/python3.6/site-packages/torchsat-0.0.1-py3.6.egg/torchsat/models/segmentation/unet.py in forward(self, x)
    172         center = self.center(pool)
    173 
--> 174         dec5 = self.dec5(torch.cat([center, conv5], 1))
    175 
    176         dec4 = self.dec4(torch.cat([dec5, conv4], 1))

RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 24 and 25 in dimension 2 at ../aten/src/TH/generic/THTensor.cpp:711
``

您好!关于该库读取tif的问题

首先非常感谢您为深度学习在遥感图像的应用做的贡献。
其次,我在拜读您的源码:torchvision-enhance/torchvision_x/transforms/functional.py 时
发现有关 tifffile 的相关API还没有出现在源码当中,我印象里仅仅凭cv2好像是无法解决遥感影像的多通道问题。所以想询问一下该库现在是否可以读取tif的数据(如“sample-data/MUL_AOI_4_Shanghai_img1920.tif”)

感谢!

pretrained models?

Dear @sshuair , thanks for this great work :)

do you have any pre-trained models for segmentation and detection?

Thanks!

Best regards

Spelling

On the first line of installation.rst, Installation is misspelled. Also the exsamples directory should be examples. :)

What does "target" mean in Seg*.__call__(self,img,target)?

For example:

class SegResize(object):
def __ init __(self, size):
if isinstance(size, int):
self.size = (size, size)
else:
self.size = size
def __ call __(self, img, target):
return F.resize(img, self.size), F.resize(target, self.size, Image.NEAREST)

Hello, I was wondering if I could pass the "img" parameter only? Because in the F.resize function, it checks if target is None. So, it will throw an exception if I pass the "target" parameter by None.

Thanks for your sharing anyway.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.