Skip to content

Instantly share code, notes, and snippets.

View MikeMpapa's full-sized avatar

Michalis Papakostas MikeMpapa

View GitHub Profile
@MikeMpapa
MikeMpapa / read_hog_file.py
Created February 7, 2020 18:27 — forked from btlorch/read_hog_file.py
Read HoG features file created by OpenFace
import numpy as np
import struct
def read_hog(filename, batch_size=5000):
"""
Read HoG features file created by OpenFace.
For each frame, OpenFace extracts 12 * 12 * 31 HoG features, i.e., num_features = 4464. These features are stored in row-major order.
:param filename: path to .hog file created by OpenFace
:param batch_size: how many rows to read at a time