Overview | Demo Flow | Pipeline Output | Notebooks and Code
This demo demonstrates how to build a real-time face-recognition application. It includes streaming video to the Iguazio Data Science Platform ("the platform"); running a face-recognition algorithm in real time; and building a face-tagging interface. The application administrator can use the face-tagging interface to see the unrecognized faces and manually tag them, thus allowing the system to learn and train the model accordingly. In addition, the demo implements location tracking of the identities determined by the faces recognition.
This demo uses OpenCV, PyTorch, Streamlit, Nuclio, and MLRun. MLRun is used to build and track the functions.
The demo includes five MLRun and Nuclio functions for implementing the following flow:
- Face recognition and encoding in photos using the OpenCV deep-learning model — from a notebook.
- Model training and an output PyTorch predictor, based on the extracted encodings — from a notebook.
- Automated deployment of a model-serving Nuclio function — from a notebook.
- A client that records video, streams the data to the platform's data store (file system), and triggers the serving function (see client/README.md).
- Labeling of unrecognized faces using an interactive dashboard that's built with Streamlit — from code (see streamlit/README.md).
The demo also demonstrates how to build an automated pipeline from a notebook using MLRun and Kubeflow Pipelines, including using the platform's NoSQL (key-value) data store and time-series database (TSDB) library to store metadata and track data of the identified and unidentified faces.
The following image illustrates the generated pipeline:
- notebooks/face-recognition.ipynb — the main demo notebook ("all in one"). Run this notebook to execute the entire pipeline — import, launch, train, and deploy a serving function..
- client/README.md — a video-streaming client.
- notebooks/nuclio-face-prediction.ipynb — serving-function development and testing.
- client/video_capture.py — a client for streaming data to the Iguazio Data Science Platform.
- streamlit/dashboard.py — labeling of unknown images, and model retraining for newly collected data.