Vision Made Easy
This project aims to remove a lot of the complexity of dealing with the Open CV for beginner level programmers to experiment with face detection and recognition.
This project has been initially developed for use within my own classes that I teach but I hope it might find use for others too.
PROJECT HOME
INSTALL
pip install visionmadeeasy
To successfully run the demo, you will also have to...
- Download a cascade file such as
haarcascade_frontalface_default.xmlfrom https://github.com/opencv/opencv/tree/master/data/haarcascades and save it into your project folder - Create a sub-folder called "datasets" in your project folder. This is where it will store your training photos.
- Make sure you have a web camera attached :-)
DEMO CODE
import visionmadeeasy
def i_see_a_face( location, img ):
print(f"I see a face!!! It is at {location['x']},{location['y']}")
return True # must return True to keep the loop alive
def i_recognise_a_face( location, person_name, confidence, img ):
print(f"Hello {person_name}! I am {confidence}% sure it is you :-)")
return True # must return True to keep the loop alive
if __name__ == "__main__":
vme = visionmadeeasy.VisionMadeEasy(0, "dataset")
quit = False
while not quit:
print("Demonstration time! Menu of options...")
print("1. Detect faces")
print("2. Record faces")
print("3. Train for faces recorded")
print("4. Recognise faces (must do training first)")
print("5. Exit")
choice = int(input("Enter your option (1 to 5):"))
if choice == 1:
print("[face_vision] Task: Searching for faces.\nLook at the camera! (press ESC to quit)")
# Demo of detecting faces
vme.detect_face(i_see_a_face)
elif choice == 2:
print("About to save 50 images of different angles etc of a person, saving to folder ./dataset")
id = int(input("Enter unique person number: "))
n = input("Enter person name: ")
print("Smile! :-)")
# Demo of recording faces
vme.record_face_dataset(images_to_record=50, interval=1, person_identifier=id, person_name=n)
elif choice == 3:
print("[face_vision] Task: Training... please wait...")
# Demo of training faces
vme.train_from_faces()
elif choice == 4:
print("[face_vision] Task: Searching for faces I recognise.\nLook at the camera! (press ESC to quit)")
# Demo of recognising faces
vme.recognise_face(i_recognise_a_face)
elif choice == 5:
quit = True
print("Goodbye!")
AUTHOR
LICENSE
MIT License (C) 2019 Paul Baumgarten
Metadata
Release files for visionmadeeasy 2019.2.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| visionmadeeasy-2019.2.17.tar.gz | 7.3 kB | Without provenance | Details for visionmadeeasy-2019.2.17.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| visionmadeeasy-2019.2.17-py3-none-any.whl | Python 3 | none | any | Details for visionmadeeasy-2019.2.17-py3-none-any.whl |
Total release size: 15.1 kB
Release files / visionmadeeasy-2019.2.17.tar.gz
| Download URL | visionmadeeasy-2019.2.17.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f24e484dcaef7fb2875aea847ceea021b2feeb1276d3fd8a0c337113128832d
|
|
BLAKE2b-256 checksum How to use checksums |
4827dfddcd176b6b646fa1dcdecd7908b8cb18096e5ce59b587858b4df3f4b75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0
|
Release files / visionmadeeasy-2019.2.17-py3-none-any.whl
| Download URL | visionmadeeasy-2019.2.17-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88402a1d3fd8b68c4ffaaa3355c8f328fde733c66f63eec17bd055762ea1b9d6
|
|
BLAKE2b-256 checksum How to use checksums |
cda792ca1bff6f8d2e170978358360a1686a920e62778d63441ebf49f59f034d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0
|
Security for visionmadeeasy 2019.2.17
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.