Example about an IRIS production using Embedded Python to recognize and identify faces in photos
You can find more in-depth information in https://learning.intersystems.com.
Build the image we will use during the workshop:
$ git clone https://github.com/intersystems-ib/workshop-py-face $ cd workshop-py-face $ docker-compose build
The current project is self-deployable and it doesn't require further configuration. The Python libraries required are installed during the deployment of the container.
The main purpose of this example is to ingest images from a specific folder, identify the faces in the images and check any possible match of the faces in a group of images used as repository.
In order to accomplish this goal we are going to use the functionality available in IRIS to use a language like Python in our ObjectScript classes.
We are going to use two models pre-trained to simplify the code, the first one,
mobilenet_graph.pb will help us to recognize all the faces in our image. The second one,
facenet_keras_weights.h5 will allow us to compare the face found with the faces in the images of our repository.
Automatically an IRIS instance will be deployed and a production will be configured and run to read JPG files from /shared/JPG folder.
Opening Visual Studio Code you will be able to manage the different folders configured, you will be able to copy jpg images from your own computer into the container the business operation used to read the object created for each row in Patient's table and the object definition
If you are interested in know more about the Python functionality you can take a look to this article in spanish that I used to build the entire functionality.
You only need to copy the file
travi.jpg located in
/shared/test folder into
/shared/JPG folder. I've included 4 photos of John Travolta as the face known, so any new photo added into
/shared/JPG of John Travolta should return in the Events Log a message with the match and you will see in
/shared/results folder your photo with the face enmarked in green.
In the case that you put into
/shared/JPG the other file
nicolas.jpg you will see an empty line in the Events Log and the JPG created into
/shared/results will contain the face enmarked in red.