GithubHelp home page GithubHelp logo

robotislove / yolo_segmentation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from artyze/yolo_segmentation

0.0 0.0 0.0 119.08 MB

image (semantic segmentation) instance segmentation by darknet or yolo

Python 0.01% C 11.18% Cuda 2.21% C++ 11.45% Makefile 0.01% Objective-C 75.14%

yolo_segmentation's Introduction

yolo_segmentation

GitHub stars GitHub forks GitHub watchers

The code is to get segmentation image by darknet

In the process of my project, I have referenced nithi89/unet_darknet in some points and nithilan has give me many important

advices, thanks to him, and if you have interest you can visit his homepage.

This is my third version, I added dilation convolutional, and now it has not so perfect result, but i think it's good enough for me.

I will continue to update afterwards, please stay tuned.

[The Commond to Run My Project]

Compile:

make -j8

Train:

./darknet segmenter train cfg/maskyolo.data cfg/instance_segment.cfg [pretrain weights file I gave to you] 

Test:

./darknet segmenter test cfg/maskyolo.data cfg/instance_segment.cfg [weights file] [image path]

Merge two images:

python Merge.py

And you will get the mask image named final.png

Test image: Merge them together image:

Output image:(for orig)

Merge them together image:(not so good, 1. more epochs; 2. deeper or more complex backbone)

[Pretrain weights file and cfg file]

  1. https://www.dropbox.com/sh/9wrevnyzwfv8hg7/AAA1MJElri9aROsjaPTxO5KCa?dl=0
  2. https://pan.baidu.com/s/15gcrXGzb-fY2vGdl4KlLqg password: bk01

[How to Train with Your Own Dataset ?]

The Way is so easy, you only need three files:

original colorful image;  

label image(pixel value is 0, 1, 2, 3 if you have 3 classes + background);  

train.list.

For example with cityscape dataset:

Colorful Original Image:

Image text

Lable Image:

I only have one class so the label image, as 0 is background and others are multi classes. If you have 2 classes, the label image pixel value should be 012 and so on:

Image text

Steps to train you own dataset:

  1. prepare train images and label images like above images  
  
    I have added below function call in my code according to my pictures, you have to change it according to your image name  
	 
    #######################################################
    find_replace(labelpath, "_leftImg8bit.png", "_gtFine_labelIds.png", labelpath); 
    #######################################################
	  
  2. put label images and original images together
  
  3. generate the train.list file just like:  
  
    /home/user/Desktop/YOLO_train/leftImg8bit/train/aachen_resize/jena_000012_000019_leftImg8bit.png

  4. start train
  
    ./darknet segmenter train [data_file path] cfg/segment.cfg [pretrain weights file I gave to you]  

If you want to see my Result Video, I have put it in: https://pan.baidu.com/s/1uJwFYLHEQ9DGFZ8RkGuagg, and the password is: ic3q

If you want to get how to change the code, see https://github.com/ArtyZe/yolo_segmentation/blob/master/Train_Details.md

What I did to change Yolo for image segmentation, I have written a blog in: https://blog.csdn.net/Artyze/article/details/82721147

After I will do some work in semantic segmentation with yolo.

If you want to do something with Yolo with me, contact me with E-mail: [email protected].

yolo_segmentation's People

Contributors

artyze avatar

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.