Giter VIP home page Giter VIP logo

pytorch-ctvsum's Introduction

pytorch-CTVSUM

This repository contains the official Pytorch implementation of the paper

Contrastive Losses Are Natural Criteria for Unsupervised Video Summarization

Zongshang Pang, Yuta Nakashima, Mayu Otani, Hajime Nagahara

In WACV2023

Installation

git clone https://github.com/pangzss/pytorch-CTVSUM.git
cd pytorch-CTVSUM
conda env create -f environment.yml
conda activate ctvsum

Dataset preparation

We use three datasets in our paper: TVSum, SumMe, and a random subset of Youtube8M.

TVSum and SumMe are used for training and evaluation, and Youtube8M is only used for training.

To prepare the datasets,

  1. Download raw videos from TVSum and SumMe and put them in ./data/raw
  2. Download the extracted features from GoogleDrive (GoogLeNet features for TVSum and SumMe, kindly provided by the authors of DRDSN, and quantized Inception features for Youtube8M).
  3. Put eccv_* files in ./data/interim, and unzip selected_features.zip in ./data/interim/youtube8M/

Training and Evaluation

Evaluation with only pretrained features

  1. In ./configs/aln_unif_config.yml, modify the dataset and evaluation settings, e.g.
data:
  name: tvsum # summe
  setting: Canonical # Augmented/Transfer
  1. Set
is_raw: True
  1. Set use Global Consistency or not
use_unif: True # False
  1. For Youtube8M features (quantized Inception), in ./configs/aln_unif_y8_config.yml, set
is_raw: True
hparams:
  use_unif: True # False
  1. Run
./run_ablation.sh
./run_y8.sh

Contrastive refinement and evaluation

  1. For TVSum and SumMe, set training/evaluation setting in ./configs/aln_unif_config.yml, and decide whether to use global consistency or uniqueness filter
is_raw: False
use_unif: True # False
use_unq: True # False

The code will run 5-fold cross validation by default.

  1. For Youtube8M, similarly in ./configs/aln_unif_y8_config.yml,
is_raw: False
hparams:
  use_unif: True # False
  use_unq: True # False
  1. Run
./run_ablation.sh
./run_y8.sh

Acknowledgement

We would like to thank DRDSN, which provides the extracted features and the evaluation code for TVSum and SumMe. Moreover, we are thankful to the insightful work Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere, which inspired our work.

Citation

@inproceedings{pang2023contrastive,
  title={Contrastive Losses Are Natural Criteria for Unsupervised Video Summarization},
  author={Pang, Zongshang and Nakashima, Yuta and Otani, Mayu and Nagahara, Hajime},
  booktitle={WACV},
  year={2023}
}

pytorch-ctvsum's People

Contributors

pangzss avatar

Stargazers

Nipun Harjai avatar  avatar Jintao Lin avatar Theodoros Psallidas avatar jtf_shine avatar 姚施越 avatar  avatar  avatar Xt117 avatar Fei Wang avatar Jhone Mao avatar Yancy avatar Jake Li avatar  avatar Coert avatar  avatar lulihua avatar  avatar altryne avatar  avatar

Watchers

刘国友 avatar Kostas Georgiou avatar  avatar

pytorch-ctvsum's Issues

Missing some JSON files in splits folder

Hi,

I'm trying to re-run the code, but I get this error:

FileNotFoundError: [Errno 2] No such file or directory: 'data/interim//splits/tvsum_splits.json'

It seems like these JSON files are not mentioned in the instructions.
Can you please let me know where I can find the JSON files in the splits folder?

Thank you!
Bests,
Chau

Missing inception_v3.h5 files

Hi,

It seems like we need inception_v3.h5 files for tvsum and summe datasets when running./run_y8.sh.

for name in ['tvsum', 'summe']:
       dataset = h5py.File(self.data_cfg.paths.interim+'/{}_inception_v3.h5'.format(name), 'r') 

Can you please let me know where to find them?

Thank you,
Bests
Chau

How to apply to a new dataset

Thanks for your great effort. I noticed you used pre-trained features, how can I get the feature if I want to use a new dataset?

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.