Pix2pix TensorFlow Test (operation of image-to-image of Gan)

Source: Internet
Author: User

Gan is a typical probabilistic generation model, and its core idea is to find out the statistical laws within the given observational data and to produce new data similar to the observed data based on the obtained probabilistic distribution model.


Probabilistic generation models can be used for the generation of natural images. Assuming that 10 million images are given, the build model automatically learns its internal distribution, explaining a given training picture and generating new pictures at the same time.

Compared with the large real data, the number of parameters of probabilistic generation model is much smaller than that of data. Therefore, during the training process, the generation model is forced to discover the more simple statistical laws behind the data, thus generating the data.

As the unsupervised learning of Gan has become a new technology point of deep learning, and many applications have come out, therefore, some applications of Gan are gradually studied, and the conversion between image and image is a typical application. Therefore, the technology is studied and operated.

The main reference code of this experiment is: Https://github.com/affinelayer/pix2pix-tensorflow

(1) First download data set, https://people.eecs.berkeley.edu/~tinghuiz/projects/pix2pix/datasets/, from this site can download a lot of classic application data set. In this paper, only facades is chosen as the data set, because the remaining principles are the same.

(2) Conduct training

In the program pix2pix.py code, manually add the test parameters, this article only lets run 200 times.

# The parameters of the training time

# A.input_dir = "/home/ndscbigdata/work/imgdata/facades/train"
# A.mode = "Train"
# A.output_dir = "/home/ndscbigdata/work/imgdata/facades/ckt"
# a.max_epochs=200
# a.which_direction = "BtoA"


(3) Parameters for test # test
A.input_dir = "/home/ndscbigdata/work/imgdata/facades/val"
A.mode = "Test"
A.output_dir = "/home/ndscbigdata/work/imgdata/facades/facades_test"
A.checkpoint= "/home/ndscbigdata/work/imgdata/facades/ckt"


the results of the test run are as shown in the figure:



The test results screenshot is as follows: You can see the result is quite good, but if the training max_epochs set a little more, it may be better.




the specific code has been posted on GitHub: Https://github.com/ndscigdata/tensorflow-pratice





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.