Giter Site home page Giter Site logo

hoangsondev / realworld-stylegan2-encoder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from talkuhulk/realworld-stylegan2-encoder

0.0 1.0 0.0 54.92 MB

Various applications based on Stylegan2 Style mixing that can be inference on cpu.

License: MIT License

Shell 0.42% Python 99.58%

realworld-stylegan2-encoder's Introduction

RealWorld StyleGan2 Encoder


The demo of different style with age edit.

Description

Various applications based on Stylegan2 Style mixing that can be inference on cpu.

Citation

This code is heavily based on stylegan2-pytorch. Thanks rosinality so much to make his work available πŸ™πŸ™πŸ™

Application


The demo of different style of psp-mobile-256p.


The demo of different style of psp-res50-256p.


The demo of different style of e4e-mobile-1024p.


The demo of different style of e4e-res50-1024p.


The demo of different style with age edit of e4e-res50-1024p

The demo of different style with gender edit of e4e-res50-1024p

The demo of different style with pose edit of e4e-res50-1024p

The demo of different style with smile edit of e4e-res50-1024p

Pretrained Models

I provide some of the model to test.

Google Drive η™ΎεΊ¦δΊ‘ Description
torch weight torch weight 密码:0mgk cartoon of e4e-mbv3 1024p and psp-mbv3 256p
onnx weight onnx weight 密码:inn8 stylegan2 onnx, cartoon of e4e-mbv3 1024p and psp-mbv3 256p
openvino weight openvino weight 密码:759q openvino cartoon of e4e-mbv3 1024p and psp-mbv3

Comparison

All test on MacOs 11.4 | 2.6 GHz Intel Core i7 | 32 GB 2667 MHz DDR4

pSp-mbv3-256p

Name Time(s)
torch 1.9860
onnx 0.5869
openvino 0.4533

e4e-mbv3-1024p

Name Time(s)
torch 4.8058
onnx 1.5155
openvino 0.8690

Test

torch

python scripts/test.py \
--ckpt ./best_model.pt \
--network psp \
--platform torch \
--align \
--images_path ./test_images

onnx

python scripts/test.py \
--ckpt ./cartoon_psp_mobile_256p.onnx \
--network psp \
--platform onnx \
--align \
--images_path ./test_images

openvino

python scripts/test.py \
--ckpt_encoder ./art_mobile_encoder_1024p \
--ckpt_decoder ./art_decoder_1024p \
--network e4e \
--platform openvino \
--align \
--images_path ./test_images \
--edit \
--edit_direction ./editings/smile.npy

Convert

torch2onnx

function can find in tools/torch2onnx.py

onnx2openvino

Inference Engine version: 2021.4.0-3839-cd81789d294-releases/2021/4 Model Optimizer version: 2021.4.0-3839-cd81789d294-releases/2021/4

python3 mo.py \
--input_model psp_mobile_256p.onnx \
--output_dir ./openvino  \
--data_type FP16 \
--mean_values [127.5,127.5,127.5] \
--scale_values [127.5,127.5,127.5] \
--move_to_preprocess

realworld-stylegan2-encoder's People

Contributors

talkuhulk avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.