flateon commited on
Commit
1c2d617
·
verified ·
1 Parent(s): df8bb51

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +46 -3
README.md CHANGED
@@ -1,3 +1,46 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
4
+
5
+ # I3D Model for Frechet Video Distance (FVD)
6
+
7
+ This repository contains a TorchScript version of the I3D (Inflated 3D ConvNet) model, specifically for calculating Frechet Video Distance (FVD). FVD is a metric used to evaluate the quality of generated videos by comparing the statistics of generated videos with real videos.
8
+
9
+ ## Overview
10
+
11
+ The I3D model is a deep neural network architecture designed for video recognition. In the context of FVD calculation, we use the I3D model to extract meaningful features from videos, which are then used to compute the distance between the feature distributions of real and generated videos.
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ pip install huggingface_hub
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```python
22
+ import torch
23
+ from huggingface_hub import hf_hub_download
24
+
25
+ # Download the model from Hugging Face Hub
26
+ model_path = hf_hub_download(
27
+ repo_id="flateon/FVD-I3D-torchscript",
28
+ filename="i3d_torchscript.pt"
29
+ )
30
+
31
+ # Load the model
32
+ i3d_model = torch.jit.load(model_path)
33
+
34
+ # Example with a random video tensor
35
+ # Format: [batch_size, channels, frames, height, width]
36
+ video_tensor = torch.randn(2, 3, 16, 224, 224)
37
+
38
+ # Extract features
39
+ features = i3d_model(video_tensor, rescale=True, resize=True, return_features=True)
40
+ print(features.shape) # torch.Size([2, 400])
41
+ ```
42
+
43
+ ## References
44
+
45
+ - Original I3D paper: [Quo Vadis, Action Recognition? A New Model and the Kinetics Dataset](https://arxiv.org/abs/1705.07750)
46
+ - FVD metric: [Towards Accurate Generative Models of Video: A New Metric & Challenges](https://arxiv.org/abs/1812.01717)