{"id":21802536,"url":"https://github.com/qengineering/gfpgan-ncnn-raspberry-pi-4","last_synced_at":"2025-10-07T23:30:37.166Z","repository":{"id":112946255,"uuid":"585123663","full_name":"Qengineering/GFPGAN-ncnn-Raspberry-Pi-4","owner":"Qengineering","description":"GFPGAN face reconstruction with  ncnn on a bare Raspberry Pi","archived":false,"fork":false,"pushed_at":"2023-01-04T12:18:41.000Z","size":1029,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-27T11:36:26.765Z","etag":null,"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"],"latest_commit_sha":null,"homepage":"https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Qengineering.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-04T11:30:51.000Z","updated_at":"2024-08-07T12:35:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"67d207ff-2e4a-45ed-a334-e39fee2c807a","html_url":"https://github.com/Qengineering/GFPGAN-ncnn-Raspberry-Pi-4","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qengineering%2FGFPGAN-ncnn-Raspberry-Pi-4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qengineering%2FGFPGAN-ncnn-Raspberry-Pi-4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qengineering%2FGFPGAN-ncnn-Raspberry-Pi-4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qengineering%2FGFPGAN-ncnn-Raspberry-Pi-4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Qengineering","download_url":"https://codeload.github.com/Qengineering/GFPGAN-ncnn-Raspberry-Pi-4/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235661843,"owners_count":19025607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["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"],"created_at":"2024-11-27T11:29:21.906Z","updated_at":"2025-10-07T23:30:31.551Z","avatar_url":"https://github.com/Qengineering.png","language":"C++","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=CPZTM5BB3FCYL"],"categories":[],"sub_categories":[],"readme":"# GFPGAN Raspberry Pi 4\n![output image]( https://qengineering.eu/github/ManGAN.webp )\n## Face reconstruction with the ncnn framework. \u003cbr/\u003e\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\u003cbr/\u003e\u003cbr/\u003e\nPaper: https://arxiv.org/pdf/2101.04061.pdf\u003cbr/\u003e\u003cbr/\u003e\nSpecial 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)\n\n------------\n\n## Dependencies.\nTo run the application, you have to:\n- 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) \u003cbr/\u003e\n- The latest version of Tencent ncnn framework installed. [Install ncnn](https://qengineering.eu/install-ncnn-on-raspberry-pi-4.html) \u003cbr/\u003e\n- OpenCV 64 bit installed. [Install OpenCV 4.5](https://qengineering.eu/install-opencv-4.5-on-raspberry-64-os.html) \u003cbr/\u003e\n- Code::Blocks installed. (```$ sudo apt-get install codeblocks```)\n- :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). \n\n------------\n\n## Installing the app.\nTo extract and run the network in Code::Blocks \u003cbr/\u003e\n$ mkdir *MyDir* \u003cbr/\u003e\n$ cd *MyDir* \u003cbr/\u003e\n$ wget https://github.com/Qengineering/GFPGAN-ncnn-Raspberry-Pi-4/archive/refs/heads/main.zip \u003cbr/\u003e\n$ unzip -j master.zip \u003cbr/\u003e\nRemove master.zip, LICENSE and README.md as they are no longer needed. \u003cbr/\u003e \n$ rm master.zip \u003cbr/\u003e\n$ rm LICENSE \u003cbr/\u003e\n$ rm README.md \u003cbr/\u003e \u003cbr/\u003e\nYour *MyDir* folder must now look like this: \u003cbr/\u003e \n```\n.\n├── Duo.png\n├── Girl.jpg\n├── Julia.jpg\n├── Man.png\n├── GFPGAN.cbp\n├── include\n│   ├── face.h\n│   ├── gfpgan.h\n│   └── realesrgan.h\n├── models\n│   ├── encoder.bin\n│   ├── encoder.param\n│   ├── real_esrgan.bin\n│   ├── real_esrgan.param\n│   ├── style.bin\n│   ├── yolov5-blazeface.bin\n│   └── yolov5-blazeface.param\n└── src\n    ├── face.cpp\n    ├── gfpgan.cpp\n    ├── main.cpp\n    └── realesrgan.cpp\n```\n------------\n\n## Running the app.\nTo 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).\u003cbr/\u003e\u003cbr/\u003e\nIn 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.\u003cbr\u003e\u003cbr\u003e\nFor best results, do not use jpeg compressed images. Strong jpeg compression generates typical artefacts to which the super-resolution algorithm does not respond well.\u003cbr/\u003e\u003cbr/\u003e\n![output image]( https://qengineering.eu/github/JuliaGAN.webp )\n_(colorization done by https://github.com/Qengineering/ncnn-Colorization_Raspberry-Pi-4)_\u003cbr\u003e\u003cbr\u003e\n![output image]( https://qengineering.eu/github/GirlGAN.webp )\u003cbr\u003e\u003cbr\u003e\n![output image]( https://qengineering.eu/github/DuoGAN.webp )\n\n\n------------\n\n### Thanks.\nA more than special thanks to [***FeiGeChuanShu***](https://github.com/FeiGeChuanShu), who adapted the ncnn framework for this app.\u003cbr\u003e\n\n------------\n\n### More info.\nColorful Image Colorization [FeiGeChuanShu](https://github.com/FeiGeChuanShu/GFPGAN-ncnn)\u003cbr\u003e\nColorful Image Colorization [Project Page](https://xinntao.github.io/projects/gfpgan) by Xintao Wang, Yu Li, Honglun Zhang, Ying Shan.\n\n------------\n\n[![paypal](https://qengineering.eu/images/TipJarSmall4.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=CPZTM5BB3FCYL) \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqengineering%2Fgfpgan-ncnn-raspberry-pi-4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqengineering%2Fgfpgan-ncnn-raspberry-pi-4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqengineering%2Fgfpgan-ncnn-raspberry-pi-4/lists"}