Unverified Commit 2a52b11c authored by bryandlee's avatar bryandlee Committed by GitHub

Docs: Clarify weight conversion dependencies

parent 00007a47
......@@ -11,36 +11,14 @@
* `2021-11-07` Thanks to [xhlulu](https://github.com/xhlulu), the `torch.hub` model is now available. See [Torch Hub Usage](#torch-hub-usage).
* `2021-11-07` Add FacePortraitV2 style demo to a telegram bot. See [@face2stickerbot](https://t.me/face2stickerbot) by [sxela](https://github.com/sxela)
## Basic Usage
**Weight Conversion from the Original Repo (Requires TensorFlow 1.x)**
```
git clone https://github.com/TachibanaYoshino/AnimeGANv2
python convert_weights.py
```
**Inference**
```
python test.py --input_dir [image_folder_path] --device [cpu/cuda]
```
<details>
<summary>samples</summary>
<br>
Results from converted `Paprika` style model (input image, original tensorflow result, pytorch result from left to right)
<img src="./samples/compare/1.jpg" width="960"> &nbsp;
<img src="./samples/compare/2.jpg" width="960"> &nbsp;
<img src="./samples/compare/3.jpg" width="960"> &nbsp;
</details>
**Note:** Training code not included / Results from converted weights slightly different due to the [bilinear upsample issue](https://github.com/pytorch/pytorch/issues/10604)
## Torch Hub Usage
......@@ -72,6 +50,30 @@ out = face2paint(model, img)
More details about `torch.hub` is in [the torch docs](https://pytorch.org/docs/stable/hub.html)
## Weight Conversion from the Original Repo (Tensorflow)
1. Install the [original repo's dependencies](https://github.com/TachibanaYoshino/AnimeGANv2#requirements): python 3.6, tensorflow 1.15.0-gpu
2. Install torch >= 1.7.1
3. Clone the original repo & run
```
git clone https://github.com/TachibanaYoshino/AnimeGANv2
python convert_weights.py
```
<details>
<summary>samples</summary>
<br>
Results from converted `Paprika` style model (input image, original tensorflow result, pytorch result from left to right)
<img src="./samples/compare/1.jpg" width="960"> &nbsp;
<img src="./samples/compare/2.jpg" width="960"> &nbsp;
<img src="./samples/compare/3.jpg" width="960"> &nbsp;
</details>
**Note:** Results from converted weights slightly different due to the [bilinear upsample issue](https://github.com/pytorch/pytorch/issues/10604)
## Additional Model Weights
**Webtoon Face** [[ckpt]](https://drive.google.com/file/d/10T6F3-_RFOCJn6lMb-6mRmcISuYWJXGc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment