Skip to content

Kazuhito00/AnimeGANv2-Face-Overlay-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnimeGANv2-Face-Overlay-Demo


PyTorch Implementation of AnimeGANv2を用いて、生成した顔画像を元の画像に上書きするデモです。

Requirement

  • mediapipe 0.8.9 or later
  • OpenCV 4.5.3.56 or later
  • onnxruntime-gpu 1.9.0 or later
    ※onnxruntimeでも動作しますが、推論時間がかかるのでGPUをお勧めします

処理速度参考値

GeForce GTX 1050 Ti:約3.3fps
GeForce RTX 3060:約9fps

Demo

デモの実行方法は以下です。

python main.py
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --movie
    動画ファイルの指定 ※指定時はカメラデバイスより優先
    デフォルト:指定なし
  • --width
    カメラキャプチャ時の横幅
    デフォルト:960
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:540
  • --fd_model_selection
    顔検出モデル選択(0:2m以内の検出に最適なモデル、1:5m以内の検出に最適なモデル)
    デフォルト:model/face_paint_512_v2_0.onnx
  • --min_detection_confidence
    顔検出信頼値の閾値
    デフォルト:0.5
  • --animegan_model
    AnimeGANv2のモデル格納パス
    デフォルト:model/face_paint_512_v2_0.onnx
  • --animegan_input_size
    AnimeGANv2のモデルの入力サイズ
    デフォルト:512
  • --ss_model_selection
    モデル種類指定
    0:Generalモデル(256x256x1 出力)
    1:Landscapeモデル(144x256x1 出力)
    デフォルト:0
  • --ss_score_th
    スコア閾値(閾値以上:人間、閾値未満:背景)
    デフォルト:0.1
  • --debug
    デバッグウィンドウを表示するか否か
    デフォルト:指定なし
  • --debug_subwindow_ratio
    デバッグウィンドウの拡大率
    デフォルト:0.5

※デバッグ表示有効時は以下のようなウィンドウを表示

Reference

Author

高橋かずひと(https://twitter.com/KzhtTkhs)

License

AnimeGANv2-Face-Overlay-Demo is under MIT License.

About

「PyTorch Implementation of AnimeGANv2」を用いて、生成した顔画像を元の画像に上書きするデモ

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages