Skip to content

[WIP] NCNN with Vulkan implementation of GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration

License

Notifications You must be signed in to change notification settings

onuralpszr/GFPGAN-ncnn-vulkan

Repository files navigation

GFPGAN-ncnn-vulkan 🚀

Windows Dev Build Ubuntu Dev Build Fedora Dev Build (RPM Vulkan) Fedora Dev Build (Lunar Vulkan SDK) pre-commit.ci status GitHub Open issue Closed issue GitHub pull requests cpp Github All Releases

Ncnn with Vulkan implementation of GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration

This repository contains the code and pre-trained models for a real-world face restoration algorithm based on the GFPGAN method and optimized for mobile devices using the NCNN framework with a Vulkan backend.

The goal of this project is to develop practical algorithms that can restore the appearance of damaged or low-quality face images, such as those obtained from security cameras, old photographs, or social media profiles. The proposed approach combines the power of deep learning with the speed and efficiency of hardware acceleration, making it suitable for real-time applications on smartphones, drones, or robots.

Get Submodules

Make sure submodules are initialized and updated

git submodule update --init --recursive

Clone project with Submodules

git clone --recursive https://github.com/onuralpszr/GFPGAN-ncnn-vulkan.git

Project Prerequisites ⚙️

  • CMake version 3.20 or later
  • C++17 or above with filesystem support
  • Clang-Tidy for code analysis (optional)
  • Threads library
  • Vulkan SDK
  • glslangValidator executable
  • OpenCV library
  • OpenMP library
  • ncnn library
  • libwebp library

Building 🛠️

Configure and build

mkdir -p build && cd build
cmake ..
cmake --build . --parallel $(($(nproc) - 1))

🚧 Model support 🚧

  1. GFPGANCleanv1-NoCE-C2

TODO: 📑

  • Support ncnn-vulkan
  • Convert pth->onnx->ncnn
  • Model with colorization

References

  1. https://github.com/xinntao/Real-ESRGAN
  2. https://github.com/TencentARC/GFPGAN
  3. https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan
  4. https://github.com/Tencent/ncnn
  5. https://github.com/Tencent/ncnn/tree/master/tools/pnnx
  6. https://github.com/pnnx/pnnx
  7. https://github.com/deepcam-cn/yolov5-face
  8. https://github.com/derronqi/yolov7-face
  9. https://github.com/derronqi/yolov8-face
  10. https://github.com/FeiGeChuanShu/GFPGAN-ncnn
  11. https://github.com/ultralytics/ultralytics

Download Model files (GFPGAN-ncnn model files)

Models-v0.0.1

https://github.com/onuralpszr/GFPGAN-ncnn-vulkan/releases/download/v0.0.1-models/GFPGAN-ncnn-models.zip