Python module to extract frames from a video file.
pip install deepframe Package provides a simple API to get video frames from a video file. The frames are returned as buffer view objects which can be converted to numpy arrays.
import deepframe import numpy as np # Extract whole video as a buffer view buffer_view = deepframe.extract_frames('path/to/video.mp4') frames = np.asarray(buffer_view)import deepframe import numpy as np # Extract first 100 frames from a video file buffer_view = deepframe.extract_frames('path/to/video.mp4', slice(0, 100)) frames = np.asarray(buffer_view)import deepframe import numpy as np # Extract each 10th frame from a video file buffer_view = deepframe.extract_frames('path/to/video.mp4', slice(0, None, 10)) frames = np.asarray(buffer_view)- vcpkg
You also need to install python requirements. pip install -r requirements-dev.txt
VCPkg is installed via a git repository which a VCPKG_ROOT environment variable points to. The VCPKG_ROOT can be whatever location on your machine you want.
git clone https://github.com/microsoft/vcpkg.git cd vcpkg export VCPKG_ROOT=`pwd` ./bootstrap-vcpkg.sh echo "export VCPKG_ROOT=$VCPKG_ROOT" >> ~/.zshrc # or path to your shell config file echo "export PATH=$PATH:$VCPKG_ROOT" >> ~/.zshrc # or path to your shell config fileDebug and Release modes are supported. From project root run:
python scripts/build.py debug python scripts/build.py releaseAfter the build you can find the python package in ./build/{mode} or the latest one is always available in ./deepframe/ which is used to run the tests.
For testing we use pytest. To run all tests simply call from project root.
pytestFrom project root call
python -m buildOnce the run finishes you will find the files under ./dist/ directory.