This package helps extract i3D features with ResNet-50 backbone given a folder of videos
Project description
Hello, I am Hao Vy Phan. I have develop this package using ResNet-50 to convert a video into an extracted i3D features numpy file.
Overview
Input: a directory which store 1 or more videos.
Output: 1 or many .npy files (extracted i3D features). Each features file is shaped n/16 * 2048 where n is the number of frames in the video
If there is a problem installing or implementing this package, please do not hesitate to contact me via my email. I am pleased to have people use my product.
Usage
Installation
Before installing my package, please install these pakages: * Opencv-Python==4.5.5 * torch==1.10.1+cu113 * torchaudio==0.10.1+cu113 * torchvision==0.11.2+cu113 * Or find your own python OS version of torch from this link: https://download.pytorch.org/whl/cu113/torch_stable.html
Installing them through pip install may raise errors. You can download the wheel files from the above links and run this code:
pip install torchvision-0.11.2+cu113-cp38-cp38-win_amd64.whl
pip install torchaudio-0.10.1+cu113-cp38-cp38-win_amd64.whl
pip install torch-1.10.1+cu113-cp38-cp38-win_amd64.whl
pip install opencv_python-4.5.5-cp38-cp38-win_amd64.whl
After 4 above packages, to install i3dFeatureExtraction package into your Python environment, run this code on your terminal:
pip install i3dFeatureExtraction
Or install a specific version:
pip install i3dFeatureExtraction==0.2.4
Implementing
The main function of this package is FeatureExtraction which converts a directory of videos into numpy feature files.
from i3dFeatureExtraction import FeatureExtraction
FeatureExtraction.generate(
outputpath = "directory/to/store/output/numpy/files",
datasetpath="directory/of/input/videos",
pretrainedpath = "path/to/i3D/pretrained/weight",
sample_mode = "oversample/center_crop"
)
Credits
This code is based on the following repositories: * pytorch-resnet3d * pytorch-i3d-feature-extraction * E2E-Action-Segmentation/feature_extraction/
I would like to extend a special thank-you to the original authors of these repositories for providing the foundation on which this implementation is built.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for i3dFeatureExtraction-0.2.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a35e0c242b364e5c648cfc0ed1edd72ca95a80be420b5e6e7526351d0361ecc |
|
MD5 | 4b668d42bb0ab2adbb7cc5c5a2725775 |
|
BLAKE2b-256 | 42616a8c664693cb41adaa7da09623841a0c35665c85a78faecdeb87bf76dcbe |
Hashes for i3dFeatureExtraction-0.2.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b9142125f50fa4b2fb79b48c7c6eb3aebb2963cdd04b5f35b5cdaeb6a525a19 |
|
MD5 | 83e03f4e063704eabbb2a43c9f4654ab |
|
BLAKE2b-256 | 043c9315b1995d4981921adbf9905639af11877d41cc6ca60f3f76a03c27c8da |