This is the implementation of "U-Net" for regression.
Original paper: O. Ronneberger, P. Fischer, and T. Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention, 2015. link
Please build the source file according to the procedure.
$ mkdir build
$ cd build
$ cmake ..
$ make -j4
$ cd ..
- CMP Facade Database
This is a dataset of facade images assembled at the Center for Machine Perception, which includes 606 rectified images of facades from various sources, which have been manually annotated.
Link: official
Please create a link for the dataset.
The following hierarchical relationships are recommended.
datasets
|--Dataset1
| |--trainI
| | |--image1.png
| | |--image2.bmp
| | |--image3.jpg
| |
| |--trainO
| | |--image1.png
| | |--image2.bmp
| | |--image3.jpg
| |
| |--validI
| |--validO
| |--testI
| |--testO
|
|--Dataset2
|--Dataset3
You should substitute the path of training input data for "<training_input_path>", training output data for "<training_output_path>", test input data for "<test_input_path>", test output data for "<test_output_path>", respectively.
The following is an example for "facade".
$ cd datasets
$ mkdir facade
$ cd facade
$ ln -s <training_input_path> ./trainI
$ ln -s <training_output_path> ./trainO
$ ln -s <test_input_path> ./testI
$ ln -s <test_output_path> ./testO
$ cd ../..
Please set the shell for executable file.
$ vi scripts/train.sh
The following is an example of the training phase.
If you want to view specific examples of command line arguments, please view "src/main.cpp" or add "--help" to the argument.
#!/bin/bash
DATA='facade'
./U-Net_Regression \
--train true \
--epochs 300 \
--dataset ${DATA} \
--size 256 \
--batch_size 16 \
--gpu_id 0 \
--input_nc 3 \
--output_nc 3
Please execute the following to start the program.
$ sh scripts/train.sh
Please set the shell for executable file.
$ vi scripts/test.sh
The following is an example of the test phase.
If you want to view specific examples of command line arguments, please view "src/main.cpp" or add "--help" to the argument.
#!/bin/bash
DATA='facade'
./U-Net_Regression \
--test true \
--dataset ${DATA} \
--size 256 \
--gpu_id 0 \
--input_nc 3 \
--output_nc 3
There are no particular restrictions on both input and output images.
However, the two file names must correspond without the extension.
Please execute the following to start the program.
$ sh scripts/test.sh
This code is inspired by pytorch-CycleGAN-and-pix2pix.