# facial_animation **Repository Path**: echo_lin/facial_animation ## Basic Information - **Project Name**: facial_animation - **Description**: This repository is the implement of facial animation, including host and device souce codes. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-12-02 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # facial_animation ### Description This repository is the implement of facial animation, including host and device souce codes. ### Software Architecture Software architecture description ### Installation(HOST SIDE) The project is developed on Ubuntu 16.04 with vscode 1. Dependencies * OpenCV >= 3.4.0 * Qt >= 5.4 * FFMPEG * OpenMP * OpenGL * dlib (already included in the project so no need to configure yourself) Here, the softwares version on my pc is opencv3.4.0, QT5.5.1, ffmpeg4.2.1. you should install ffmpeg first, then QT, and the last is opencv. * Before running the code, make sure that the server on device is already running. * Common problems: Restricted by the network scale and limited resolution of images the network trained on, the face area of the input image should be within 336x336. 2. Here are some commands for installation or un-installation #### Opencv installation Firtly,download ippicv_2017u3_lnx_intel64_general_20170822.tgz, then replace URL with it. ``` cd opencv-3.4.0/3rdparty/ippicv vim ippicv.cmake "file:/home/ascend/workspace/software/" mkdir -p /home/ascend/3rdparty cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/home/ascend/3rdparty/opencv340 -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_FFMPEG=ON .. make -j8 make install ``` sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf' * For opencv un-installation, ``` cd /home/***/opencv/build sudo make uninstall cd .. sudo rm -r build ``` Or some other commands. For example, ``` sudo rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv* cd /usr find . -name "*opencv*" | xargs sudo rm -rf ``` #### QT installation * For ubuntu16.04.x version ``` apt-get install qt5-default qtcreator ``` #### FFMPEG installation ### ``` 1. sudo apt-get remove --purge ffmpeg 2. apt-get install libx264-dev libx265-dev libfaac-dev libmp3lame-dev libtheora-dev libvorbis-dev libxvidcore-dev libxext-dev libxfixes-dev 3. tar -jxvf ffmpeg-4.2.1.tar.bz2 4. cd ffmpeg421 5. ./configure --prefix=/home/pass/3rdparty/ffmpeg421 --enable-shared --enable-swscale --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-pic --enable-shared --enable-static --enable-libx264 --enable-libx265 ``` #### Installation(Device Side) 1. Build Device Project, change directory to the workding directory. then, following the command below. ``` cd device sh build.sh ``` Here, it will generate all the necessary files in *_out_* folder. 2. Deployment on device Connect to the Atlas200DK, then make a new directory on device. Take 'FacialAnimationServer' as an example. Copy all the file in *_out_* folder to _FacialAnimationServer_ directory. Now you can start the server by executing the following command. Stop server by Ctrl+C. ``` ./main ``` #### Instructions 1. host side * For build project ``` cd ~/host mkdir build cmake .. make -j8 ``` * For executable ``` cd ../bin ./facial_animation_host ``` 2. device side