An example of semantic segmentation using tensorflow in eager execution.

Overview

Semantic segmentation using Tensorflow eager execution

Requirement

  • Python 2.7+
  • Tensorflow-gpu
  • OpenCv
  • H5py
  • Scikit-learn
  • Numpy
  • Imgaug

Train with eager execution

Train a semantic segmentation model on the Camvid dataset! just execute:

python train_eager.py
Comments
  • Multiprocess load batch

    Multiprocess load batch

    Add to the Loaders get_batch function the possibility of loading it in another process.

    If its the first time to call it, load a batch as normal and creates anew process to load next batch

    it is not the first time to load it, creates a new process to load next batch and waits for the previous loaded batch in the queue.

    https://stackoverflow.com/questions/2046603/is-it-possible-to-run-function-in-a-subprocess-without-threading-or-writing-a-se

    compare both performances

    opened by Shathe 11
  • Error with different dataset

    Error with different dataset

    Hi,

    I change the example to use my dataset. I have just one class (the mask has two colors, black and with). The image has 140x140 pixels.

    n_classes = 1 dataset_path = 'seg' loader = Loader.Loader(dataFolderPath=dataset_path, n_classes=n_classes, problemType='segmentation', width=140, height=140, ignore_label=n_classes) model = MnasnetEager.MnasnetFC(num_classes=n_classes) optimizer = tf.train.AdamOptimizer(0.001) train(loader=loader, model=model, epochs=20, batch_size=8) get_params(model)

    The result generates an error: Using TensorFlow backend. Reading files... Structuring test and train files... Loaded 92 training samples Loaded 10 testing samples Dataset contains 1 classes epoch: 0 Traceback (most recent call last): File "train_eager_seg.py", line 109, in train(loader=loader, model=model, epochs=20, batch_size=1) File "train_eager_seg.py", line 44, in train x, y, mask = loader.get_batch(size=batch_size, train=True, augmenter=augmenter) File "/pylon5/ac3uump/rafaelmr/Semantic-Segmentation-Tensorflow-Eager/Loader.py", line 377, in get_batch return self._get_batch_segmentation(size=size, train=train, augmenter=augmenter) File "/pylon5/ac3uump/rafaelmr/Semantic-Segmentation-Tensorflow-Eager/Loader.py", line 296, in _get_batch_segmentation y = to_categorical(y, num_classes=self.n_classes+1) File "/home/rafaelmr/.conda/envs/seg1/lib/python2.7/site-packages/keras/utils/np_utils.py", line 32, in to_categorical categorical[np.arange(n), y] = 1 IndexError: index 255 is out of bounds for axis 1 with size 2

    Probably the error is associated with the number of the classes. I put the correct number of the classes. I try others numbers, but the problem still the same. Do I need to code another place?

    opened by rafaelmarconiramos 8
  • Deconvolution

    Deconvolution

    Are the deconv (transpose conv) going to create artifacts in the decoder?

    https://distill.pub/2016/deconv-checkerboard/ (there are many mentions to this 2016 paper)

    opened by bhack 6
  • Why are all the predicted data sets black?

    Why are all the predicted data sets black?

    First of all, thank you for sharing. I use the original dataset to get the correct results, but the final predicted result image of the cityscapes dataset using RGB annotations is all black, and the output is black when I test with my own dataset. Do you know why? thank you very much!

    opened by zhenyangGao 4
  • Results are strange

    Results are strange

    Hi,

    I executed your code, but the results are strange: epoch: 0 Train accuracy: None Test accuracy: None epoch: 1 Train accuracy: None Test accuracy: None ...... epoch: 18 Train accuracy: None Test accuracy: None epoch: 19 Train accuracy: None Test accuracy: None Total parameters of the net: 6421507 == 6.421507M

    Why are all accuracies with none result?

    Tks

    opened by rafaelmarconiramos 3
  • Can you tell me the corresponding network structure.

    Can you tell me the corresponding network structure.

    Hello, thanks for your work with this code. I found a lot of class of network in the Network.py. Can you tell me those networks built depending on the existing the network structure or designed by yourself?

    opened by ywangeq 1
  • about saving model

    about saving model

    I have never used tensorflow eager, and I want to run the saved model on the mobile phone. May I ask you if the model saved by tensorflow eager can be saved as a file in tflite format and run on the mobile phone? Save the model without. What about the meta file? Thank you very much for your help!

    opened by zhenyangGao 0
  • Move to Dataset API

    Move to Dataset API

    Change the custom loader your are using for the Dataset API. Keep the same functionalities like data augmentation. Change the rest of the code to integrate it. https://www.tensorflow.org/tutorials/eager/eager_basics#datasets https://www.tensorflow.org/performance/datasets_performance https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/contrib/eager/python/examples/generative_examples/image_captioning_with_attention.ipynb

    Once the Dataset API is integrated, move into the TFrecords data format http://warmspringwinds.github.io/tensorflow/tf-slim/2016/12/21/tfrecords-guide/

    opened by Shathe 2
Owner
Iñigo Alonso Ruiz
PhD student (University of Zaragoza)
Iñigo Alonso Ruiz
Mae segmentation - Reproduction of semantic segmentation using masked autoencoder (mae)

ADE20k Semantic segmentation with MAE Getting started Install the mmsegmentation

null 97 Dec 17, 2022
Neon-erc20-example - Example of creating SPL token and wrapping it with ERC20 interface in Neon EVM

Example of wrapping SPL token by ERC2-20 interface in Neon Requirements Install

null 7 Mar 28, 2022
Example-custom-ml-block-keras - Custom Keras ML block example for Edge Impulse

Custom Keras ML block example for Edge Impulse This repository is an example on

Edge Impulse 8 Nov 2, 2022
Python-kafka-reset-consumergroup-offset-example - Python Kafka reset consumergroup offset example

Python Kafka reset consumergroup offset example This is a simple example of how

Willi Carlsen 1 Feb 16, 2022
Learning Pixel-level Semantic Affinity with Image-level Supervision for Weakly Supervised Semantic Segmentation, CVPR 2018

Learning Pixel-level Semantic Affinity with Image-level Supervision This code is deprecated. Please see https://github.com/jiwoon-ahn/irn instead. Int

Jiwoon Ahn 337 Dec 15, 2022
Tensorflow 2.x implementation of Panoramic BlitzNet for object detection and semantic segmentation on indoor panoramic images.

Deep neural network for object detection and semantic segmentation on indoor panoramic images. The implementation is based on the papers:

Alejandro de Nova Guerrero 9 Nov 24, 2022
Example scripts for the detection of lanes using the ultra fast lane detection model in Tensorflow Lite.

TFlite Ultra Fast Lane Detection Inference Example scripts for the detection of lanes using the ultra fast lane detection model in Tensorflow Lite. So

Ibai Gorordo 12 Aug 27, 2022
Segmentation in Style: Unsupervised Semantic Image Segmentation with Stylegan and CLIP

Segmentation in Style: Unsupervised Semantic Image Segmentation with Stylegan and CLIP Abstract: We introduce a method that allows to automatically se

Daniil Pakhomov 134 Dec 19, 2022
TorchDistiller - a collection of the open source pytorch code for knowledge distillation, especially for the perception tasks, including semantic segmentation, depth estimation, object detection and instance segmentation.

This project is a collection of the open source pytorch code for knowledge distillation, especially for the perception tasks, including semantic segmentation, depth estimation, object detection and instance segmentation.

yifan liu 147 Dec 3, 2022
Request execution of Galaxy SARS-CoV-2 variation analysis workflows on input data you provide.

SARS-CoV-2 processing requests Request execution of Galaxy SARS-CoV-2 variation analysis workflows on input data you provide. Prerequisites This autom

useGalaxy.eu 17 Aug 13, 2022
🔮 Execution time predictions for deep neural network training iterations across different GPUs.

Habitat: A Runtime-Based Computational Performance Predictor for Deep Neural Network Training Habitat is a tool that predicts a deep neural network's

Geoffrey Yu 44 Dec 27, 2022
Bayesian algorithm execution (BAX)

Bayesian Algorithm Execution (BAX) Code for the paper: Bayesian Algorithm Execution: Estimating Computable Properties of Black-box Functions Using Mut

Willie Neiswanger 38 Dec 8, 2022
QSYM: A Practical Concolic Execution Engine Tailored for Hybrid Fuzzing

QSYM: A Practical Concolic Execution Engine Tailored for Hybrid Fuzzing Environment Tested on Ubuntu 14.04 64bit and 16.04 64bit Installation # disabl

gts3.org (SSLab@Gatech) 581 Dec 30, 2022
Angora is a mutation-based fuzzer. The main goal of Angora is to increase branch coverage by solving path constraints without symbolic execution.

Angora Angora is a mutation-based coverage guided fuzzer. The main goal of Angora is to increase branch coverage by solving path constraints without s

null 833 Jan 7, 2023
Driller: augmenting AFL with symbolic execution!

Driller Driller is an implementation of the driller paper. This implementation was built on top of AFL with angr being used as a symbolic tracer. Dril

Shellphish 791 Jan 6, 2023
A torch.Tensor-like DataFrame library supporting multiple execution runtimes and Arrow as a common memory format

TorchArrow (Warning: Unstable Prototype) This is a prototype library currently under heavy development. It does not currently have stable releases, an

Facebook Research 536 Jan 6, 2023
Latent Execution for Neural Program Synthesis

Latent Execution for Neural Program Synthesis This repo provides the code to replicate the experiments in the paper Xinyun Chen, Dawn Song, Yuandong T

Xinyun Chen 16 Oct 2, 2022
Compute execution plan: A DAG representation of work that you want to get done. Individual nodes of the DAG could be simple python or shell tasks or complex deeply nested parallel branches or embedded DAGs themselves.

Hello from magnus Magnus provides four capabilities for data teams: Compute execution plan: A DAG representation of work that you want to get done. In

null 12 Feb 8, 2022