Thursday 30 April 2020

Batch rendering of faces for machine learning


A colleague was recently working on a machine learning paper for generating 3d facial models, in order to train the network a large number of facial images were required.

These faces required known camera settings, orientations and vertex positions. Whilst he was able to generate such images from Matlab, the lighting was not realistic (blinn phong lighting model) and this was causing accuracy issues when the trained model was applied to real faces.

In order to improve the lighting and accuracy of results I suggested he switched to using Blender Cycles. In support of this I wrote a python script to quickly import facial models, render them in a variety of lighting conditions and export the resulting images.

pre-generated faces, batch rendered by the script.





The script iteratively loads collada models from a user specified folder, renders them under 12 different lighting conditions and exports the resulting images to a user defined folder.


=== Code available here ===

And the .blend file used for rendering:


No comments:

Post a Comment