Search code examples
tensorflowartificial-intelligenceconv-neural-networkblendermaya

Can I import tensorflow and keras in Maya , Blender


I am participating in a workshop , where we need to automatically rig characters . Perhaps , we will use deep learning methods . The task is to recognize body parts . My question : Is there a way for connecting tensorflow and keras , or other neural networks with 3D software?


Solution

  • For blender you can follow this tutorial,

    https://www.youtube.com/watch?v=J7Iu1rfwbds

    I tested it in Blender 2.81 and Python 3.7 by importing pytorch, opencv, sklearn etc. Also the test code provided in the video works correctly. You do not need follow the pandas installation and git cloning shown on the tutorial. Let it install with other bigger packages or install with conda.

    Conda environment creation, https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html.

    conda create -n MyNamedEnv python=3.7
    

    After environment is created install your required packages. If you have multiple environments its usually in Anaconda3/envs folder. Command to make link,

    mklink /j python C:\Users\computer\Anaconda3\envs\MyNamedEnv
    

    To test if it is working go to scripting tab in blender 2.81 delete everything. A to select all and del button to delete. Paste code from below to Text Editor and run script.

    https://github.com/virtualdvid/MachineLearning/blob/master/blender/iris_blender.py

    Tensorflow and keras should work similarly by installing them in the conda environment and calling them from blender.

    enter image description here