Spaces:
Runtime error
Runtime error
TachibanaYoshino
commited on
Commit
β’
b117429
1
Parent(s):
08298e1
Upload 19 files
Browse files- AnimeGANv3_bin.so +2 -2
- AnimeGANv3_src.so +2 -2
- app.py +10 -7
- main.py +16 -0
- output/out.jpeg +0 -0
- requirements.txt +1 -3
AnimeGANv3_bin.so
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0144addcefab622e11aafa36d728cdb19a71a60e72d4a8ecb6990de5b09d58ca
|
3 |
+
size 68897744
|
AnimeGANv3_src.so
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e54f5cfda7db752b8d95f970cf4fff3c0be9c403b782f0e21797f8d3aabc34a
|
3 |
+
size 450192
|
app.py
CHANGED
@@ -26,6 +26,8 @@ def inference(img_path, Style, if_face=None):
|
|
26 |
f = "D"
|
27 |
elif Style == "AnimeGANv3_JP_face v1.0":
|
28 |
f = "J"
|
|
|
|
|
29 |
else:
|
30 |
f = "U"
|
31 |
|
@@ -45,7 +47,7 @@ def inference(img_path, Style, if_face=None):
|
|
45 |
title = "AnimeGANv3: To produce your own animation."
|
46 |
description = r"""Official online demo for <a href='https://github.com/TachibanaYoshino/AnimeGANv3' target='_blank'><b>AnimeGANv3</b></a>. If you like what I'm doing you can tip me on <a href='https://www.patreon.com/Asher_Chan' target='_blank'><b>**patreon**</b></a>.<br>
|
47 |
It can be used to turn your photos or videos into anime.<br>
|
48 |
-
To use it, simply upload your image. It can convert landscape photos to Hayao Miyazaki or Makoto Shinkai style anime, as well as
|
49 |
If AnimeGANv3 is helpful, please help to β the <a href='https://github.com/TachibanaYoshino/AnimeGANv3' target='_blank'>Github Repo</a> and recommend it to your friends. π
|
50 |
|
51 |
"""
|
@@ -53,15 +55,15 @@ article = r"""
|
|
53 |
|
54 |
[![GitHub Stars](https://img.shields.io/github/stars/TachibanaYoshino/AnimeGANv3?style=social)](https://github.com/TachibanaYoshino/AnimeGANv3)
|
55 |
|
56 |
-
###
|
57 |
I. Video to anime (Hayao Style)
|
58 |
<p style="display: flex;">
|
59 |
<a href="https://youtu.be/EosubeJmAnE" target="___blank" style="margin-left: 14px;"><img src="https://img.shields.io/static/v1?label=YouTube&message=video 1&color=red"/></a>
|
60 |
<a href="https://youtu.be/5qLUflWb45E" target="___blank" style="margin-left: 14px;"><img src="https://img.shields.io/static/v1?label=YouTube&message=video 2&color=green"/></a>
|
61 |
-
<a href="https://
|
62 |
</p>
|
63 |
-
II. Video to anime (USA cartoon + Disney style)
|
64 |
-
|
65 |
|
66 |
----------
|
67 |
|
@@ -91,7 +93,8 @@ gr.Interface(
|
|
91 |
'AnimeGANv3_Disney v1.0',
|
92 |
'AnimeGANv3_PortraitSketch',
|
93 |
'AnimeGANv3_JP_face v1.0',
|
94 |
-
|
|
|
95 |
type="value",
|
96 |
value='AnimeGANv3_Hayao',
|
97 |
label='AnimeGANv3 Style'),
|
@@ -104,5 +107,5 @@ gr.Interface(
|
|
104 |
description=description,
|
105 |
article=article,
|
106 |
allow_flagging="never",
|
107 |
-
examples=[['samples/7_out.jpg', 'AnimeGANv3_Arcane', "Yes"], ['samples/15566.jpg', 'AnimeGANv3_USA', "Yes"],['samples/23034.jpg', 'AnimeGANv3_Trump v1.0', "Yes"], ['samples/jp_13.jpg', 'AnimeGANv3_Hayao', "No"],
|
108 |
['samples/jp_20.jpg', 'AnimeGANv3_Shinkai', "No"], ['samples/Hamabe Minami.jpg', 'AnimeGANv3_Disney v1.0', "Yes"], ['samples/120.jpg', 'AnimeGANv3_JP_face v1.0', "Yes"], ['samples/52014.jpg', 'AnimeGANv3_PortraitSketch', "Yes"]]).launch(enable_queue=True)
|
|
|
26 |
f = "D"
|
27 |
elif Style == "AnimeGANv3_JP_face v1.0":
|
28 |
f = "J"
|
29 |
+
elif Style == "AnimeGANv3_Kpop v2.0":
|
30 |
+
f = "K"
|
31 |
else:
|
32 |
f = "U"
|
33 |
|
|
|
47 |
title = "AnimeGANv3: To produce your own animation."
|
48 |
description = r"""Official online demo for <a href='https://github.com/TachibanaYoshino/AnimeGANv3' target='_blank'><b>AnimeGANv3</b></a>. If you like what I'm doing you can tip me on <a href='https://www.patreon.com/Asher_Chan' target='_blank'><b>**patreon**</b></a>.<br>
|
49 |
It can be used to turn your photos or videos into anime.<br>
|
50 |
+
To use it, simply upload your image. It can convert landscape photos to Hayao Miyazaki or Makoto Shinkai style anime, as well as 4 style conversions about human faces.<br>
|
51 |
If AnimeGANv3 is helpful, please help to β the <a href='https://github.com/TachibanaYoshino/AnimeGANv3' target='_blank'>Github Repo</a> and recommend it to your friends. π
|
52 |
|
53 |
"""
|
|
|
55 |
|
56 |
[![GitHub Stars](https://img.shields.io/github/stars/TachibanaYoshino/AnimeGANv3?style=social)](https://github.com/TachibanaYoshino/AnimeGANv3)
|
57 |
|
58 |
+
### π» Demo
|
59 |
I. Video to anime (Hayao Style)
|
60 |
<p style="display: flex;">
|
61 |
<a href="https://youtu.be/EosubeJmAnE" target="___blank" style="margin-left: 14px;"><img src="https://img.shields.io/static/v1?label=YouTube&message=video 1&color=red"/></a>
|
62 |
<a href="https://youtu.be/5qLUflWb45E" target="___blank" style="margin-left: 14px;"><img src="https://img.shields.io/static/v1?label=YouTube&message=video 2&color=green"/></a>
|
63 |
+
<a href="https://youtu.be/0KaScDxgyBw" target="___blank" style="margin-left: 14px;"><img src="https://img.shields.io/static/v1?label=YouTube&message=video 3&color=pink"/></a>
|
64 |
</p>
|
65 |
+
II. Video to anime (USA cartoon + Disney style )
|
66 |
+
<a href="https://youtu.be/vJqQQMRYKh0"><img src="https://img.shields.io/static/v1?label=YouTube&message=AnimeGANv3_Trump style v1.5 &color=gold"/></a>
|
67 |
|
68 |
----------
|
69 |
|
|
|
93 |
'AnimeGANv3_Disney v1.0',
|
94 |
'AnimeGANv3_PortraitSketch',
|
95 |
'AnimeGANv3_JP_face v1.0',
|
96 |
+
'AnimeGANv3_Kpop v2.0',
|
97 |
+
],
|
98 |
type="value",
|
99 |
value='AnimeGANv3_Hayao',
|
100 |
label='AnimeGANv3 Style'),
|
|
|
107 |
description=description,
|
108 |
article=article,
|
109 |
allow_flagging="never",
|
110 |
+
examples=[['samples/7_out.jpg', 'AnimeGANv3_Arcane', "Yes"],['samples/1_out.jpg', 'AnimeGANv3_Kpop v2.0', "Yes"], ['samples/15566.jpg', 'AnimeGANv3_USA', "Yes"],['samples/23034.jpg', 'AnimeGANv3_Trump v1.0', "Yes"], ['samples/jp_13.jpg', 'AnimeGANv3_Hayao', "No"],
|
111 |
['samples/jp_20.jpg', 'AnimeGANv3_Shinkai', "No"], ['samples/Hamabe Minami.jpg', 'AnimeGANv3_Disney v1.0', "Yes"], ['samples/120.jpg', 'AnimeGANv3_JP_face v1.0', "Yes"], ['samples/52014.jpg', 'AnimeGANv3_PortraitSketch', "Yes"]]).launch(enable_queue=True)
|
main.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import cv2,os
|
2 |
+
import AnimeGANv3_src
|
3 |
+
if __name__ == '__main__':
|
4 |
+
|
5 |
+
f = 'A'
|
6 |
+
input_imgs_path = r'../../v3-usa\dataset\USA\val'
|
7 |
+
# input_imgs_path = r'/mnt/data/xinchen/v3-usa/dataset/USA/val'
|
8 |
+
output_path = 'AnimeGANv3_usa_64_output'
|
9 |
+
# img = cv2.imread(os.path.join(input_imgs_path, os.listdir(input_imgs_path)[0]))
|
10 |
+
img = cv2.imread(os.path.join(input_imgs_path, 'jp_16.png'))
|
11 |
+
out = AnimeGANv3_src.Convert(cv2.cvtColor(img, cv2.COLOR_BGR2RGB), f, True)
|
12 |
+
# cv2.imshow('d', cv2.cvtColor(out, cv2.COLOR_BGR2RGB))
|
13 |
+
# cv2.waitKey(0)
|
14 |
+
cv2.imwrite('a.jpg', cv2.cvtColor(out, cv2.COLOR_BGR2RGB))
|
15 |
+
|
16 |
+
|
output/out.jpeg
ADDED
requirements.txt
CHANGED
@@ -8,6 +8,4 @@ yapf
|
|
8 |
opencv-python
|
9 |
numpy
|
10 |
onnxruntime
|
11 |
-
Pillow
|
12 |
-
httpcore==0.15.0
|
13 |
-
httpx==0.23.0
|
|
|
8 |
opencv-python
|
9 |
numpy
|
10 |
onnxruntime
|
11 |
+
Pillow
|
|
|
|