Implementation of Cross-category Video Highlight Detection via Set-based Learning (ICCV 2021).

Overview

Cross-category Video Highlight Detection via Set-based Learning

Introduction

This project is an implementation of ``Cross-category Video Highlight Detection via Set-based Learning'' in PyTorch, which is accepted by ICCV 2021. We provide the codes for our proposed SL-module, DL-VHD and also some domain adaptation baselines in this repository.

More details of this work can be found in our paper: [Paper (arXiv)].

Prerequisites

We develop this project with Python3.6 and following Python packages:

Pytorch                   1.5.0
cv2                       3.4.2
einops                    0.3.0

P.S. In our project, these packages can be successfully installed and work together under CUDA/9.0 and cuDNN/7.0.5.

Dataset and Pre-trained Model

YouTube Highlights dataset. You can download the dataset in this repository and put it under the path you like, e.g. ~/data/YouTube_Highlights/.

For training highlight detection models, you can convert the original videos in YouTube Highlights to video segments by following command:

python ./dataloaders/youtube_highlights_set.py

ActivityNet dataset. Because of the large size of the full dataset, we suggest you to crawl videos using this tool. We provide the names of the videos used in our work in this file. You can put the crawled videos under the path you like, e.g. ~/data/ActivityNet/.

To fit the format of highlight detection, you can convert the raw videos and annotations by following commands:

cd ./data_process
python process_ActivityNet.py

Pre-trained model. You can download the pre-trained C3D model in this link and put it under the path you like, e.g. ~/pretrained_models/.

Category-specific Video Highlight Detection

SL-module. To train and finally evaluate the SL-module, simply run:

python train_SL_module.py --gpu_id $device_id$ --src_category $cls$ \
                          --tgt_category $cls$ --use_transformer

Cross-category Video Highlight Detection

Source-only. To train and finally evaluate the Source-only model with SL-module, simply run:

python train_SL_module.py --gpu_id $device_id$ --src_category $src_cls$ \
                          --tgt_category $tgt_cls$ --use_transformer

Target-oracle. To train and finally evaluate the Target-oracle model with SL-module, simply run:

python train_SL_module.py --gpu_id $device_id$ --src_category $tgt_cls$ \
                          --tgt_category $tgt_cls$ --use_transformer

DA baselines. To train and finally evaluate two domain adaptation baselines (MMD and Deep CORAL), simply run:

python train_da_baselines.py --gpu_id $device_id$ --src_category $src_cls$ \
                             --tgt_category $tgt_cls$ --da_metric $mmd/coral$ \
                             --use_transformer

DL-VHD. To train and finally evaluate the DL-VHD model, simply run:

python train_dual_learner.py --gpu_id $device_id$ --src_category $src_cls$ \
                             --tgt_category $tgt_cls$ --use_transformer

Citation

If this work helps your research, you can kindly cite the following paper (will be updated when the ICCV paper is published).

@article{xu2021cross-category,
  title={Cross-category Video Highlight Detection via Set-based Learning},
  author={Xu, Minghao and Wang, Hang and Ni, Bingbing and Zhu, Riheng and Sun, Zhenbang and Wang, Changhu},
  journal={arXiv preprint arXiv:2108.11770},
  year={2021}
}
Comments
  • About the missing videos in YouTube Highlights dataset

    About the missing videos in YouTube Highlights dataset

    Hi @ChrisAllenMing, thanks for your great work on video highlight detection! As far as I know, ~190 videos are missing in the YouTube Highlights dataset currently. May I ask that how did you handle this problem? Thanks!

    opened by yeliudev 2
  • 您好,向您请教一个关于模型训练过程中中--src_category  --tgt_category 参数输入的问题,希望您能给出详细一点的解答,谢谢

    您好,向您请教一个关于模型训练过程中中--src_category --tgt_category 参数输入的问题,希望您能给出详细一点的解答,谢谢

    您好 ,我在通过你的模型进行网络训练时,有一个疑惑就是关于红色框中的输入,cls src_cls tgt_cls分别代表什么呢 我看了一下源码,他们都是['dog', 'gymnastics', 'parkour', 'skating', 'skiing', 'surfing'] 列表中的其中一个,所以我没有明白Source-only Target-oracle. DA baselines.的区别是啥,或者说怎么得到的,希望您能告诉我 在运行Source-only Target-oracle. DA baselines.的Python命令时,--src_category --tgt_category 这两个参数应该分别输入什么呢? 我觉得不可能是将 ['dog', 'gymnastics', 'parkour', 'skating', 'skiing', 'surfing']进行两两组合进行训练,这样的话会产生很多模型。 image

    opened by love112358 1
  • result on real scenario video

    result on real scenario video

    Dear author: Thanks for the DA on VHD work. I wonder have you tested the predicted HL curves on real scenario video, such as the videos captured by mobile phone on daily scene. Does it work also good and reasonable? thank you for giving some feedback about this.

    opened by dragen1860 1
  • Weird videos included in some classes.

    Weird videos included in some classes.

    Hello. Thanks for the great work.

    While we were checking the highlight video dataset, we have found that some videos are not in accordance with their video labels.

    For example, 'dog/iyYiqa0QZXM/' video in youtube is the video illustrating how to draw monkey.

    The video below is also about drawing the zebra but included in the dog class. 'http://www.youtube.com/watch?v=7H_qqQvPUzY'

    Could you provide how the authors handled these? Or weren't there any considerations for these files?

    Thank you.

    opened by wjun0830 0
  • Could you share the train/test video ids for the youtube highlight data set?

    Could you share the train/test video ids for the youtube highlight data set?

    Hello, thanks for sharing the code.

    After I tested the SL_module on the "skating" category, I could only get an mAP around 30%. There were also some gaps of mAP on other categories between my evaluations and what has been reported in the paper, but they were not as ridiculous as for "skating".

    So I guess there might be some discrepancy between the set of videos we used for training/testing, since I guess the videos are constantly disappearing from youtube. So could you share the train/test video ids??

    Or do you have any other clues about this problem on "skating"?

    Thanks.

    opened by pangzss 0
  • about the accuracy can not reach the value in the paper

    about the accuracy can not reach the value in the paper

    hi thanks for share your research on videohight domain, I train the SL_module on with src_category=surfing and tgt_category=surfing and got the results map=0.67,however in the paper The same configuration is map=0.76, the tensorboard results is shown below: image Could you tell me if there is something wrong with my training?

    opened by thunderlzy 3
  • About the data type of activitynet label

    About the data type of activitynet label

    Thanks for your work! I have something not sure about experiments of the activitynet dataset.

    1. In your paper, you said the label is tIoU, so is that a float data or an integer? I suppose tIoU to be a float data, but in your code, it seems to be an integer (in class ActivityNet_Set in activity_net_set.py). What's more, if the label is an integer, why not use "np.round" instead of "np.array"?
    2. Is the 3k+ video data in activitynet you used is randomly selected from the whole dataset? Will more videos lead to a better result?
    opened by SchumannTian 0
  • About the number of videos in given ActivityNet_vids.txt file

    About the number of videos in given ActivityNet_vids.txt file

    Yours paper says there are 2520 videos for training and 1260 videos for test, while there are only 3317 videos in ActivityNet_vids.txt in total. What is the reason for this? If I train model with these, will it affect the results?

    opened by vatica 3
Owner
Minghao (Alan) Xu
I'm a first-year PhD student at Mila - Quebec AI Institute
Minghao (Alan) Xu
Python based Telegram bot. Search and download YouTube video or audio.

Python-Telegram-Youtube-Media-Bot Python based Telegram bot. Search and download YouTube video or audio. Just change settings.py and start TelegramBot

Ahmet Bohur 2 Oct 2, 2022
Python based YouTube video Downloader GUI Application.

Youtube video Downloader Python based Youtube video Downloader GUI Application. Installation Python Dependencies Import pytube pip install pytube Im

Naem Azam 1 Jan 3, 2022
Tkinter based YouTube video downloader works on pytube 11.0.2. Can download YouTube videos in 720p(HD), 144p and even only audio.

YouTube-Downloader Tkinter based YouTube video downloader works on pytube 11.0.2. Can download YouTube videos in 720p(HD), 144p and even only audio. G

Manav Grover 2 Dec 27, 2021
ImageScraper is a cross-platform tool for downloading a specified count from xkcd, Astronomy Picture of the Day and Existential Comics

ImageScraper The ImageScraper is a cross-platform tool for downloading a specified count from xkcd, Astronomy Picture of the Day and Existential Comic

1amnobody 1 Jan 25, 2022
A cross platform front-end GUI of the popular youtube-dl written in wxPython.

youtube-dlG A cross platform front-end GUI of the popular youtube-dl media downloader written in wxPython. Supported sites Screenshots Requirements Py

null 8.7k Dec 31, 2022
Python code to crawl computer vision papers from top CV conferences. Currently it supports CVPR, ICCV, ECCV, NeurIPS, ICML, ICLR, SIGGRAPH

Python code to crawl computer vision papers from top CV conferences. Currently it supports CVPR, ICCV, ECCV, NeurIPS, ICML, ICLR, SIGGRAPH. It leverages selenium, a website testing framework to crawl the titles and pdf urls from the conference website, and download them one by one with some simple anti-anti-crawler tricks.

Xiaoyang Huang 39 Nov 21, 2022
Command-line program to download videos from YouTube.com and other video sites

youtube-dl - download videos from youtube.com or other video platforms

youtube-dl 116.4k Jan 7, 2023
Music and video downloader, Made with love by Bryan Herrera

Python-Mp3Mp4-Downloader Music and video downloader, Made with love by Bryan Herrera Requirements CHOCOLATELY windows command If your system does not

ርᚱ1ናተᛰ ᚻህᚥተპᚱ 104 Dec 27, 2022
Download Photo and Video from Wall of specific user or community

vkontakte-downloader Download Photo and Video from Wall of specific User or Community on https://vk.com Setup Clone the project git clone https://gith

null 4 Jul 20, 2022
Using Youtube downloader is the fast and easy way to download and save any YouTube video.

Youtube video downloader using Django Using Django as a backend along with pytube module to create Youtbue Video Downloader. https://yt-videos-downloa

Suman Raj Khanal 10 Jun 18, 2022
Simple Youtube Video Downloader

Simple Youtube Video Downloader Download Youtube video using link and Will output result in D:/ (You can change the path in main.py file) Installation

Hansen Gianto 1 Oct 28, 2021
the best video downloader for terminals (currently only compatible with Linux and Windows)

the best video downloader for terminals (currently only compatible with Linux and Windows)

Amaral 2 Oct 14, 2021
Youtube Downloader is a Graphic User Interface(GUI) that lets users download a Youtube Video or Audio through a URL

Youtube Downloader This Python and Tkinter based GUI allows users to directly download the Best Resolution Videos and Audios from Youtube. Pa-fy Insta

Samarth Kumar 2 Jun 25, 2022
Youtube Video Downloader Using Python Gui Appliction with progress Bar

Youtube-Video-Downloader Youtube Video Downloader Using Python Gui Appliction with progress Bar Module Used Pytube Tkinter Pil Urllib Bytes Io LICENSE

Community Programmer 6 Dec 19, 2022
Simple python script to download .mp3 formatted files from YouTube video URLs

Introduction: Simple python script to download .mp3 formatted files from YouTube video URLs Requirements: Requires: youtube_dl module Requires: ffmpeg

Pat 2 Aug 18, 2022
YT-Downloader is a Tool to download youtube video.

YT-Downloader YT-Downloader is a Tool to download youtube video.If you are looking for a simple video downloader tool Than This YT-Downloader may be u

Pradip Thapa 7 May 11, 2022
Download any video from YouTube playlists

youtube-dl Download any videos from YouTube playlists. Requirements Python 3 BeautifulSoup4 PyQt PyQtWebEngine pytube pyyoutube python-decouple Usage

Antonio Fortin 1 Oct 26, 2021
Smule Video Downloader

Smule Video Downloader Using Requests,Re & Urllib Installation - apt install git (for vps) or pkg install git (for termux)

Hansen Gianto 4 Aug 31, 2022
Python Youtube Video-Playlist Downloader

Youtube-Video-Playlist-Downloader-PyQt5 You can download videos and playlists on YouTube with this script. Script has GUI. Enjoy. Setup git clone http

Yunus Emre Öztürk 2 Jun 6, 2022