-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add AnimeGANv2 model #102
Add AnimeGANv2 model #102
Conversation
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.
Excellent work! Thanks very much!
docs/en_US/tutorials/animegan.md
Outdated
|
||
### 1.2.1 Prepare dataset | ||
|
||
We download the dataset provided by the author from [here](https://github.com/TachibanaYoshino/AnimeGAN/releases/download/dataset-1).Then unzip to the `data` directory. |
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.
https://github.com/TachibanaYoshino/AnimeGAN/releases/download/dataset-1 is a dead link, should be
https://github.com/TachibanaYoshino/AnimeGAN/releases/tag/dataset-1
Better to give download command:
wget https://github.com/TachibanaYoshino/AnimeGAN/releases/download/dataset-1/dataset.zip
**NOTE:** you must modify the `configs/animeganv2.yaml > pretrain_ckpt ` parameter first! ensure the GAN can reuse the warmup generator model. | ||
```sh | ||
python tools/main.py --config-file configs/animeganv2.yaml | ||
``` |
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.
Add the training hyper params in doc to tell users how to reproduce the results. For example, how many GPU used? training step, batch-size, lr... can refer config. and so on.
docs/en_US/tutorials/animegan.md
Outdated
python tools/main.py --config-file configs/animeganv2.yaml --evaluate-only --load ${PATH_OF_WEIGHT} | ||
``` | ||
|
||
## 1.3 结果展示 |
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.
结果展示 -> Results
@@ -0,0 +1,73 @@ | |||
import os |
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.
Maybe also can add copyright, and add author zhen8838
after copyright. same as below
Iterable = collections.Iterable | ||
else: | ||
Sequence = collections.abc.Sequence | ||
Iterable = collections.abc.Iterable |
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.
remove the unsed importing, like Image, sin, cos, tan, .. collections...
|
||
|
||
def add(image, value): | ||
return np.clip(image + value, 0, 255).astype('uint8') |
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.
It seems only needs functional.py
|
||
@TRANSFORMS.register() | ||
class Add(T.BaseTransform): | ||
def __init__(self, value, keys=None): |
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.
Better to add commens. Although, there is no comments in the existing code. We will add in future
ppgan/models/animeganv2_model.py
Outdated
from ..solver import build_optimizer | ||
from ..modules.init import init_weights | ||
from ..utils.filesystem import load | ||
from paddle import nn |
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.
put this line in second line.
system importing, then third-party lib importing, then locally importing
return x | ||
|
||
|
||
class resBlock(nn.Layer): |
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.
resBlock -> ResBlock
ppgan/utils/summary.py
Outdated
import numpy as np | ||
|
||
|
||
def summary(model, input_size, batch_size=-1): |
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.
try paddle.summary
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.
😂 Ok
Thanks for the review😝, I have made the following changes in the new commit:
|
@zhen8838 There is conflict. And we are do testing now. Will be merged after passing the testing. |
can get model structure like torchsummary