Unity offers a free plugin to export meshes as fbx files from the editor. Yesterday, I tried to find out how to call the export function from code. Finally, I got it running but not during runtime but only from an editor script.
FbxExporters.Editor.ConvertToModel.Convert(target.gameObject, null, savePath, null, null, null);
Whereever, you include this line of code make sure it is in a folder called Editor. Otherwise the class FbxExporters.Editor won’t be visible. Unfortunately, there remains a limitation. You can only write your fbx files to the Assets folder and not to an arbitrary folder on your hard drive. If you figure out how to solve this, please tell me 🙂
Unity has a mesh limit which sets the maximum vertex count to
65535. With the following property you can increase the vertex count to ~4 billion:
mesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
Installing pocketsphinx should work out of the box when calling pip install pocketsphinx but in some cases it doesn’t. If this is the case you might be missing pulseaudio dependencies on your system. Just install pulseaudio-libs and pulseaudio-libs-devel via yum and pocketsphinx should install.
Today I tried to figure out how to print a Jupyter Notebook as Tex file including all images on a CentOS 7 installation. After a while I found the following packages which are required to succesfully generate the files:
yum -y install texlive texlive-latex texlive-xetex
yum -y install texlive-collection-latex
yum -y install texlive-collection-latexrecommended
yum -y install texlive-xetex-def
yum -y install texlive-collection-xetex
yum -y install texlive-collection-latexextra
yum -y install texlive-adjustbox
yum -y install texlive-upquote
After that, just call:
I’ve read many tutorials about building and installing OpenCV on a Raspberry Pi but they either did not work or were outdated. Hence, I decided to write down all steps required to build and install OpenCV 3.4.
# Update your system
sudo apt-get update
sudo apt-get upgrade
# Change swap size
sudo nano /etc/dphys-swapfile
# Change this... CONF_SWAPSIZE=100 to this
# Restart service
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
# Install packages
sudo apt-get install build-essential cmake cmake-curses-gui pkg-config
sudo apt-get install libatlas-base-dev gfortran
sudo apt-get install \
sudo apt-get -y install libv4l-dev v4l-utils
sudo apt-get install python2.7-dev
sudo apt-get install python3-dev
pip install numpy
pip3 install numpy
# Install OpenCV
wget https://github.com/opencv/opencv/archive/3.4.0.zip -O opencv.zip
wget https://github.com/opencv/opencv_contrib/archive/3.4.0.zip -O opencv_contrib.zip
sudo cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D BUILD_WITH_DEBUG_INFO=OFF \
-D BUILD_DOCS=OFF \
-D BUILD_EXAMPLES=OFF \
-D BUILD_TESTS=OFF \
-D BUILD_opencv_ts=OFF \
-D BUILD_PERF_TESTS=OFF \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.0/modules \
-D ENABLE_NEON=ON \
-D WITH_LIBV4L=ON \
sudo make -j3
sudo make install
# Fix library file name
sudo mv cv2.cpython-35m.so cv2.so
We tend to setup our hbase test tables by shell scripts. Hence we have to execute multiple puts and deletes in a row. When you add an hbase shell [command] for each single operation you will have to wait a long time until all commands are processed. A more performant proceeding is to put all commands in one single <<EOF … EOF construct which basically allows to pass a multi line parameter to the shell.
hbase shell <<EOF
Doing so hbase will only start one shell instead of starting an instance for each single command.
To compile the ALIZE speaker detection library download the projects alize-core and LIA_RAL from https://github.com/ALIZE-Speaker-Recognition. Unzip both in the same parent directory and rename the alize-core folder to ALIZE.
Open the SLN file in the ALIZE directory and build it, there should be no errors.
Afterwards open the SLN file in the LIA_RAL folder. Before you start the build process you have to make changes to two files. In Macros.h change line 301 from:
#if defined(_MSC_VER) && (!defined(__INTEL_COMPILER))
#if defined(_MSC_VER) && (_MSC_VER < 1900) && (!defined(__INTEL_COMPILER))
Then change the following in MapBase.h. Add the following line after line 172 (before the keyword public:):
typedef MapBase<Derived, ReadOnlyAccessors> ReadOnlyMapBase;
Afterwards, change the following line:
And a few lines later change:
Now open the SLN file in the LIA_RAL folder and build the project liatools. Make sure that you pick the same platform as you did before when compiling ALIZE.
We frequently encoutered a ClassNotFoundException in our Java based Spark applications for classes that we verifiably included in our application’s JAR. Furthermore, we used the kryoSerializer (org.apache.spark.serializer.KryoSerializer) for performance reasons.
After some very annoying debugging sessions we found out that we can get rid of the exception by registering the apparently missing classes by adding them to the spark configration item org.apache.spark.serializer.KryoSerializer. This property is a simple comma separated list of full qualified class names. After adding each class the ClassNotFoundException disappeared.
Similar to the compilation of dlib for ARM on Ubuntu (see http://www.jofre.de/?p=1494) I’d like to provide a short guilde on how to compile OpenCV for ARM on Ubuntu.
First, install all required packages:
sudo apt-get install build-essential git cmake pkg-config libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libgtk2.0-dev libatlas-base-dev
Download/clone OpenCV from github
cmake -DSOFTFP=ON -DCMAKE_TOOLCHAIN_FILE=/home/user1/opencv/platforms/linux/arm-gnueabi.toolchain.cmake ..
Since I could not find any instruction to compile dlib for ARM (to use it e.g. on a raspberry pi) I decided to write one.
First, install all required packages:
sudo apt-get install libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi pkg-config libx11-dev libatlas-base-dev libgtk-3-dev libboost-all-dev build-essential cmake libncurses5-dev gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
Download dlib and upzip:
cmake -DCMAKE_C_FLAGS=”-O3 -mfpu=neon -fprofile-use -DENABLE_NEON” -DNEON=ON -DCMAKE_C_COMPILER=/usr/bin/arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=/usr/bin/arm-linux-gnueabihf-g++ -DCMAKE_CXX_FLAGS=”-std=c++11″ –build –config Release ..
sudo make install