Face Reconstruction Applicaton
Project description
Finding set of faces when combined results in face of person A
This repository contains the code for the python project on “Finding set of faces when combined results in face of person A". The default mode of the application is interactive mode which is user friendly. The other mode is Command Line Interface.
Default Mode (Interactive Mode):
We start the application by opening the terminal in this folder and typing the command : python main.py
The following 5 options are shown in the terminal. Then we would enter the number of the command of our choice between 1-5. If we enter 1, the directory for training dataset is asked. Then the model starts to train & following output is generated. If we enter 2, then the full file path to test directory is asked. Then the collage of input/test images are printed as output on terminal. If we enter 3, then the mean face and first five eigen faces get printed on the output window one by one. The mean face is displayed on the output window. Then, all the five eigen faces will be displayed on the output window one by one. If we enter 4, then the trained model is read from pca_parameters.yml.
- Then the eigen vectors held in a structure of eigenVectors where eigen_face[i][j] = j-th eigen face of i-th image are displayed on the terminal as shown below.
- Then we enter the name of folder with image in format: directory/image_name.jpg. The image will be read and vectorized. After that the final results get displayed in new window. The final output window with original image on left and re-constructed image on right as described in the video below.
- It has a slider for increasing or decreasing the number of eigen faces used for reconstruction. By trying all combinations, we can dynamically see the best reconstructed image.
- The reconstructed image dynamically changes with respect to the number of eigen faces chosen on slider.
- The percentage of Eigen Faces used for reconstructing output image is dynamically printed on the terminal as we move the slider.
Finally to exit the terminal we must enter 5. If we enter any other value than 1 to 5 then "invalid mode" output will be displayed.
Mode 1 (Command Line Interface)
If we wish to use the Command Line Interface, we can do so by typing the following command :
python main.py --mode 1 --input directory/image.jpg --dataset directory
We can enter mode = 1 for CLI mode, the directory/../image.jpg for the Test Image and the directory for the Training Dataset. For example, if we entered test/300000.jpg for Test Image and sample2 for Training Dataset. The model is trained from the pca_parameters.yml and the Test Image is reconstructed. The percentage of Eigen Faces used to reconstruct the output image is dynamically printed on terminal as we slide the slider.
Same Output Window of Reconstructed Image is displayed in CLI mode as seen in Interactive Mode.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file face_recons-0.0.1.tar.gz
.
File metadata
- Download URL: face_recons-0.0.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa7347618d7ad38d630aaa5d0b04445426682daf82369b886fc9725700f434c7 |
|
MD5 | 9cfd195e27c429065ca4ddc63efa02a7 |
|
BLAKE2b-256 | f21872d696d6982e4d2dfe22fba16b3eb09ee1d8f8537f821058208d9f0df76b |
File details
Details for the file face_recons-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: face_recons-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e1f6299041ca8820564fee9a5a44e542accb750bf585fdd39d5863fd6f19638 |
|
MD5 | fae99a8c5d7f07b96929b081d6dfd27f |
|
BLAKE2b-256 | 02c0203582acf34b5462c9120dba6c8b144fd0735867a0cd4337fa51936ab205 |