项目作者: ArtyZe

项目描述 :
image (semantic segmentation) instance segmentation by darknet or yolo
高级语言: Objective-C
项目地址: git://github.com/ArtyZe/yolo_segmentation.git
创建时间: 2018-09-11T04:58:42Z
项目社区:https://github.com/ArtyZe/yolo_segmentation

开源协议:

下载


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:

  1. make -j8

Train:

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

Test:

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

Merge two images:

  1. 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:

  1. original colorful image;
  2. label image(pixel value is 0, 1, 2, 3 if you have 3 classes + background);
  3. 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. 1. prepare train images and label images like above images
  2. I have added below function call in my code according to my pictures, you have to change it according to your image name
  3. #######################################################
  4. find_replace(labelpath, "_leftImg8bit.png", "_gtFine_labelIds.png", labelpath);
  5. #######################################################
  6. 2. put label images and original images together
  7. 3. generate the train.list file just like:
  8. /home/user/Desktop/YOLO_train/leftImg8bit/train/aachen_resize/jena_000012_000019_leftImg8bit.png
  9. 4. start train
  10. ./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: Gaoyang917528@163.com.