Là một dự án mã nguồn mở, affinelayer/pix2pix-tensorflow đã đạt 5.1k sao trên GitHub, ngôn ngữ JavaScript. Tensorflow port of Image-to-Image Translation with Conditional Adversarial Nets https://phillipi.github.io/pix2pix/
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Tensorflow implementation of pix2pix. Learns a mapping from input images to output images, like these examples from the original paper:
This port is based directly on the torch implementation, and not on an existing Tensorflow implementation. It is meant to be a faithful implementation of the original work and so does not add anything. The processing speed on a GPU with cuDNN was equivalent to the Torch implementation in testing.
Setup
Prerequisites
Tensorflow 1.4.1
Recommended
Linux with Tensorflow GPU edition + cuDNN
Getting Started
# clone this repo
git clone https://github.com/affinelayer/pix2pix-tensorflow.git
cd pix2pix-tensorflow
# download the CMP Facades dataset (generated from http://cmp.felk.cvut.cz/~tylecr1/facade/)
python tools/download-dataset.py facades
# train the model (this may take 1-8 hours depending on GPU, on CPU you will be waiting for a bit)
python pix2pix.py \
--mode train \
--output_dir facades_train \
--max_epochs 200 \
--input_dir facades/train \
--which_direction BtoA
# test the model
python pix2pix.py \
--mode test \
--output_dir facades_test \
--input_dir facades/val \
--checkpoint facades_train
The test run will output an HTML file at facades_test/index.html that shows input/output/target image sets.
If you have Docker installed, you can use the provided Docker image to run pix2pix without installing the correct version of Tensorflow:
# train the model
python tools/dockrun.py python pix2pix.py \
--mode train \
--output_dir facades_train \
--max_epochs 200 \
--input_dir facades/train \
--which_direction BtoA
# test the model
python tools/dockrun.py python pix2pix.py \
--mode test \
--output_dir facades_test \
--input_dir facades/val \
--checkpoint facades_train
Datasets and Trained Models
The data format used by this program is the same as the original pix2pix format, which consists of images of input and desired output side by side like:
For example:
Some datasets have been made available by the authors of the pix2pix paper. To download those datasets, use the included script tools/download-dataset.py. There are also links to pre-trained models alongside each dataset, note that these pre-trained models require the current version of pix2pix.py:
python tools/download-dataset.py cityscapes 2975 images from the Cityscapes training set. (113M) Pre-trained: AtoB BtoA
python tools/download-dataset.py maps 1096 training images scraped from Google Maps (246M) Pre-trained: AtoB BtoA
python tools/download-dataset.py edges2shoes 50k training images from UT Zappos50K dataset. Edges are computed by HED edge detector + post-processing. (2.2GB) Pre-trained: AtoB
python tools/download-dataset.py edges2handbags 137K Amazon Handbag images from iGAN project. Edges are computed by HED edge detector + post-processing. (8.6GB) Pre-trained: AtoB
The facades dataset is the smallest and easiest to get started with.
Creating your own dataset
Example: creating images with blank centers for inpainting
No other processing is required, the colorization mode (see Training section below) uses single images instead of image pairs.
Training
Image Pairs
For normal training with image pairs, you need to specify which directory contains the training images, and which direction to train on. The direction options are AtoB or BtoA
In this mode, image A is the black and white image (lightness only), and image B contains the color channels of that image (no lightness information).
Tips
You can look at the loss and computation graph using tensorboard:
tensorboard --logdir=facades_train
If you wish to write in-progress pictures as the network is training, use --display_freq 50. This will update facades_train/index.html every 50 steps with the current training inputs and outputs.
Testing
Testing is done with --mode test. You should specify the checkpoint to use with --checkpoint, this should point to the output_dir that you created previously with --mode train:
If you use this code for your research, please cite the paper this code is based on: Image-to-Image Translation Using Conditional Adversarial Networks:
@article{pix2pix2016,
title={Image-to-Image Translation with Conditional Adversarial Networks},
author={Isola, Phillip and Zhu, Jun-Yan and Zhou, Tinghui and Efros, Alexei A},
journal={arxiv},
year={2016}
}
Acknowledgments
This is a port of pix2pix from Torch to Tensorflow. It also contains colorspace conversion code ported from Torch. Thanks to the Tensorflow team for making such a quality library! And special thanks to Phillip Isola for answering my questions about the pix2pix code.
affinelayer/pix2pix-tensorflow có 5.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/affinelayer/pix2pix-tensorflow. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
affinelayer/pix2pix-tensorflow có phải mã nguồn mở không?
Có — affinelayer/pix2pix-tensorflow phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/affinelayer/pix2pix-tensorflow.
affinelayer/pix2pix-tensorflow còn đang phát triển không?
Commit gần nhất trên affinelayer/pix2pix-tensorflow là 5.8 năm trước (theo timestamp GitHub). Repo có 1.3k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
affinelayer/pix2pix-tensorflow dùng license gì?
affinelayer/pix2pix-tensorflow phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
affinelayer/pix2pix-tensorflow là gì?
affinelayer/pix2pix-tensorflow (affinelayer/pix2pix-tensorflow) là dự án JavaScript trên GitHub. Theo mô tả gốc: Tensorflow port of Image-to-Image Translation with Conditional Adversarial Nets https://phillipi.github.io/pix2pix/
affinelayer/pix2pix-tensorflow viết bằng ngôn ngữ gì?
affinelayer/pix2pix-tensorflow chủ yếu viết bằng JavaScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc thêm về affinelayer/pix2pix-tensorflow ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/affinelayer/pix2pix-tensorflow là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về pix2pix-tensorflow?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về pix2pix-tensorflow.