How to replace each detected face with a different image?

This is really fun. I’m planning to use this to create a simple art project for a local bar, where people can walk up to a laptop with a camera, and their face is replaced with an image. I’ve got a working prototype based on the sample rectangles code, but have hit a roadblock as the “Process List” node doesn’t give an index, and so I can’t figure out how to easily use a different image for face 1, face 2, face 3 etc. Is there an easy way to do this?

The Find Faces in Image node doesn’t provide persistent face tracking — that is, it doesn’t guarantee that the order of the faces in the output list will be the same as people move around or as people enter/leave the frame. So an index wouldn’t solve the problem.

Instead, one way to achieve a sort of persistence would be to take the detected face’s position and map that to a certain image (or a color, as in the attached composition). Then, when somebody’s in the left 1/4 of the camera’s viewport they’ll get one image, the second 1/4 will get a different image, and so on.

faces-x-position.vuo (6.44 KB)