diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d299fc19b..273a41471 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [3.8, 3.9, "3.10"] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/Dockerfile b/Dockerfile index d8171fc6a..8f889db18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # This is a sample Dockerfile you can modify to deploy your own app based on face_recognition -FROM python:3.6-slim-stretch +FROM python:3.10.3-slim-bullseye RUN apt-get -y update RUN apt-get install -y --fix-missing \ @@ -46,5 +46,7 @@ RUN cd /root/face_recognition && \ pip3 install -r requirements.txt && \ python3 setup.py install +# Add pip3 install opencv-python==4.1.2.30 if you want to run the live webcam examples + CMD cd /root/face_recognition/examples && \ python3 recognize_faces_in_pictures.py diff --git a/LICENSE b/LICENSE index 696d0ce72..6e055ca1e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ MIT License -Copyright (c) 2017, Adam Geitgey +Copyright (c) 2021, Adam Geitgey 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: diff --git a/README.md b/README.md index 23ac8647d..2b198de18 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ the world's simplest face recognition library. Built using [dlib](http://dlib.net/)'s state-of-the-art face recognition built with deep learning. The model has an accuracy of 99.38% on the -[Labeled Faces in the Wild](http://vis-www.cs.umass.edu/lfw/) benchmark. +Labeled Faces in the Wild benchmark (see the [LFW paper (PDF)](https://people.cs.umass.edu/~elm/papers/lfw.pdf)). This also provides a simple `face_recognition` command line tool that lets you do face recognition on a folder of images from the command line! diff --git a/examples/facerec_from_webcam_faster.py b/examples/facerec_from_webcam_faster.py index 7428da14c..e4a7bbd47 100644 --- a/examples/facerec_from_webcam_faster.py +++ b/examples/facerec_from_webcam_faster.py @@ -42,14 +42,14 @@ # Grab a single frame of video ret, frame = video_capture.read() - # Resize frame of video to 1/4 size for faster face recognition processing - small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25) - - # Convert the image from BGR color (which OpenCV uses) to RGB color (which face_recognition uses) - rgb_small_frame = small_frame[:, :, ::-1] - # Only process every other frame of video to save time if process_this_frame: + # Resize frame of video to 1/4 size for faster face recognition processing + small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25) + + # Convert the image from BGR color (which OpenCV uses) to RGB color (which face_recognition uses) + rgb_small_frame = small_frame[:, :, ::-1] + # Find all the faces and face encodings in the current frame of video face_locations = face_recognition.face_locations(rgb_small_frame) face_encodings = face_recognition.face_encodings(rgb_small_frame, face_locations) diff --git a/examples/facerec_ipcamera_knn.py b/examples/facerec_ipcamera_knn.py index ae9223416..55623ed8f 100644 --- a/examples/facerec_ipcamera_knn.py +++ b/examples/facerec_ipcamera_knn.py @@ -209,6 +209,6 @@ def show_prediction_labels_on_image(frame, predictions): frame = show_prediction_labels_on_image(frame, predictions) cv2.imshow('camera', frame) if ord('q') == cv2.waitKey(10): - cap1.release() + cap.release() cv2.destroyAllWindows() exit(0) diff --git a/requirements_dev.txt b/requirements_dev.txt index 16ff43196..638e2b36d 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,4 +1,4 @@ -pip==19.2 +pip==21.1 bumpversion==0.5.3 wheel==0.29.0 watchdog==0.8.3 diff --git a/setup.py b/setup.py index aa1233a0a..63b2bb35a 100644 --- a/setup.py +++ b/setup.py @@ -57,6 +57,7 @@ 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', ], test_suite='tests', tests_require=test_requirements