Giter Site home page Giter Site logo

i3d_feature_extraction_resnet's Introduction

I3D_Feature_Extraction_resnet

This repo contains code to extract I3D features with resnet50 backbone given a folder of videos

This code can be used for the below paper. Use at your own risk since this is still untested.


Credits

The main resnet code and others is collected from the following repositories.

I modified and combined them and also added features to make it suitable for the given task.

Overview

This code takes a folder of videos as input and for each video it saves I3D feature numpy file of dimension 1*n/16*2048 where n is the no.of frames in the video

Usage

Pre-requisite

Install ffmpeg

sudo apt-get update
sudo apt-get install ffmpeg

Install requirements.txt

pip install -r requirements.txt

Setup

Download pretrained weights for I3D from the nonlocal repo

wget https://dl.fbaipublicfiles.com/video-nonlocal/i3d_baseline_32x2_IN_pretrain_400k.pkl -P pretrained/

Convert these weights from caffe2 to pytorch. This is just a simple renaming of the blobs to match the pytorch model.

python -m utils.convert_weights pretrained/i3d_baseline_32x2_IN_pretrain_400k.pkl pretrained/i3d_r50_kinetics.pth

Parameters

--datasetpath:       folder of input videos (contains videos or subdirectories of videos)
--outputpath:        folder of extracted features
--frequency:         how many frames between adjacent snippet
--batch_size:        batch size for snippets
--last_segment:	     whether to cut or pad last segment ("padding" or "cutting")

Run

python main.py --datasetpath=samplevideos/ --outputpath=output

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.