Skip to main content

Face Classification package

Project description

VisageSnap

Release build

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

VisageSnap-0.2.2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

VisageSnap-0.2.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file VisageSnap-0.2.2.tar.gz.

File metadata

  • Download URL: VisageSnap-0.2.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for VisageSnap-0.2.2.tar.gz
Algorithm Hash digest
SHA256 dca5c2e020ef9086f49067a1b2daf34ca92b4ad89d2ba4d87866e2ad7ed08632
MD5 f89bb4649670d8b7971ca4adf1ef5fbf
BLAKE2b-256 ba02d356aa229e7c5a955cdd73af68ca579e60ffc82f099ef834e66faef90c0e

See more details on using hashes here.

File details

Details for the file VisageSnap-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: VisageSnap-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for VisageSnap-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c1f79f17f7ee8bbf653f70f71d2a0bec4a5ce83241db7a18400f52f334232fe3
MD5 db2d6089d1ff2aa1df8da2b84b2297ce
BLAKE2b-256 20201f118b162a404933ea932a4505b404f7e45405b73a2d46bccf8a294a8acd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page