Skip to main content

Frechet Video Motion Distance

Project description

FVMD

Fréchet video motion distance(FVMD) is a metric to evaluate the motion consistency of video generation.

Generic badge Generic badge

🔨 Installation

Install with pip

pip install fvmd

🚀 Usage

Video Data Preparation

The input video sets can be either in .npz or .npy file formats with the shape [clips, frames, height, width, channel], or a folder with the following structure:

Folder/
|-- Clip1/
|   |-- Frame1.png/jpg
|   |-- Frame2.png/jpg
|   |-- ...
|
|-- Clip2/
|   |-- Frame1.png/jpg
|   |-- Frame2.png/jpg
|   |-- ...
|
|-- ...

Evaluate FVMD

To evaluate the FVMD between two video sets, you can run our script:

python -m fvmd --log_dir <log_directory> <path/to/gen_dataset> <path/to/gt_dataset>

You can alose use our FVMD in your Python code:

from fvmd import fvmd

fvmd_value = fvmd(log_dir=<log_directory>, 
                  gen_path=<path/to/gen_dataset>, 
                  gt_path=<path/to/gt_dataset>
                 )

Evaluate FVMD step by step

You can also run only some intermediate steps of FVMD.

Video Key Point Tracking
from fvmd import track_keypoints

velocity_gen, velocity_gt, acceleration_gen, acceleration_gt = keypoint_tracking(log_dir= < log_directory >,
gen_path = < path / to / gen_dataset >,
gt_path = < path / to / gt_dataset >
)
Extract motion feature from velocity/acceleration fields
from fvmd import calc_hist

motion_feature = calc_hist(vectors=<velocity_gen/velocity_gt/acceleration_gen/acceleration_gt>)
Compute FVMD from velocity/acceleration fields
from fvmd import calculate_fvmd_given_paths

results = calculate_fvmd_given_paths(gen_path=<directory/of/gen_velocity/acceleration_cache>, 
                                     gt_path=<directory/of/gt_velocity/acceleration_cache>
                                    )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fvmd-0.0.3.tar.gz (46.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fvmd-0.0.3-py3-none-any.whl (50.2 kB view details)

Uploaded Python 3

File details

Details for the file fvmd-0.0.3.tar.gz.

File metadata

  • Download URL: fvmd-0.0.3.tar.gz
  • Upload date:
  • Size: 46.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.18

File hashes

Hashes for fvmd-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4e796d681c18dfc4afc01b5c99f43bbabf0bc48b8368a02081e0cace89072765
MD5 892f50b41e92ea7b92ec284f0f282b0b
BLAKE2b-256 9aee88f7100fe5899a666584720a7f003d1d54f29a1cdb87981dd5e15cdf3b28

See more details on using hashes here.

File details

Details for the file fvmd-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: fvmd-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 50.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.18

File hashes

Hashes for fvmd-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e121b7d43355cfafb92186105c4379e3568d23d43a27909f50778aa2497d03b7
MD5 4f201500d1f744181d51487865a524a8
BLAKE2b-256 728fd686413b2703a44a4221e05d49b2a4597f27902f01627aaa1a8fa521cab4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page