Besides grouping input by class folders (refer to DisVoice), Face Mesh and HOG feature extraction requires an additional auxiliary data-enclosing folder within each class folder. Example:
facemesh/
├── EXPR_AGITATED
│ └── facecap
│ ├── agitated_sample_1.mp4
│ ├── agitated_sample_2.mp4
│ |── agitated_sample_3.mp4
| ...
├── EXPR_RELIEVED
│ └── facecap
│ ├── relieved_sample_1.mp4
│ ├── relieved_sample_2.mp4
│ |── relieved_sample_3.mp4
| ...
├── facedetection.py
├── facemesh_character.py
├── facemesh_features.md
Face Mesh only provides the region of interest across frames. The HOG descriptor extract features from videos. Two strategies are implemented:
- Dense HOG: features are extracted per frame and either averaged or becomes inputs for feature late fusion
- Sparse HOG: space-time interest points12 across the video yields local features, pooled to video-level descriptors through Bag of Words
Use python facemesh_character.py --help
for argument details
- Input: must specify class names and the nested auxiliary directory as well
- Configurations: option to use dense HOG over sparse HOG; variant selection for dense HOG; settings for sparse HOG.
- Outputs:video labels & 1 of the following depending on extraction configurations
- Video-level features from dense HOG averaged across fraems
- Video-level features from sparse HOG
- Frame-level features from dense HOG without average (must classify with feature late fusion)
- Download source: https://www.di.ens.fr/~laptev/download/stip-2.0-linux.zip
- The binary executable needs to be visible within
PATH
:stip-2.0-linux/bin/stipdet
Dependency of OpenCV 2.2.0
- Download source: https://ffmpeg.org/releases/ffmpeg-0.5.2.tar.bz2
$ ./configure
with--enable-swscale
and--build-shared
options
Dependency of Space-Time Interest Point Detector
- Download source: https://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.2/
- Python=2.7 for compatibility with OpenCV 2.2.0
- Potentially needed OpenCV build (CMake overview) adjustments in
CMakeLists.txt
:- Line 214:
set(OPENCV_BUILD_3RDPARTY_LIBS TRUE)
. Avoids backwards incompabtibility due to newer dependencies - Line 384: +
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:[FFmpeg 0.5.2 install location]/lib/pkgconfig")
. Ensures desired FFmpeg installation will be used - Line 1275-6:
target_compile_options(opencv_core PRIVATE -Wno-narrowing)
&target_compile_options(opencv_ts PRIVATE -Wno-narrowing)
. Prevents build failure due to the narrowing conversion compiler warning
- Line 214:
$ cmake
with-DWITH_EIGEN2=OFF
Footnotes
-
Laptev, I. On Space-Time Interest Points. Int J Comput Vision 64, 107–123 (2005). ↩