GithubHelp home page GithubHelp logo

tkwoo / visualization-segmentation-process Goto Github PK

View Code? Open in Web Editor NEW
72.0 9.0 16.0 14.61 MB

Segmentation visualization, keras, augmentation, fine tuning

Python 100.00%
segmentation keras unet deeplearning imagedatagenerator tensorflow visualization visualization-segmentation-process segmentation-visualization

visualization-segmentation-process's Introduction

Visualization segmentation training process

Semenatic segmentation using Unet, fcn, pspnet

Result

Youtube video

click image to watch video

Requirements

Usage

To train a model (visualization)

$ python main.py

Then, the training steps(image) will be saved 'result' directory


usage: main.py [-h] [--data_path DATA_PATH] 
                    [--output_dir OUTPUT_DIR]
                    [--image_height IMAGE_HEIGHT] 
                    [--image_width IMAGE_WIDTH]
                    [--batch_size BATCH_SIZE]
                    [--total_epoch TOTAL_EPOCH]
                    [--initial_learning_rate INITIAL_LEARNING_RATE]
                    [--learning_rate_decay_factor LEARNING_RATE_DECAY_FACTOR]
                    [--epoch_per_decay EPOCH_PER_DECAY] 
                    [--ckpt_dir CKPT_DIR]
                    [--ckpt_name CKPT_NAME]
                    [--pretrained_weight_path PRETRAINED_WEIGHT_PATH]
                    [--confidence_value CONFIDENCE_VALUE] 
                    [--debug DEBUG]
                    [--mode MODE] 
                    [--test_image_path TEST_IMAGE_PATH]
                    [--tf_log_level TF_LOG_LEVEL]

Input data(only for training)

└── dataset
    └── xxx
        └── train
            └── IMAGE
                └── ori
                    └── xxx.png (name doesn't matter)
            └── GT
                └── mask
                    └── xxx.png (It must have same name as original image)

The dataset directory structure is quite complex to use the Keras ImageDataGenerator Framework.

Input data for testing

└── test_data
    └── image.png

First, create checkpoint dir and download trained parameter files

└── checkpoint
    └── (ckpt_name)
        ├── model.json 
        ├── weight.xx.h5
        └── ...

You can download CHECKPOINT --> not supported

To test a model

$ python main.py --mode predict_img --ckpt_name <NAME> --test_image_path <.../image.png>

Reference

paper : https://lmb.informatik.uni-freiburg.de/people/ronneber/u-net/

visualization-segmentation-process's People

Contributors

tkwoo 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

visualization-segmentation-process's Issues

About predict.py

This visualization tool is interesting.
I would like to ask you
What is specified for the test image format etc?
predict.py can not be executed due to an error.

input_data = imgInput.reshape((1,256,256,1))
AttributeError: 'NoneType' object has no attribute 'reshape'

I am adjusting the image conditions, but what do you suppose to do with formats and image matrices?

Wrong regressor values

I guess the color values are wrong. Correct me if Im mistaken

    def make_regressor_label(self, gt):
        human = np.where(gt==24,255,0) + np.where(gt==25,255,0)
        car = np.where(gt==26,255,0) + np.where(gt==27,255,0) + np.where(gt==28,20,0)
        road = np.where(gt==7,255,0) #+ np.where(gt==8,1,0)
        label = np.concatenate((human, car, road), axis=-1)

        return label

The color code for the human in the segmentation mask is #181818 which in rgb is (24,24,24) but we are searching for wrong values between (24,255,0) and (24,255,0). why so?

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.