logo
Browse Source

Update README

Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
main
shiyu22 3 years ago
parent
commit
75e9f62698
  1. 47
      README.md
  2. BIN
      results2.png
  3. BIN
      test.png

47
README.md

@ -1,11 +1,23 @@
# Animating using AnimeGanV2
*author: Filip Haltmayer*
<br />
## Description
Convert an image into an animated image using [`AnimeganV2`](https://github.com/TachibanaYoshino/AnimeGANv2).
<br />
## Code Example
Load an image from path './test.png'.
@ -14,27 +26,36 @@ Load an image from path './test.png'.
```python
import towhee
towhee.glob('/Users/chenshiyu/workspace/data/pic/test.png') \
towhee.glob('./test.png') \
.image_decode.cv2() \
.img2img_translation.animegan(model_name = 'hayao') \
.show()
```
<img src="./results1.png" alt="results1" style="height:40px;"/>
<img src="./results1.png" height="150px"/>
*Write a same pipeline with explicit inputs/outputs name specifications:*
```python
import towhee
towhee.glob['path']('/Users/chenshiyu/workspace/data/pic/test.png') \
towhee.glob['path']('./test.png') \
.image_decode.cv2['path', 'origin']() \
.img2img_translation.animegan['origin', 'transformed'](model_name = 'hayao') \
.select('origin', 'transformed') \
.img2img_translation.animegan['origin', 'facepaintv2'](model_name = 'facepaintv2') \
.img2img_translation.animegan['origin', 'hayao'](model_name = 'hayao') \
.img2img_translation.animegan['origin', 'paprika'](model_name = 'paprika') \
.img2img_translation.animegan['origin', 'shinkai'](model_name = 'shinkai') \
.select('origin', 'facepaintv2', 'hayao', 'paprika', 'shinkai') \
.show()
```
<img src="./results2.png" alt="results1" style="height:50px;"/>
<img src="./results2.png" alt="results1" height="150px"/>
<br />
## Factory Constructor
@ -50,6 +71,12 @@ Model options:
- paprika
- shinkai
<br />
## Interface
Takes in a numpy rgb image in channels first. It transforms input into animated image in numpy form.
@ -67,11 +94,17 @@ Takes in a numpy rgb image in channels first. It transforms input into animated
**Returns**: *numpy.ndarray*
**Returns**: *towhee.types.Image (a sub-class of dumpy.ndarray)*
​ The new image.
<br />
## Reference
Jie Chen, Gang Liu, Xin Chen

BIN
results2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 715 KiB

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
test.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

Loading…
Cancel
Save