Skip to content
This repository was archived by the owner on Dec 8, 2024. It is now read-only.

Base migration changes to face_recognition package #66

Merged
merged 12 commits into from
Oct 2, 2024

Conversation

MitchellJC
Copy link
Collaborator

@MitchellJC MitchellJC commented Oct 1, 2024

Trying to pull this into another temp branch directly off main.

@MitchellJC MitchellJC requested a review from LimaoC October 1, 2024 08:12
@MitchellJC MitchellJC self-assigned this Oct 1, 2024
Copy link
Owner

@LimaoC LimaoC left a comment

Choose a reason for hiding this comment

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

lgtm

@MitchellJC MitchellJC requested a review from LimaoC October 1, 2024 13:28
Copy link
Owner

@LimaoC LimaoC left a comment

Choose a reason for hiding this comment

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

lgtm

choice = input("(r)egister or (l)ogin: ")

if choice == "r":
faces = []
user_id = int(input("Enter user id: "))
for i in range(5):
input(f"Enter to register a face ({i+1}): ")
frame = take_snapshot()
Copy link
Owner

Choose a reason for hiding this comment

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

There's one caveat with capturer.get_frame() if it's the OpenCVCapturer, it gets the next frame from the buffer instead of taking a snapshot at the time when an input is given. This was a bit easier for testing since I could experiment with taking different photo angles etc.

Ultimately this doesn't really matter since we're not using that on the Pi anyway but that's why I made a new take_snapshot() function specifically for this script

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ohh okay I see good catch. I have restored take_snapshot now

@@ -20,6 +20,7 @@ tensorflow-io-gcs-filesystem = "0.27.0"
tf-keras = "^2.17.0"
h5py = "3.10.0"
rpi-gpio = "^0.7.1"
face-recognition = "^1.3.0"
Copy link
Owner

Choose a reason for hiding this comment

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

Once we're happy with face-recognition, I think we should remove deepface as well (iirc it's keeping back some of the other packages). This would be a big change though so we should make sure stuff still works when we do that

Opencv only takes next frame in buffer not most recent so we need to reset device each snapshot
@MitchellJC MitchellJC merged commit 190066c into dlib_migration Oct 2, 2024
2 checks passed
@MitchellJC MitchellJC deleted the mitch-base-migration branch October 2, 2024 01:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants