Skip to content

Instantly share code, notes, and snippets.

View yjxiong's full-sized avatar
💒
Working from home

yjxiong

💒
Working from home
View GitHub Profile
@yjxiong
yjxiong / 1 - WIDER Baseline CNN.md
Last active November 14, 2018 00:14
The model spec for the baseline CNN Model on WIDER dataset

This gist holds the model spec for the baseline CNN model on the WIDER dataset.

The CNN structure is AlexNet. Network parameters are initialized using a model pretrained on ImageNet.

The weights can be downloaded at

cuhk_wider_baseline_cnn.caffemodel

Please refer to

__author__ = 'Yuanjun Xiong'
"""
This script will transform an image based Caffe model to its optic flow ready form
The basic approach is to average the three channels of the first set of convolution filters.
Averaged filters are then replicated K times to incorporate K input frames of optical flow maps.
Refer to "Towards Good Practices for Very Deep Two-Stream ConvNets" for more details.
======================================================================
Usage:
python build_flow_network.py <caffe root> <first layer name> <image model prototxt> <image model weights> <flow model prototxt> <flow model weights[out]>

To use OpenCV's VideoWriter class to write an H264 encoded video, one would encounter some error like

Could not open codec libx264: unspecified error

Here is the trick. Beforehand, one has to make sure

  • --enable-libx264 is switched on in ffmpeg
  • OpenCV is downloaded in sources.
@yjxiong
yjxiong / OpenCV.sh
Created July 7, 2016 04:03
Install OpenCV with ffmpeg and CUDA
version="2.4.12"
echo "Installing OpenCV" $version
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
sudo apt-get -qq remove ffmpeg x264 libx264-dev
echo "Installing Dependenices"
@yjxiong
yjxiong / pnp.py
Last active February 3, 2024 03:32
SolvePnP for Head Pose Estimation
"""
Light weight head pose estimation with SolvePnP
Author: Yuanjun Xiong
"""
# parameters
fx = 1
# model points