This repo is a Keras implementation of unet.
- OpenCV
- Python 3.6
- Tensorflow-gpu-1.8.0
- Keras-2.2.4
Before you start training, you must make sure your dataset have the right format
If you just two classes to classify, you should set flag_multi_class equal to False and num_class=2
if you have many classes to classify, you should set flag_multi_class equal to True and num_class=number of your classes
Then you should set image type , image_color_mode and label_color_mode.
change the data path and run the train.py to train you own model and test.py to predict the test images
The binary classify model is trained for 30 epochs(300 step per epoch) in Kitti dataset. After 30 epochs, calculated accuracy is about 0.989, the loss is about 0.02 Loss function for the training is basically just a binary crossentropy.
The multi classify model is trained for 30 epochs(300 step per epoch) in Camvid dataset. After 30 epochs, calculated valid accuracy is about 0.768, the loss is about 1.43 Loss function for the training is categorical_crossentropy.
and the loss and accuracy curve in there:
Then you also can use label_visualization.py to visual your resut like this:
Unet is More commonly used in medical areas.
https://github.com/wuyang0329/unet
https://www.kaggle.com/longnguyen2306/bacteria-detection-with-darkfield-microscopy