This repository has been archived by the owner on Dec 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from LimaoC/mitch-pi-ml-test
Scripts for testing face rec and posture on rpi
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import argparse | ||
import logging | ||
|
||
import cv2 | ||
|
||
from models.face_recognition.recognition import get_face_match | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("image_path") | ||
args = parser.parse_args() | ||
logger.debug("Reading image") | ||
face = cv2.imread(args.image_path) | ||
logger.debug("Checking for a match") | ||
matched_id = get_face_match(face) | ||
|
||
logger.debug("Matched user %d", matched_id) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |