• Stars
    star
    129
  • Rank 277,865 (Top 6 %)
  • Language
    Python
  • License
    Other
  • Created over 3 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

stylgan2 toonify

StyleGAN2 Webtoon / Anime Style Toonify

Korea Webtoon or Japanese Anime Character
Stylegan2 base high Quality 1024x1024 / 512x512 Generate and Transfer

Korean language
Stylegan2 ๋ฅผ ์ด์šฉํ•ด ๊ณ ํ™”์งˆ ๋ฐ˜์‚ฌ์‹คํ™” ๋ฐ Webtoon / anime ์Šคํƒ€์ผ ์บ๋ฆญํ„ฐ ์ƒ์„ฑ ๋ฐ ๋ณ€ํ™˜์„ ์‹œ๋„ํ•ด ๋ณด์•˜๊ณ  ๋ช‡๋ฒˆ์˜ ์‹œํ–‰์ฐฉ์˜ค ๋์— ์•„๋ž˜์™€ ๊ฐ™์ด ๋งŒ๋“ค ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.
์‚ฌ๋žŒ ์–ผ๊ตด ์‚ฌ์ง„ Pretrained Model ์—์„œ webtoon / anime ์ด๋ฏธ์ง€ 4๋ฐฑ์žฅ์ •๋„๋กœ Transfer Learning ๊ณผ Network blending ์„ ์ด์šฉํ•˜์˜€์Šต๋‹ˆ๋‹ค.
๊ธฐ์กด์— ๋‚˜์˜จ ๊ฒƒ๋“ค์€ ์„œ์–‘ ์นดํˆฐ ๋””์ฆˆ๋‹ˆ์ ์ด๊ฑฐ๋‚˜ ๋ฐ˜์‚ฌ์‹คํ™”์ ์ด์ง€ ์•Š๊ฑฐ๋‚˜ ๋™์–‘์ ์ธ ์˜ˆ์œ ์ผ€๋ฆญํ„ฐ๊ฐ€ ์ž˜ ๋‚˜์˜ค์ง€ ์•Š์•„์„œ ์‚ฌ์‹คํ™”๊ฐ™์œผ๋ฉด์„œ ๋™์–‘์  ์˜ˆ์˜๊ณ  ๋ฉ‹์ง„ webtoon / anime ์บ๋ฆญํ„ฐ๊ฐ€ ๋‚˜์˜ค๋Š”๋ฐ ๋ชฉ์ ์„ ๋‘์—ˆ์Šต๋‹ˆ๋‹ค.
์ƒˆ๋กœ์šด ๋™์–‘์ ์ด๊ณ  ์˜ˆ์œ ๊ณ ํ™”์งˆ ์บ๋ฆญํ„ฐ ์ƒ์„ฑ๋„ ์ž˜ ํ•˜์ง€๋งŒ ์‚ฌ๋žŒ ์–ผ๊ตด ์‚ฌ์ง„์„ project ํ›„ ๋‚˜์˜จ latent vectors ๋ฅผ ์ด์šฉํ•ด ์ด๋ฅผ ์ƒˆ๋กœ์šด ํ›ˆ๋ จ๋œ ๋ชจ๋ธ๋กœ generate ํ•˜์—ฌ photo face to toon/anime face ๋กœ ๋ณ€ํ™˜ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
์•„์ง ๋ฏธ์ˆ™ํ•œ ์ ๋„ ์žˆ์ง€๋งŒ ๋‹จ์ˆœ ์ƒ์„ฑ, ๋ณ€ํ™˜๋งŒ์ด ์•„๋‹ˆ๊ณ  latent vectors ๋ฅผ ์ด์šฉํ•˜์—ฌ ์–ผ๊ตด ์›€์ง์ด๊ธฐ, ์›ƒ๊ธฐ, ํ™”๋‚ด๊ธฐ ๋“ฑ ํ‘œ์ • ๋“ฑ๋„ ๋ณ€๊ฒฝ ์ƒ์„ฑ ๊ฐ€๋Šฅํ•˜์˜€์Šต๋‹ˆ๋‹ค.

์ดํ›„์—๋Š” ๋ฐ˜๋Œ€๋กœ webtoon / anime ์บ๋ฆญํ„ฐ ์ด๋ฏธ์ง€๋ฅผ ์‚ฌ์‹ค์  photo๋กœ ๋ณ€๊ฒฝํ•˜๋Š” ๊ฒƒ๊ณผ ์–ผ๊ตด๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ์ „์ฒด ๋ชธ์„ ์ƒ์„ฑ, webtoon / anime ์ „์ฒด ํ™”๋ฉด์„ ์ƒ์„ฑํ•ด ๋ณด๋Š” ๊ฒƒ์„ ํ•ด ๋ณด๋ ค ํ•ฉ๋‹ˆ๋‹ค. ์‹œ๊ฐ„์ด ๋˜๋Š”๋Œ€๋กœ...
๋” ๋‚˜์•„๊ฐ€์„œ๋Š” DALL-E, CLIP ๋ฅผ ์ด์šฉํ•˜๊ฑฐ๋‚˜ ์ด๋Ÿฐ ๋ฐฉ์‹์„ ์ด์šฉํ•ด ๊ธ€์„ ํ†ตํ•ด toon/anime ๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ์„ ์ง„ํ–‰ํ•ด๋ณด๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค.
์›นํˆฐ/์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์ข‹์•„ํ•˜๋‚˜ ๊ทธ๋ฆผ ์†œ์”จ๋Š” ์—†์–ด๋„ AI๋ฅผ ์ด์šฉํ•ด์„œ ์›ํ•˜๋Š” ์บ๋ฆญํ„ฐ๋‚˜ toon/anime ์„ ๋งŒ๋“ค๊ณ  ์ด๋ฅผ ์›€์ง์ด๊ณ  ๋ง์ด๋‚˜ ๊ธ€์„ ํ†ตํ•ด์„œ ๋งŒ๋“ค์ˆ˜ ์žˆ์ง€ ์•Š์„๊นŒ. ๋ง๋กœ AI ์—๊ฒŒ ์ง€์‹œํ•ด์„œ ๋งŒ๋“ค์–ด๊ฐ€๋Š” tonn/anime ์„ ์ƒ์ƒํ•ด ๋ด…๋‹ˆ๋‹ค.


English Language
I tried creating and converting high-definition reflections and Webtoon/anime style characters using Stylegan2, and after several trials and errors, I was able to create it as follows.
Transfer learning and network blending were used with about 400 webtoon / anime images with the human face photo Pretrained Model.
The existing ones are Western Cartoon Disney, not reflective, or Asian pretty characters aren't well out, so the purpose is to come up with Asian pretty and cool webtoon/anime character.
I am good at creating new Asian and pretty high-quality characters, but I used latent vectors that came out after projecting a human face photo and generated it as a new trained model and converted it to photo face to toon/anime face.
Although there are still some inexperienced things, it was possible to change expressions such as facial movements, laughs, and anger using latent vectors as well as simple creation and transformation.

Afterwards, I will try to change the webtoon / anime character image to a realistic photo, create not only the face but also the entire body, and create the webtoon / anime full screen. As time comes...
Furthermore, I would like to proceed with creating toon/anime through text writing using DALL-E, CLIP, or using this method.
I like webtoon/animation, but I donโ€™t have any drawing skills.
Wouldn't it be possible to create a character or toon/anime you want using AI, move it, and create it through words or writings? I imagine a toon/anime created by instructing AI in words.

Compare to Others

Toonify compare image

Generate toon images

Toonify compare image

Transfer Korea Star Photos to toon Images

Toonify compare image

Edit Face 1(Latent direction move)

Toonify Latent direction

Edit Face 2(Latent direction move)

Toonify Latent direction


Requirements

See StyleGAN2 Requirements

Usage

  1. align image

Copy real face photos in "data_test" directory. It will save face croped and aligned images.

python align_images.py data_test data_img_aligned
  1. project image

It will generate *.npy files and projected_image files in "data_project_gen" directory. Make "pretrained_networks" directory. Download pretrain network "https://drive.google.com/u/0/uc?id=1-04v78_pI59M0IvhcKxsm3YhK2-plnbj&export=download" and save in "pretrained_networks" directory.
Try to change --num-steps 500 or 700 or 1300, 1500, 2000 ...

python project_images.py data_img_aligned data_project_gen --num-steps=1000 --network-pkl="pretrained_networks/generator_star-stylegan2-config-f.pkl" --tmp-dir="./tmp"
  1. toonify

It will generate toonified image files in "data_project_gen" directory and It will add "_toon" to filename.

Semi-realistic Toon Download pretrain network "https://drive.google.com/file/d/1mmMqjS_8P23KthbsUxQRjTfiFQDa6met/view?usp=sharing" and save in "pretrained_networks" directory. Drawing Toon Download pretrain network "https://drive.google.com/file/d/1Xh2lQDcQXrYX7Zug4_95q8_9SR6lVwct/view?usp=sharing" and save in "pretrained_networks" directory.

  • if you need, ask for download permission. These are for personal use only and cannot be used externally without permission.

Semi-realistic Toon

python toonify_lnw.py --image_dir=data_project_gen --filename=_toon1.jpg --blendednet="pretrained_networks/wonwizard-bl-anistar-s30r64.pkl"

Drawing Toon

python toonify_lnw.py --image_dir=data_project_gen --filename=_toon2.jpg --blendednet="pretrained_networks/wonwizard-bl-anistar-s120r128.pkl"

Based on nvidia StyleGAN2.
๊ฐœ์ธ์ ์œผ๋กœ๋งŒ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•˜๋ฉฐ ํ—ˆ๊ฐ€์—†์ด ๋Œ€์™ธ์ ์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Œ.
These are for personal use only and cannot be used externally without my permission.