Go to this webpage and download blender-2.79b-windows64.zip for windows.
NOTE: It is important that you download the version 2.79b and not 2.79 or 2.79a.
Unzip the .zip
in any location you want. Check if blender works by simply double-clicking the blender.exe
within the unzipped folder.
NOTE: Installing Pybullet is only necessary if you want to use the physics part of the PTR image generation. If you don't want to use that you can continue with Installing pip
-
Download the Windows x86-64 executable installer. This needs to be done because the standard blender python version does not come with the necessary header files attached.
-
Rename your python folder within the blender installation path, e.g. within
..\blender-2.79b-windows64\blender-2.79b-windows64\2.79
should be located a folder namedpython
. Simply rename it topython_bak
-
Execute the Python executable that you downloaded in step
1
.- Uncheck
add to path
and checkinstall pip
click on next - Check only
install precompiled standard libaries
- IMPORTANT: do not choose the default location, but rather modify the installation path to be within your
blender/2.79/
folder, e.g...\blender-2.79b-windows64\blender-2.79b-windows64\2.79\python
(you need to create thepython
folder by yourself). This enables us to use that python version within blender.
- Uncheck
-
Move to the installation
python
folder, there you should find apython.exe
. Run the following command:
python.exe -m pip install numpy pybullet pillow
- If you get no error -> good. If you get an error follow step 6.
- If your error has something to do with C++ versions, please install the correct version through Visual Studio Installer
- If you get an error
rc.exe
not found you need to go to the folderC:\Program Files (x86)\Windows Kits
and search in all folders for therc.exe
- Add the folder with the
rc.exe
to your path and restart the console - You should be good to go and can install also numpy and pillow with the above command.
NOTE: If you have already done the steps in Install Pybullet pip should already be installed in the bleder python version and you can continue with Install dependencies.
Blender 2.79x does come with a Python 3.5 interpreter which will invoke the scripts that are used in this project. One of the pitfalls is that the interpreter does not come with pip
which makes installing third party libraries impossible.
To install pip
navigate to the unzipped folder under ..blender-2.79b-windows64\2.79\python\bin
in your terminal. After that execute the python.exe
that you find in that directory and pass the get-pip.py
script, that you can find in this project root directory by typing:
./python.exe /path/to/get-pip.py
NOTE: if you use powershell or cmd you need to adjust the path to windows paths, i.e. path\to\get-pip.py. Furthermore it is possible that you need to omit the
./
infront ofpython.exe
After successfull installation of pip
you can install pillow
which is required by render_images_partnet.py by typing
NOTE: you need to be located in the same directory as in the previous example where we installed pip!
./python.exe -m pip install pillow numpy pybullet
To make the blender
command available in your system you need to add the unzipped folder path (up until you can see the blender.exe
) to your system path (environment variable).
To make the project run you need to download Partnet Dataset (you need an account) and Partnet Mobility Dataset (you need an account too).
NOTE: The first data set is quite large, i.e. the zip to download is around
100 GB
and the unzipped data set is around322 GB
. The second data set is only~10 GB
.
Unzip both dataset in any location that is convenient.
To run render_images_partnet.py you need to navigate to the location of the script first.
NOTE: I have adjusted some paths and it should work from anywhere, but to be completely sure navigation to the
image_generation
folder is advised.
To generate images use the following command:
blender --python render_images_partnet.py --background -- --data_dir /path/to/unzipped/partnet --mobility_dir /path/to/unzipped/partnet/mobility --use_gpu 1
The last flag --use_gpu 1
enables blender to run on your gpu. This only works if you have a NVIDIA Gpu and CUDA installed. Otherwise you can use --use_gpu 0
or omit the flag.
python generate_questions_partnet.py --input_scene_files ../output/scenes/ --output_dir out/ --output_questions_file out/PARTNET_questions.json
Install Git and add Git directory to PATH environment variable
python data_stream_wrapper_partnet.py --data_dir B:/PartNetData/partnet --mobility_dir B:/PartNetData/mobility --use_gpu 1