Skip to content
/ sam Public

Face recognition for identification case study based on OpenFace

License

Notifications You must be signed in to change notification settings

botcs/sam

Repository files navigation

SAM - Face recognition system (DEPLOY BRANCH)

Drawing

Face recognition for identification case study written in Python using PyTorch, OpenCV, dlib

Branch details

This branch is ougt to hold all the utilities and necessary stuff to run the face recognition on the Nvidia Jetson TX1 board, usually referred to as the edge.

Requirements:

  • WebCam
  • A host (for us it is TX1) capable of compiling the following:
    • OpenCV - Video capture
    • Dlib - Face alignment and detection
    • PyTorch - Recognition neural network
  • A DEPLOY_DATABASE.tar that holds facial embeddings and corresponding data for authorization

Latest benchmarks

Embedding network definition:

class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.features = models.squeezenet1_1().features
        self.embedding = nn.Sequential(
            nn.Linear(2048, 512),
            nn.Dropout(),
            nn.ReLU(),
            nn.Linear(512, 128)
        )

    def forward(self, x):
        x = self.features(x)
        x = nn.functional.adaptive_max_pool2d(x, 2)
        batch_size = x.size(0)
        x = x.view(batch_size, -1)
        return self.embedding(x)

Training results

Training set Test set
# Individuals 467 41248
# Images 88 10000
Accuracy (top-1) 99.6% 99.3%

Time complexity

TASK P100 K80 Jetson TX1
640x480x3 face detection (CPU) 55.1 ms ± 9.26 µs 55.1 ms ± 9.26 µs 149 ms ± 372 µs
640x480 face detection (CPU) 55.1 ms ± 9.26 µs 55.1 ms ± 9.26 µs 123 ms ± 1.17 ms
16x3x96x96 embedding net inference 3.61 ms ± 141 µs 5.08 ms ± 6.7 µs 19.1 ms ± 967 µs
1x3x96x96 embedding net inference 3.5 ms ± 112 µs 3.56 ms ± 133 µs 10.9 ms ± 358 µs
K-Nearest Neighbour from 10000x128 embeddings 386 µs ± 112 ns 648 µs ± 194 ns 2.66 ms ± 14.8 µs

About

Face recognition for identification case study based on OpenFace

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published