Face Classification package
Project description
VisageSnap
English | 한국어
Recognizes faces and trains models, brings in the pictures and provides identification predictions and face classification. It also performs semi-supervised learning.
Feature
- Recognize faces.
- Train the model through semi-supervised learning with labeled or unlabeled pictures.
- Predicts if the face belongs to someone it knows and whose face it is.
Installation
Requirements
- Python 3.9+
- Versions below 3.9 have not been tested, and pickle module must be installed via pip.
- dilb
First, you need to install dilb. You can install it by following the instructions on the here.
Then, you can install VisageSnap by using pip:
pip install visagesnap
Usage
Assign a label to the face
You should assign a NameLabel to the face you want to classify first.
vs = VisageSnap.Core()
people = ['Tom', 'Jerry']
# ['NameLabel1', 'NameLabel2', 'NameLabel3'...]
vs.set_label(people)
You can also do it like this so that assign a NameLabel and NumberLabel: (NumberLabel MUST NOT BE -1)
people = {
# 'NameLabel': NumberLabel
'Tom': 0,
'Jerry': 1
}
Put the picture files to be used during training in the directory. In this case, the file name follows the following rules:
(NameLabel)-(Any character).extension
Tom-123.png
Tom-124.jpg
Tom-126.jpeg
Jerry-2.png
Jerry-3.png
Jerry-4.png
Recognize faces and train the model
Train with the picture files in the directory.
vs.train_labeled_data()
If you want to train with unlabeled data, you can also try to like this:
vs.train_unlabeled_data()
Identification predictions
Put the picture files you want to predict into the directory.
result = vs.predict_all()
print(result)
{
"target1.png": "Tom",
"target2.jpeg": "Jerry",
"target3.jpeg": ["Tom", "Jerry"], # multiple faces in one picture
"target4.jpeg": None # If the face is unknown
}
To change the directory you work with
You should put the picture files into configured directory, and also model file is stored in model directory.
vs.set_directory({
"labeled": "labeled_pic",
"unlabeled": "unlabeled_pic",
"model": "my_model.d"
})
Default Directory:
{
"labeled": "labeled",
"unlabeled": "unlabeled",
"model": "model"
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file VisageSnap-0.2.3.tar.gz.
File metadata
- Download URL: VisageSnap-0.2.3.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f49fa5e7d233a1a65473ca42eee429b3a8d69f7fe692c2b724abff103bff5d33
|
|
| MD5 |
68d85c6b30c2a497a74a2eb851653734
|
|
| BLAKE2b-256 |
b100a0f24f6316528eef42c3bc75d6ddd329558cec5708ca78a37612574ffcb9
|
File details
Details for the file VisageSnap-0.2.3-py3-none-any.whl.
File metadata
- Download URL: VisageSnap-0.2.3-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
178af01e0807a65c6657b27e14f20d2479d7c6019cec0ffa0044dbd7f89607aa
|
|
| MD5 |
54a3835d41abb243da9d9559fd0d0604
|
|
| BLAKE2b-256 |
e24fa1560ad5c8cc294e686e3ac82c41d077bb83aa79c70c9601e3cb9dbbb378
|