GithubHelp home page GithubHelp logo

zjr2000 / context-gebc Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 43.98 MB

Second-place solution to Generic Event Boundary Captioning task in LOVEU Challenge (CVPR 2022 workshop)

License: MIT License

Python 85.21% Jupyter Notebook 0.62% Shell 0.12% C++ 1.27% Cuda 12.78%
video-captioning pytorch-implementation

context-gebc's Introduction

Context-GEBC

Code for LOVEU Challenge 2022 (Track 2 Generic Event Boundary Captioning Challenge). Our model directly takes the whole video clip as input and generates a caption for each time boundary parallelly. With this design, the model could learn the context information of each time boundary, thus, the potential boundary-boundary interaction could be modeled.

Our method achieves a 72.84 score on the test set, and we reach the $2^{nd}$ place in this challenge. The technical report is available here.

Environment

Our code is adapted from the official implementation of PDVC, please see the original repo for the environment preparation.

Data

Using CLIP to extract frame-level features and Omnivore to extract clip-level features. We use this pipeline to extract features.

Then, put the extracted features under these two folders:

data/gebc/features/clip_gebc,
data/gebc/omni_gebc

You can also directly download the official provided features here. But, remember to change the visual_feature_folder and feature_dim in the config file.

Using VinVL to extract region-level features. The region feature of a video is saved to multiple .npy files, where each single file contains the region feature of a sampled frame. Merge the feature file paths into video_to_frame_index.json in the following format:

{
    "video_id": [
        "frame_1_feat.npy",
        "frame_2_feat.npy",
        ...     
    ],
    ...
}

Then put this file under data/gebc/.

Usage

Train

python train.py --cfg_path ${CONFIG_PATH} --gpu_id ${GPU_ID}

Evaluation

python eval.py --eval_folder ${EVAL_FOLDER} \
 --gpu_id=${GPU_ID} \
 --eval_caption_file=${VAL_ANNO_FILE} \
 --eval_model_path=save/${eval_folder}/model-best-dvc.pth \
 --eval_transformer_input_type gt_proposals \
 --eval_tool_version 2018_cider \
 --eval_batch_size ${EVAL_BATCHSIZE}

We train three models to predict subject, before and after, the corresponding config file and validation file are listed below:

Type CONFIG_PATH VAL_ANNO_FILE
Subject cfgs/gebc/gebc_clip_omni_5e5_objq50_subject.yml data/gebc/valset_highest_f1_subject.json
Before cfgs/gebc/gebc_clip_omni_5e5_objq50_before.yml data/gebc/valset_highest_f1_before.json
After cfgs/gebc/gebc_clip_omni_5e5_objq50_after.yml data/gebc/valset_highest_f1_after.json

Acknowledgement

This repo is mainly based on PDVC. We thank the authors for their efforts.

context-gebc's People

Contributors

ttengwang avatar zjr2000 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

yunlong10

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.