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

Fixed minor bugs in PyFry.py, Added basic gui made with tkinter #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gnany07
Copy link

@gnany07 gnany07 commented Oct 27, 2019

Fixed
If we give different image other than test.jpg, the flares are not drawn properly #14
Unable to open assets\shape_predictor_68_face_landmarks.dat #13

Description

For addressing issue 13, I have made sure we give absolute path instead of relative path.
This is should make sure we don't get any runtime errors of opening .dat file.

For addressing issue 14, We have hardcoded the image 'test.jpg' in the addFlare function
for any input image. I have stored img in 'temp.jpg' in the main and used 'temp.jpg'
in addFlare function.
I have tested all three images (test1,test2,meme1) all three gives expected output.

Fixes # (issue)
13 and 14

Type of change

  • Bug fix (non-breaking change which fixes an issue)

This is my first PR ,feel free to give comments and correct me.

Added a basic gui using tkinter in python,made relevant changes to hit proper functions
removed debug print statements
@gnany07 gnany07 changed the title Fixed minor bugs in PyFry.py Fixed minor bugs in PyFry.py, Added basic gui made with tkinter Oct 29, 2019
#Finding the center point of the eye using the average outer extremes average of the eyes
mid = (eye[0] +eye[3])/2
# Finding the center point of the eye using the average outer extremes average of the eyes
mid = (eye[0] + eye[3])/2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't make aesthetic changes to the working code. It creates more diffs and takes extra time to review.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi ionicc, Actually While adding my changes somewhere I got indentation error.
I tried to fix it but couldn't, then copy-pasted whole content in sublime-text and fixed indentation and put that back.

So,these kind of changes came in. 😃 😄
I didn't check that much while commiting.
Will take care of these changes and raise a new PR.

img = img.resize((int(w ** .90), int(h ** .90)), resample = Image.BILINEAR)
img = img.resize((int(w ** .90), int(h ** .90)), resample = Image.BICUBIC)
img = img.resize((w,h), resample = Image.BICUBIC)
img = img.resize((int(w ** .90), int(h ** .90)), resample=Image.BILINEAR)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see you have made a lot of spaces and changes to already working code, Not that it does any harm. I would suggest not to touch the working part of code unless raised in open source projects 😄

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah,got it.

def addFlare(img):
''' Initialising dlib for frontal facial features '''
flare = Image.open('flare.png')
detect = dlib.get_frontal_face_detector()
predict = dlib.shape_predictor("assets\shape_predictor_68_face_landmarks.dat")
face_landmarks_file = "assets/shape_predictor_68_face_landmarks.dat"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can add a dynamic addition of the face_landmarks_file from the GUI, That'll be clean 👍

Copy link
Member

@ionicc ionicc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left some comments and please add a screenshot of the GUI as a comment in the PR.

@ionicc
Copy link
Member

ionicc commented Oct 30, 2019

My bad, I hadn't noticed the Screenshot already given. Looks clean 😄. How bout adding a file picker as mentioned above for face_landmarks_file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants