Skip to content

iwatake2222/aiine_transform

Repository files navigation

demo.mp4

Aiine Transform (アイン変換)

Swapping face using FaceMesh. (could be used to unveil masked faces)

00_doc/demo_00.jpg 00_doc/demo_03.jpg

Tested Environment

Computer

  • Windows 10 (x64) + Visual Studio 2019
    • Intel Core i7-6700 @ 3.4GHz
  • It's not tested, but this project should run on Linux (x64, aarch64)

Deep Learning Inference Framework

  • TensorFlow Lite with XNNPACK delegate

How to Build and Run

Requirements

  • OpenCV 4.x
  • CMake

Download

  • Get source code
    • If you use Windows, you can use Git Bash
    git clone https://github.com/iwatake2222/aiine_transform.git
    cd aiine_transform
    git submodule update --init --recursive --recommend-shallow --depth 1
    cd inference_helper/third_party/tensorflow
    chmod +x tensorflow/lite/tools/make/download_dependencies.sh
    tensorflow/lite/tools/make/download_dependencies.sh
  • Download prebuilt library

Windows (Visual Studio)

  • Configure and Generate a new project using cmake-gui for Visual Studio 2019 64-bit
    • Where is the source code : path-to-cloned-folder
    • Where to build the binaries : path-to-build (any)
  • Open main.sln
  • Set main project as a startup project, then build and run!
  • Note:
    • Running with Debug causes exception, so use Release or RelWithDebInfo if you use TensorFlow Lite
    • You may need to modify cmake setting for TensorRT for your environment

Linux

mkdir build && cd build
cmake ..
make
./main

Usage

./main [input]
 - input:
    - use the default image file set in source code (main.cpp): blank
        - ./main
     - use video file: *.mp4, *.avi, *.webm
        - ./main test.mp4
     - use image file: *.jpg, *.png, *.bmp
        - ./main test.jpg
    - use camera: number (e.g. 0, 1, 2, ...)
        - ./main 0
    - use camera via gstreamer on Jetson: jetson
        - ./main jetson

Control

  • '0' key: Change masking mode
  • '1' key: Switch main image
  • 'f' key: Capture face image
  • 'g' key: Read face image

Model Information

Details

License

  • Copyright 2021 iwatake2222
  • Licensed under the Apache License, Version 2.0

Acknowledgements

I utilized the following OSS in this project. I appreciate your great works, thank you very much.

Code, Library

Model

Special thanks

Image Files

About

Swapping face using Face Mesh with TensorFlow Lite

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published