Giter VIP home page Giter VIP logo

akhilesh64 / resunet-a Goto Github PK

View Code? Open in Web Editor NEW
32.0 2.0 13.0 863 KB

Implementation of the paper "ResUNet-a: a deep learning framework for semantic segmentation of remotely sensed data" in TensorFlow.

License: MIT License

Python 100.00%
semantic-segmentation segmentation resunet boundary-detection deep-learning tensorflow keras convolutional-neural-networks image-segmentation satellite-imagery

resunet-a's Introduction

ResUnet-a

This repository contains implementation of the paper "ResUNet-a: a deep learning framework for semantic segmentation of remotely sensed data" in TensorFlow for the detection of plot boundaries specifically.

Usage

  1. Clone this repo using :
git clone https://github.com/Akhilesh64/ResUnet-a
  1. Install the requirements using :
pip install -r requirements.txt
  1. To start model training run the main.py file with following arguments :
python main.py --image_size 256 --batch_size 8 --num_classes 2 --validation_split 0.2 --epochs 100 --image_path ./images --gt_path ./gt --layer_norm batch --model_save_path ./ --checkpoint_mode epochs
  1. To produce model predictions on a directory of test images run script predict.py with the following arguments :
python predict.py --image_size 256 --num_classes 2 --image_path ./test --model_path ./model.h5 --output_path ./results

Results

                 Original Image                                          Groundtruth                                            Predicted

img1     gt1     result1

img2     gt2     result2

img3     gt3     result3

Citation

The arvix version of the paper can found at the following link.

If you find this repo useful please cite the original authors :

@article{DIAKOGIANNIS202094,
title = "ResUNet-a: A deep learning framework for semantic segmentation of remotely sensed data",
journal = "ISPRS Journal of Photogrammetry and Remote Sensing",
volume = "162",
pages = "94 - 114",
year = "2020",
issn = "0924-2716",
doi = "https://doi.org/10.1016/j.isprsjprs.2020.01.013",
url = "http://www.sciencedirect.com/science/article/pii/S0924271620300149",
author = "Foivos I. Diakogiannis and François Waldner and Peter Caccetta and Chen Wu",
keywords = "Convolutional neural network, Loss function, Architecture, Data augmentation, Very high spatial resolution"
}

resunet-a's People

Contributors

akhilesh64 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

Watchers

 avatar  avatar

resunet-a's Issues

Where can i get dataset?

Hi, i have some problems with running project. What do i must place in ./images and ./gt directories?
image
image
Such images?
And another question. What i must write here
python main.py --image_size 256 --batch_size 8 --num_classes 2 --validation_split 0.2 --epochs 100 --image_path ./images --gt_path ./gt --layer_norm batch --model_save_path ./ --checkpoint_mode epochs
if my images have size 512x512? What means these parameters?
--image_size 256 --batch_size 8 --num_classes 2 --validation_split 0.2 --epochs 100

Error cloning repo

Hi, Akhilesh! When cloning the repo, a message is received: ERROR: File "setup.py" not found for legacy project git+git://github.com/Akhilesh64/ResUnet-a.git.

How to continue to train?

Hi, I am trying to use your codes on Google Colab. But sometimes Colab suddenly closes itself. Is there a way to continue training?

I didn't see any flag in main.py about this.

Getting Value Error

ValueError: The two structures don't have the same sequence length. Input structure has length 4, while shallow structure has length 3.
Getting this error after running the code. #
Screenshot from 2022-06-15 23-27-10

Question about distance, boundary, segmentation and watershed algorithm.

Hello, at first, i like to thank you about the code that you have shared. My question is, how can we obtain 1) the probability of belonging to a field; 2) the probability
of belonging to a boundary; and 3) the distance to the closest
boundary with the corresponding code and have you used watershed algorithm as the resunet article suggests.

`dist = ZeroPadding2D(padding=1)(x1)
dist = Conv2D(32, 3)(dist)
dist = self.normalization(dist, self.layer_norm)
dist = Activation('relu')(dist)
dist = ZeroPadding2D(padding=1)(dist)
dist = Conv2D(32, 3)(dist)
dist = self.normalization(dist, self.layer_norm)
dist = Activation('relu')(dist)
dist = Conv2D(self.num_classes, 1, activation='softmax', name = 'distance')(dist)

    bound = Concatenate(axis=-1)([x, dist])
    bound = ZeroPadding2D(padding=1)(bound)
    bound = Conv2D(32, 3)(bound)
    bound = self.normalization(bound, self.layer_norm)
    bound = Activation('relu')(bound)
    bound = Conv2D(self.num_classes, 1, activation='sigmoid', name = 'boundary')(bound)

    seg = Concatenate(axis=-1)([x,bound,dist])
    seg = ZeroPadding2D(padding=1)(seg)
    seg = Conv2D(32, 3)(seg)
    seg = self.normalization(seg, self.layer_norm)
    seg = Activation('relu')(seg)
    seg = ZeroPadding2D(padding=1)(seg)
    seg = Conv2D(32, 3)(seg)
    seg = self.normalization(seg, self.layer_norm)
    seg = Activation('relu')(seg)
    seg = Conv2D(self.num_classes, 1, activation='softmax', name = 'segmentation')(seg)

    model = Model(inputs = input, outputs={'seg': seg, 'bound': bound, 'dist': dist})`

about d7v1

image
Hello, I tried to conduct d7v1 model but there is error, how should I modify? thank you!

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.