Unblur and Restore any human face using DFDNet
Discover DFDNet , a new solution to unblur , restore and upscale almost any human face using the power of artificial intelligence and machine learning.
In this guide we will discover together a new amazing solution to de-blur and restore almost any human face using DFDNet open source project code.
DFDNet is an AI program created in python language to solve and reconstruct or restoring human faces using a pre-trained intelligent application that is relying on 16 dictionaries containing a huge data base of high quality images and multi-scale facial Components like eyes , noses and mouthes to recompose almost any human face.
How to install and test DFDNet on Windows 7 or Later
First watch the DFDNet installation tutorial then continue reading the article to download the necessary installation files.
Unblur and restore any human face using DFDNet
To install and test DFDNet on your Windows Pc it’s easy but first make sure you have at least 6 GB of available memory on your computer to run the code without any errors.
First of all you need to take a look at the source code page here :
https://github.com/csxmli2016/DFDNet to read more and understand how the project works, also getting an idea about its license , DFDNet is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. http://creativecommons.org/licenses/by-nc-sa/4.0/
To make things easier for you i’ve collected both the “Source Code” and the “Pre-train Models and dictionaries” in one Zip Folder Here :
Please Note : before downloading any file on this article notice that all the softwares , applications , or and the DFDNet open source code it self are the property of their respective owners , Don’t modify , edit , sell , or recompile any software applications or codes until you visit the original rights owners or developers and have their full permissions , all the files hosted here in this post are shared for educational and testing purposes and to preserve the necessary installation environment to test DFDNet.
After downloading the DFDNet.zip file , extract the compressed folder to your ( C:\ ) drive root.
Now to run the source code on your windows computer i’ve already prepared and compiled the necessary python environment to save you time and making it easier for you , so that you will only need to download and install Anaconda then activate the necessary DFDNet environment from the “Anaconda Prompt“.
So first download and install Anaconda From Here :
Note: During the Anaconda setup set the “install option” to “just me ( recommended )” and then set the destination folder for the installation to the following path : C:\Users\”Your User Name”\Anaconda2
then leave all the other settings that follows during the installation as is and proceed.
after downloading and installing Anaconda properly on your computer now you should download the ready Environment and the .cache folders
Download the ready to use Environment Here :
Download the .cache folder here
Extract the ready env.zip file , then open the extracted folder and then copy or cut the testDFDNet folder and paste it inside your Anaconda installation folder in the “envs” folder exactly in this path C:\Users\”Your User Name”\Anaconda2\envs\
Also don’t forget to extract the cache.zip file and open the extracted .cache folder then you will find another .cache folder inside it copy it and paste it in your actual user folder exactly in this path C:\Users\”Your User Name”\ “the same directory in where we’ve installed Anaconda”.
Now you are almost done and ready to run and test DFDNet on your PC.
Running DFDNet source code
1- Before you can run DFDNet first you need to put the photos you want to restore or unblur in the following path ( “C:\DFDNet\DFDNet-whole\TestData\TestWhole” ) this is the default folder for the input images.
2 – After done all the previous steps correctly go to your Start Menu from the bottom bar and run the Anaconda Prompt.
3 – in the Anaconda Prompt black screen type in or copy\paste the following command “conda activate testDFDNet” then hit Enter on your keyboard, this will activate the ready necessary environment for DFDNet.
4 – Now type in the following command to go to the project folder “cd C:\DFDNet\DFDNet-whole” then hit Enter on the keyboard.
5 – to start the image processing task type in or copy\paste this full command line in your Anaconda Prompt screen:
python test_FaceDict.py –test_path ./TestData/TestWhole –results_dir ./Results/TestWholeResults –upscale_factor 4 –gpu_ids -1
Note : This process may take a little while 1 to 5 minutes for each photo it depends on your computer cpu speed.
6 – Finally find the result processed images in this path : C:\DFDNet\DFDNet-whole\Results\TestWholeResults\Step4_FinalResults\
if for any reasons you got error messages or failed to run DFDNet with the Environment that i’ve made, then maybe you need to go through the whole installation method which is described in the following YouTube video :
Before watching the complete DFDNet installation tutorial you will need to Download ” VISUAL STUDIO ” and ” Cmake ” to compile and install the DFDNet Environment from scratch, so i wanted to make your life easier here are both installers so that you can follow along with the tutorial in a velvet glove.
DFDNet Installation Tutorial
Please make sure you follow our pages on pinterest and facebook as well subscribe to our youtube channel to get informed each time we post new articles and tutorials.hdesigntutorials