FaceD
- A program for basic frontal face detection using Pillow and OpenCV.
✍️ Introduction
- A package inspired by UMich Coursera's Python Specialization.
{FaceD}is simply a package that will take in a zip file of images in any format (.JPG or .PNG) and attempt to detect faces. This will crop the faces and return them to a canvas. Try out the package using the data sample zip files provided with the package.- This package is highly experimental and might be totally useless for some people.
- Hope this helps someone as much as it helped me in mastering python.
⏬ Installation
- See below for installation details.
Install dependencies
Ubuntu
sudo apt install tesseract-ocr
pip install opencv-python-headless #we put work into defining dependencies but for this to work it is mandatory to install the headless version
Windows
winget install --id=UB-Mannheim.TesseractOCR -e
There are a few links to check for tesseract-ocr:
windows_tesseract_ocr Downloads
How install Tesseract — ORC and Pytesseract on Windows
Development version
pip install -i https://test.pypi.org/simple/ faced==0.0.4
PyPi Version
pip install faced
Using faced
import faced
from faced.load_data import *
from faced.cv_utils import *
from faced.main import *
x = load_data('lab.zip')
y = load_lab() #to avoid any issues
faced(x)
faced_keyword(y, "mark") #takes a long time
🛂 Quality Control (QC)
- Utilized inbuilt unit testing to test results vs expectations and everything seems to work just fine. This package right now focuses on learning python and seeing how packaging works in python.
Warning
-
Running this package means you will need your own tesseract engine for text identification. Install it and point your system to the executable.
-
The program also requires an in built classifier and this might or might not work for OS other than windows. I will check on that later but that is all for now.
-
It is confirmed that this package should work on Ubuntu as well so far as you have
opencv-python-headlessand your tesseract engine set then this should work.
Publishing
install build and build
pip install build
python -m build
Install twine and upload to TestPyPi
Before the next steps, you need to setup an account with TestPyPi, and obtain a token.
Next you need to learn how to setup a pypirc file (repo config file) and that will be read by twine in the upload process.
pip install twine #python3 -m pip install --upgrade twine
python -m twine upload --repository testpypi dist/* #the repo name in pypirc is testpypi
Upload to PyPi
If pypirc is well setup then this should go fine.
python -m twine upload --repository pypi dist/* #if repo is blank twine defaults to pypi so works either way
Addon
We are authors of high level packages in R and faced is a gateway into the python world. Very little effort has been put into perfecting the functions here because there are more important projects to work on than tesseract and opencv. I still find time to polish my python and practice publishing as with this update but this is not a main project.
We learn this because some projects might entail in house built python packages so knowing how to package and publish is relevant.
🎇 Epilogue
- Working on CamFaceD which is a dynamic faced platform. CamFaceD can be used to train face detection although on a limited capacity. More to learn on this but steadily making progress and grateful for what I have learned so far.
Metadata
Release files for faced 0.0.8
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 |
|---|---|---|---|---|
| faced-0.0.8.tar.gz | 66.6 MB | Without provenance | Details for faced-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| faced-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for faced-0.0.8-py3-none-any.whl |
Total release size: 133.2 MB
Release files / faced-0.0.8.tar.gz
| Download URL | faced-0.0.8.tar.gz |
|---|---|
| Size | 66.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
837d466e54d9d54368a5a9ed275078f5e6ee05bd9f7018ad5b4ac2dcafd9964e
|
|
BLAKE2b-256 checksum How to use checksums |
694b3c5e32544dfecd7e33bd35cd64a12da1dfcadeea54f23754da2ba346f749
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / faced-0.0.8-py3-none-any.whl
| Download URL | faced-0.0.8-py3-none-any.whl |
|---|---|
| Size | 66.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c87a4f6caba0aa585366463710bab64af46fc68e209f9b3c4bc6c87e96b56c32
|
|
BLAKE2b-256 checksum How to use checksums |
6b8250f72c3fd909b636ef77077dd41c0b2237d1ddbdf59ad6d89ef6664f0742
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for faced 0.0.8
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.