Skip to main content

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.

Metadata

Release files for face-recons 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for face-recons 0.0.1
File Size Uploaded
face_recons-0.0.1.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for face-recons 0.0.1
File Interpreter ABI Platform
face_recons-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.0 kB

Release files / face_recons-0.0.1.tar.gz

Download URL face_recons-0.0.1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
aa7347618d7ad38d630aaa5d0b04445426682daf82369b886fc9725700f434c7
BLAKE2b-256 checksum
How to use checksums
f21872d696d6982e4d2dfe22fba16b3eb09ee1d8f8537f821058208d9f0df76b
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / face_recons-0.0.1-py3-none-any.whl

Download URL face_recons-0.0.1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e1f6299041ca8820564fee9a5a44e542accb750bf585fdd39d5863fd6f19638
BLAKE2b-256 checksum
How to use checksums
02c0203582acf34b5462c9120dba6c8b144fd0735867a0cd4337fa51936ab205
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page