3

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?

1 Answers1

2

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

B200011011
  • 3,798
  • 22
  • 33
  • Thanks for your concise answer . I will share the progress I have in this comments . – Artur Sahakyan Mar 05 '20 at 03:23
  • 1
    I have progressed in human pose estimation - https://docs.google.com/document/d/1GwosWDvwj3oLgoplgqgRxk-cf0xB8lhcCfVP7qMbXqs/edit?usp=sharing . – Artur Sahakyan Apr 04 '20 at 07:15
  • Great project. Maybe local package install in blender python directory is the best way. There is package import error sometimes which is solved by changing import order. Can you share your findings on this? – B200011011 Apr 04 '20 at 13:30
  • Conda way worked perfectly with blender 2.82 but dlib needed cmake for installation.It was constantly rushing out errors . So I lowered the version of python to 3.5.6 and manually moved from environment to blender 2.78c , dlib was installed via wheel 3.5 version . Anyway, direct installation in blender is shorter but to escape errors I did with the help of conda envs . – Artur Sahakyan Apr 05 '20 at 09:22
  • Thank you for the information. In my case `dlib` is working correctly so far, but `numpy` import order causes problem. – B200011011 Apr 05 '20 at 10:44