Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qengineering/gfpgan-ncnn-raspberry-pi-4
GFPGAN face reconstruction with ncnn on a bare Raspberry Pi
https://github.com/qengineering/gfpgan-ncnn-raspberry-pi-4
cpp deep-learning face-recognition-application face-reconstruction gan gfpgan image-restoration ncnn ncnn-framework ncnn-model raspberry-pi raspberry-pi-4 raspberry-pi-64-os super-resoluion
Last synced: 7 days ago
JSON representation
GFPGAN face reconstruction with ncnn on a bare Raspberry Pi
- Host: GitHub
- URL: https://github.com/qengineering/gfpgan-ncnn-raspberry-pi-4
- Owner: Qengineering
- License: bsd-3-clause
- Created: 2023-01-04T11:30:51.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-04T12:18:41.000Z (about 2 years ago)
- Last Synced: 2024-11-27T11:36:26.765Z (2 months ago)
- Topics: cpp, deep-learning, face-recognition-application, face-reconstruction, gan, gfpgan, image-restoration, ncnn, ncnn-framework, ncnn-model, raspberry-pi, raspberry-pi-4, raspberry-pi-64-os, super-resoluion
- Language: C++
- Homepage: https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html
- Size: 1000 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GFPGAN Raspberry Pi 4
![output image]( https://qengineering.eu/github/ManGAN.webp )
## Face reconstruction with the ncnn framework.
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
Paper: https://arxiv.org/pdf/2101.04061.pdf
Special made for a bare Raspberry Pi 4, see [Q-engineering deep learning examples](https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html)------------
## Dependencies.
To run the application, you have to:
- A raspberry Pi 4 with a 32 or 64-bit operating system. It can be the Raspberry 64-bit OS, or Ubuntu 18.04 / 20.04. [Install 64-bit OS](https://qengineering.eu/install-raspberry-64-os.html)
- The latest version of Tencent ncnn framework installed. [Install ncnn](https://qengineering.eu/install-ncnn-on-raspberry-pi-4.html)
- OpenCV 64 bit installed. [Install OpenCV 4.5](https://qengineering.eu/install-opencv-4.5-on-raspberry-64-os.html)
- Code::Blocks installed. (```$ sudo apt-get install codeblocks```)
- :point_right: Download and unzip the deep learning models `gfpgan-ncnn-20221225T122514Z-001.zip` file from [Gdrive](https://drive.google.com/file/d/1Lfs2fBU1ecaIKiQtMTaZW4q099PgPpA9/view?usp=share_link).------------
## Installing the app.
To extract and run the network in Code::Blocks
$ mkdir *MyDir*
$ cd *MyDir*
$ wget https://github.com/Qengineering/GFPGAN-ncnn-Raspberry-Pi-4/archive/refs/heads/main.zip
$ unzip -j master.zip
Remove master.zip, LICENSE and README.md as they are no longer needed.
$ rm master.zip
$ rm LICENSE
$ rm README.md
Your *MyDir* folder must now look like this:
```
.
├── Duo.png
├── Girl.jpg
├── Julia.jpg
├── Man.png
├── GFPGAN.cbp
├── include
│ ├── face.h
│ ├── gfpgan.h
│ └── realesrgan.h
├── models
│ ├── encoder.bin
│ ├── encoder.param
│ ├── real_esrgan.bin
│ ├── real_esrgan.param
│ ├── style.bin
│ ├── yolov5-blazeface.bin
│ └── yolov5-blazeface.param
└── src
├── face.cpp
├── gfpgan.cpp
├── main.cpp
└── realesrgan.cpp
```
------------## Running the app.
To run the application, load the GFPGAN.cbp project file into Code::Blocks. More information? Follow the instructions at [Hands-On](https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html#HandsOn).
In main.cpp, you have two branches: one for images with only one face (Girl.jpg) and another for scenes with more faces (Duo.png). The software determines which branch to follow. Especially the second branch, the one with the reconstruction of the whole scene, can take quite a long time. Mostly more than a few minutes.
For best results, do not use jpeg compressed images. Strong jpeg compression generates typical artefacts to which the super-resolution algorithm does not respond well.
![output image]( https://qengineering.eu/github/JuliaGAN.webp )
_(colorization done by https://github.com/Qengineering/ncnn-Colorization_Raspberry-Pi-4)_
![output image]( https://qengineering.eu/github/GirlGAN.webp )
![output image]( https://qengineering.eu/github/DuoGAN.webp )------------
### Thanks.
A more than special thanks to [***FeiGeChuanShu***](https://github.com/FeiGeChuanShu), who adapted the ncnn framework for this app.------------
### More info.
Colorful Image Colorization [FeiGeChuanShu](https://github.com/FeiGeChuanShu/GFPGAN-ncnn)
Colorful Image Colorization [Project Page](https://xinntao.github.io/projects/gfpgan) by Xintao Wang, Yu Li, Honglun Zhang, Ying Shan.------------
[![paypal](https://qengineering.eu/images/TipJarSmall4.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CPZTM5BB3FCYL)