MCPcopy Index your code
hub / github.com/GowthamGottimukkala/I3D_Feature_Extraction_resnet

github.com/GowthamGottimukkala/I3D_Feature_Extraction_resnet @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
29 symbols 86 edges 5 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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. * Weakly-supervised Video Anomaly Detection with Robust Temporal Feature Magnitude Learning


Credits

The main resnet code and others is collected from the following repositories. * pytorch-resnet3d * pytorch-i3d-feature-extraction

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

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

Run

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

Core symbols most depended-on inside this repo

_make_layer
called by 4
resnet.py
forward_batch
called by 2
extract_features.py
load_frame
called by 1
extract_features_org.py
load_rgb_batch
called by 1
extract_features_org.py
forward_batch
called by 1
extract_features_org.py
load_frame
called by 1
extract_features.py
load_rgb_batch
called by 1
extract_features.py
oversample_data
called by 1
extract_features.py

Shape

Function 13
Method 12
Class 4

Languages

Python100%

Modules by API surface

resnet.py19 symbols
extract_features.py5 symbols
extract_features_org.py4 symbols
main.py1 symbols

For agents

$ claude mcp add I3D_Feature_Extraction_resnet \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page