Goal: create visual characters / actors relationship graph by detecting which characters appear in the same video frames.
Popular The Office (U.S.) season 1 series were chosen for processing.
Result:
- Use ageitgey/face_recognition (uses dlib) to detect faces and extract facial features from video into JSON.
- Decodes video frames using OpenCV
- Uses 1 frame per second from the video input
- Streams faces features as JSON output
- Match extracted faces with known faces using euclidean distance.
- Face features are 128-th dimensional vectors of floats.
- I had to add manually inspect which actor's faces were not detected and add face sample and character name mappings for each pair.
- Record which faces appeared together in the same frames
- Draw a graph where two frequently together appearing characters are close in the graph too.
- Used networkx and matplotlib libraries