-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translate pgan document #12
Open
nninept
wants to merge
2
commits into
PyTorchKorea:master
Choose a base branch
from
nninept:pgan-translation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,49 +22,50 @@ demo-model-link: https://colab.research.google.com/drive/19NTYFNUT9js78UZ0g_3Isn | |
import torch | ||
use_gpu = True if torch.cuda.is_available() else False | ||
|
||
# trained on high-quality celebrity faces "celebA" dataset | ||
# this model outputs 512 x 512 pixel images | ||
# 유명인들의 고해상도 얼굴사진들로 만든 "celebA" 데이터셋으로 훈련시켰습니ㅏ | ||
# 이 모델은 512x512 픽셀 크기의 이미지를 출력하게 됩니다 | ||
model = torch.hub.load('facebookresearch/pytorch_GAN_zoo:hub', | ||
'PGAN', model_name='celebAHQ-512', | ||
pretrained=True, useGPU=use_gpu) | ||
# this model outputs 256 x 256 pixel images | ||
# 이 모델은 256x5126 픽셀 크기의 이미지를 출력하게 됩니다 | ||
# model = torch.hub.load('facebookresearch/pytorch_GAN_zoo:hub', | ||
# 'PGAN', model_name='celebAHQ-256', | ||
# pretrained=True, useGPU=use_gpu) | ||
``` | ||
|
||
The input to the model is a noise vector of shape `(N, 512)` where `N` is the number of images to be generated. | ||
It can be constructed using the function `.buildNoiseData`. | ||
The model has a `.test` function that takes in the noise vector and generates images. | ||
모델의 입력값으로 들어가는 노이즈(noise) 벡터는 `(N, 512)` 크기를 갖는데, 이때 `N` 은 생성하고싶은 데이터의 수입니다. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이때 |
||
이 노이즈 벡터들은 `.buildNoiseData`를 이용해서 만들 수 있습니다. | ||
모델은 `.test` 함수를 갖는데, 이 함수는 노이즈를 받아서 이미지를 생성하는 함수입니다. | ||
|
||
```python | ||
num_images = 4 | ||
noise, _ = model.buildNoiseData(num_images) | ||
with torch.no_grad(): | ||
generated_images = model.test(noise) | ||
|
||
# let's plot these images using torchvision and matplotlib | ||
# 생성한 이미지들을 torchvision과 matplotlib을 이용해서 시각화를 해봅시다 | ||
import matplotlib.pyplot as plt | ||
import torchvision | ||
grid = torchvision.utils.make_grid(generated_images.clamp(min=-1, max=1), scale_each=True, normalize=True) | ||
plt.imshow(grid.permute(1, 2, 0).cpu().numpy()) | ||
# plt.show() | ||
``` | ||
|
||
You should see an image similar to the one on the left. | ||
결과를 확인해보면 , 오른쪽의 이미지와 비슷한 사진을 확인 할 수 있을겁니다 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 왼쪽과 비슷한 이미지를 볼수 있다는 뜻일까요? |
||
|
||
If you want to train your own Progressive GAN and other GANs from scratch, have a look at [PyTorch GAN Zoo](https://github.com/facebookresearch/pytorch_GAN_zoo). | ||
만약 자신만의 Progressive GAN 이나 여타 GAN모델들을 밑바닥부터 구현해보고 싶다면, [PyTorch GAN Zoo](https://github.com/facebookresearch/pytorch_GAN_zoo)을 확인해보시기 바랍니다. | ||
|
||
### Model Description | ||
### 모멜 설명 | ||
|
||
In computer vision, generative models are networks trained to create images from a given input. In our case, we consider a specific kind of generative networks: GANs (Generative Adversarial Networks) which learn to map a random vector with a realistic image generation. | ||
컴퓨터 비전(computer vision)에서 생성자(generative) 모델이란, 주어진 입력값을 토대로 새로운 이미지를 만들어내는 신경망을 뜻합니다. | ||
지금 우리가 다루는 것은 생성자 신경망의 특정 모델로서: 무작위의 벡터를 사실적인 이미지로 변환시켜주는 GANs (Generative Adversarial Networks) 모델 입니다. | ||
|
||
Progressive Growing of GANs is a method developed by Karras et. al. [1] in 2017 allowing generation of high resolution images. To do so, the generative network is trained slice by slice. At first the model is trained to build very low resolution images, once it converges, new layers are added and the output resolution doubles. The process continues until the desired resolution is reached. | ||
GAN의 점진적 학습(Progressive Growing of GANs)은 Karras와 그 외[1]가 2017년 발표한 방법론으로, 고해상도의 이미지를 생성할 수 있습니다. 이를 위해 생성자 모델은 부분적으로 차근차근 훈련을 하게됩니다. 처음에는 가장 낮은 해상도를 학습하도록 하고, 어느정도 모델이 수렴하게 되면, 새로운 계층(layer)이 모델에 더해져, 기존 출력 이미지 크기의 2배로 커진 출력값으로 이어서 훈련하는 방식입니다. 이 과정은 원하는 해상도에 도달할때까지 반복됩니다. | ||
|
||
### Requirements | ||
### 준비물 | ||
|
||
- Currently only supports Python 3 | ||
- 현재는 Python 3에서만 지원이 됩니다 | ||
|
||
### References | ||
### 참고 | ||
|
||
- [Progressive Growing of GANs for Improved Quality, Stability, and Variation](https://arxiv.org/abs/1710.10196) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
마지막 글자 오타 수정 부탁드립니다