The 2.0 version of intphys is a reimplementation of intphys-1.0 based on UE-4.18 (was UE-4.8) using the Python scripting language (was Lua).
Train samples are always physically possible and have high variability
Test samples have a constrained variability and come as quadruplets: 2 possibles cases and 2 impossibles ones
Each video comes with it's associated depth field and object masking (each object have a unique id), along with a detailed status in JSON format.
This installation process succeeded on Debian stable (Jessie), Ubuntu 16.04 and Ubuntu 18.04. It may be fine for other Unices as well, but this have not been tested.
Setup an Epic Games account at https://github.com/EpicGames/Signup/, needed to clone the Unreal Engine repository from github.
Setup the compiler. You need
clang-3.8on Ubuntu 16.04 or below, or
clang-3.9on Ubuntu 18.04 (because 3.8 is no more available on that distribution). The compilation will fail if using a more recent version of
Make sure you have
clanginstalled and that
/usr/bin/clang++effectively points to the 3.8 or 3.9 version. To check it, have a
/usr/bin/clang++ --version, it should output something like:
clang version 3.9.1-19ubuntu1 (tags/RELEASE_391/rc2) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin
If this is not the case, install it and update
clangto point to the right version (here 3.9 as example, adapt it for 3.8):
sudo apt install clang-3.9 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 100 sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.9 100
Install Unreal Engine as documented here.
First clone the Engine sources:
git clone https://github.com/EpicGames/UnrealEngine -b release cd UnrealEngine
If compiling with
clang-3.9you need to modify a file in the engine sources (else the next step will fail, see here for details). Edit the file Engine/Source/ThirdParty/FBX/2018.1.1/include/fbxsdk/core/fbxproperty.h and replace the line 1188 as:
return StaticInit(pObject, pName, FbxGetDataTypeFromEnum(eFbxEnum), pValue, pForceSet, pFlags); // return StaticInit(pObject, pName, FbxGetDataTypeFromEnum(FbxTypeOf(*((FbxReference*)0))), pValue, pForceSet, pFlags);
Then compile the engine:
./Setup.sh ./GenerateProjectFiles.sh make
Install intphys in a separate directory. Clone the repository and its UnrealEnginePython submodule from github. Do not forget the
--recursiveoption to download the submodule:
git clone --recursive firstname.lastname@example.org:bootphon/intphys.git
You need Python>=3.6 installed as
/usr/bin/python3.6(else you need to tweak the UnrealEnginePython plugin here so that it can find python>=3.6 in a non-standard path, for exemple in a virtual environment). You also need the dataclasses module (in the standard library with python>=3.7). To install it on ubuntu 16.04, have a:
sudo add-apt-repository ppa:jonathonf/python-3.6 sudo apt-get update sudo apt-get install python3.6 python3.6-dev /usr/bin/python3.6 -m pip install dataclasses
~/.bashrc: The intphys code reads the path to UnrealEngine and the path to the Python scripts from the
PYTHONPATHenvironment variables repectively. Add that to your
export UE_ROOT=/absolute/path/to/UnrealEngine export PYTHONPATH=$PYTHONPATH:/absolute/path/to/intphys/Content/Scripts
intphyspackage: We now need to package the intphys project into a standalone binary program. Just have a:
intphys.pyprogram to run the game and generate data. To discover the arguments, have a:
The basic usage is calling
intphys.py scenes.json -o ./output_data. This reads the scenes to be generated from the
scenes.jsonfile and write them in the folder
Generate scenes using the packaged game:
When developing you may want to run the project within UE4Editor (
--editoroption) or as a standalone game (
--verboseoption is usefull for dev as well.
Tools directory are stored few utility scripts:
images2video.sh : converts a sequence of images into a video or a gif file. Used to postprocess the generated png images.
clean.sh : deletes the intphys build/binaries directories.
make_archives.py : build tar.gz archives as released on www.intphys.com.
scripts for building the project.
Exemples directory are stored scripts to generate few videos,
extract them to gif pictures and embeed them in a html page.
Here are some tweaks and error reports usefull for intphys development.
UE4 crash: cannot open OpenGL context
Occured after an update of the nvidia graphic drivers. Just reboot and
sudo glxinfo helps.
After a system update you may issue an error when running
.gch precompiled headers. The issue is like:
fatal error: file '/usr/include/linux/version.h' has been modified since the precompiled header '.../UE4Editor/Development/Engine/SharedPCH.Engine.h.gch' was built note: please rebuild precompiled header '.../UE4Editor/Development/Engine/SharedPCH.Engine.h.gch'
In that case remove all the
.gch files and recompile the engine:
cd $UE_ROOT find Engine/Intermediate -type f -name "*.gch" -delete ./GenerateProjectFiles.sh && make
How to make a new project
Steps to duplicate the intphys project into a fresh one in UnrealEngine. This may be needed for debug or development or when upgrading to a new engine version.
Open UE4Editor and create a new C++ blank project called
newdirectory, open the project a first time and close it just after.
Copy the following files and folders from
- and all the top-level files in the git repo (.gitignore, configure, etc...)
Reopen the project. In Project Settings / Maps & Mods, set up the default map to intphysMap.