Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployed project as PIP Library #5

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Srishti Guleria

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include face_app/*.py
include face_app/*.yml
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# 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". <br>
This repository contains the code for the python project on [“Finding set of faces when combined results in face of person A"](https://iq.opengenus.org/project-on-reconstructing-face/). <br>

**The project has been published as a [pip package](https://pypi.org/project/face-recons/0.0.1/) and can be installed by running ```pip install face-recons==0.0.1``` in terminal.**
<br>

**After successfully installing the package, user can enter python interpreter and enter ```from face_recons import main```. Following it they will enter the Default Mode of the application.**

**The default mode of the application is interactive mode which is user friendly. The other mode is Command Line Interface.**

## Default Mode (Interactive Mode):
The detailed Flow of Code for our Interactive or Default Mode is below :

![flow_chart](https://user-images.githubusercontent.com/61888364/144736192-361c955c-8b2c-4f47-b6cd-1ce5ac78360e.png)

- We start the application by opening the terminal in this folder and typing the command : ```python main.py```
- We start the application by opening the python interpreter and typing the command : ```from face_recons import main```
- The following 5 options are shown in the terminal. Then we would enter the number of the command of our choice between 1-5. :
![image](https://user-images.githubusercontent.com/61888364/144733110-9caf58c2-0590-4ec6-ad54-ebae83dd9516.png)

Expand Down
3 changes: 3 additions & 0 deletions face_recons/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from face_recons import main
from face_recons import train
from face_recons import test
9 changes: 5 additions & 4 deletions main.py → face_recons/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import test
import train
from face_recons import test
from face_recons import train
import argparse


parser = argparse.ArgumentParser(description = "Face Application - Command Line Interface")
parser.add_argument("--mode", default = False, help="Enable Command Line Interface", action='store')
parser.add_argument("--input", type=str, required=False, help="Enter the name of Test image in format: directory/image_name.jpg")
Expand All @@ -15,14 +16,14 @@
except ValueError:
print ("Not a number")
if choice == 1:
train.directory_name = input('Enter the name of directory :\n')
train.directory_name = input('Enter the path of directory :\n')
train.training()
elif choice == 2:
test.print_test()
elif choice == 3:
test.print_eigen()
elif choice == 4:
test.image_file = input('Enter the name of image in format: directory/image_name.jpg\n')
test.image_file = input('Enter the name of image in format: directory_path/.../image_name.jpg\n')
test.recons()
elif choice == 5:
print("Thank you for your visit!")
Expand Down
647,556 changes: 356,158 additions & 291,398 deletions pca_parameters.yml → face_recons/pca_parameters.yml

Large diffs are not rendered by default.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 4 additions & 2 deletions test.py → face_recons/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ def print_test():

def print_eigen():
neutral = []
for i in range(9):
print('Enter path to 7 images below to produce mean face & eigen faces :\n')
for i in range(7):
i+=1
img = im.open(f'sample/00000{i}.jpg').convert('L')
p = input('Enter path to test image ' + str(i) + ' : \n')
img = im.open(p).convert('L')
img = img.resize((58,49), im.ANTIALIAS)
img2 = np.array(img).flatten() # vectorization
neutral.append(img2)
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
Binary file removed sample/000092.jpg
Diff not rendered.
Binary file removed sample/000093.jpg
Diff not rendered.
Binary file removed sample/000094.jpg
Diff not rendered.
Binary file removed sample/000095.jpg
Diff not rendered.
Binary file removed sample/000096.jpg
Diff not rendered.
Binary file removed sample/000097.jpg
Diff not rendered.
Binary file removed sample/000098.jpg
Diff not rendered.
Binary file removed sample/000099.jpg
Diff not rendered.
Binary file removed sample/000100.jpg
Diff not rendered.