All Projects → KaiyangZhou → Pytorch Vsumm Reinforce

KaiyangZhou / Pytorch Vsumm Reinforce

Licence: mit
AAAI 2018 - Unsupervised video summarization with deep reinforcement learning (PyTorch)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pytorch Vsumm Reinforce

He4o
和(he for objective-c) —— “信息熵减机系统”
Stars: ✭ 284 (+0.35%)
Mutual labels:  reinforcement-learning, unsupervised-learning
Complete Life Cycle Of A Data Science Project
Complete-Life-Cycle-of-a-Data-Science-Project
Stars: ✭ 140 (-50.53%)
Mutual labels:  reinforcement-learning, unsupervised-learning
Awesome Artificial Intelligence
A curated list of Artificial Intelligence (AI) courses, books, video lectures and papers.
Stars: ✭ 6,516 (+2202.47%)
Mutual labels:  reinforcement-learning, unsupervised-learning
Flappy Es
Flappy Bird AI using Evolution Strategies
Stars: ✭ 140 (-50.53%)
Mutual labels:  reinforcement-learning, unsupervised-learning
Summary loop
Codebase for the Summary Loop paper at ACL2020
Stars: ✭ 26 (-90.81%)
Mutual labels:  reinforcement-learning, unsupervised-learning
Free Ai Resources
🚀 FREE AI Resources - 🎓 Courses, 👷 Jobs, 📝 Blogs, 🔬 AI Research, and many more - for everyone!
Stars: ✭ 192 (-32.16%)
Mutual labels:  reinforcement-learning, unsupervised-learning
Client
🔥 A tool for visualizing and tracking your machine learning experiments. This repo contains the CLI and Python API.
Stars: ✭ 3,570 (+1161.48%)
Mutual labels:  reinforcement-learning
Easy Tensorflow
Simple and comprehensive tutorials in TensorFlow
Stars: ✭ 2,871 (+914.49%)
Mutual labels:  reinforcement-learning
Vel
Velocity in deep-learning research
Stars: ✭ 267 (-5.65%)
Mutual labels:  reinforcement-learning
Pysc2 Agents
This is a simple implementation of DeepMind's PySC2 RL agents.
Stars: ✭ 262 (-7.42%)
Mutual labels:  reinforcement-learning
Sealion
The first machine learning framework that encourages learning ML concepts instead of memorizing class functions.
Stars: ✭ 278 (-1.77%)
Mutual labels:  unsupervised-learning
Sharpneat
SharpNEAT - Evolution of Neural Networks. A C# .NET Framework.
Stars: ✭ 273 (-3.53%)
Mutual labels:  reinforcement-learning
Drq
DrQ: Data regularized Q
Stars: ✭ 268 (-5.3%)
Mutual labels:  reinforcement-learning
Speechsplit
Unsupervised Speech Decomposition Via Triple Information Bottleneck
Stars: ✭ 266 (-6.01%)
Mutual labels:  unsupervised-learning
Rlgraph
RLgraph: Modular computation graphs for deep reinforcement learning
Stars: ✭ 272 (-3.89%)
Mutual labels:  reinforcement-learning
Dialog Generation Paper
A list of recent papers regarding dialogue generation
Stars: ✭ 265 (-6.36%)
Mutual labels:  reinforcement-learning
Handful Of Trials
Experiment code for "Deep Reinforcement Learning in a Handful of Trials using Probabilistic Dynamics Models"
Stars: ✭ 278 (-1.77%)
Mutual labels:  reinforcement-learning
Corex
CorEx or "Correlation Explanation" discovers a hierarchy of informative latent factors. This reference implementation has been superseded by other versions below.
Stars: ✭ 266 (-6.01%)
Mutual labels:  unsupervised-learning
Popular Rl Algorithms
PyTorch implementation of Soft Actor-Critic (SAC), Twin Delayed DDPG (TD3), Actor-Critic (AC/A2C), Proximal Policy Optimization (PPO), QT-Opt, PointNet..
Stars: ✭ 266 (-6.01%)
Mutual labels:  reinforcement-learning
Tensorforce
Tensorforce: a TensorFlow library for applied reinforcement learning
Stars: ✭ 3,062 (+981.98%)
Mutual labels:  reinforcement-learning

pytorch-vsumm-reinforce

This repo contains the Pytorch implementation of the AAAI'18 paper - Deep Reinforcement Learning for Unsupervised Video Summarization with Diversity-Representativeness Reward. The original Theano implementation can be found here.

train

The main requirements are pytorch (v0.4.0) and python 2.7. Some dependencies that may not be installed in your machine are tabulate and h5py. Please install other missing dependencies.

Get started

  1. Download preprocessed datasets
git clone https://github.com/KaiyangZhou/pytorch-vsumm-reinforce
cd pytorch-vsumm-reinforce
# download datasets.tar.gz (173.5MB)
wget http://www.eecs.qmul.ac.uk/~kz303/vsumm-reinforce/datasets.tar.gz
tar -xvzf datasets.tar.gz
  1. Make splits
python create_split.py -d datasets/eccv16_dataset_summe_google_pool5.h5 --save-dir datasets --save-name summe_splits  --num-splits 5

As a result, the dataset is randomly split for 5 times, which are saved as json file.

Train and test codes are written in main.py. To see the detailed arguments, please do python main.py -h.

How to train

python main.py -d datasets/eccv16_dataset_summe_google_pool5.h5 -s datasets/summe_splits.json -m summe --gpu 0 --save-dir log/summe-split0 --split-id 0 --verbose

How to test

python main.py -d datasets/eccv16_dataset_summe_google_pool5.h5 -s datasets/summe_splits.json -m summe --gpu 0 --save-dir log/summe-split0 --split-id 0 --evaluate --resume path_to_your_model.pth.tar --verbose --save-results

If argument --save-results is enabled, output results will be saved to results.h5 under the same folder specified by --save-dir. To visualize the score-vs-gtscore, simple do

python visualize_results.py -p path_to/result.h5

Plot

We provide codes to plot the rewards obtained at each epoch. Use parse_log.py to plot the average rewards

python parse_log.py -p path_to/log_train.txt

The plotted image would look like

overall_reward

If you wanna plot the epoch-reward curve for some specific videos, do

python parse_json.py -p path_to/rewards.json -i 0

You will obtain images like

epoch_reward epoch_reward epoch_reward

If you prefer to visualize the epoch-reward curve for all training videos, try parse_json.sh. Modify the code according to your purpose.

Visualize summary

You can use summary2video.py to transform the binary machine_summary to real summary video. You need to have a directory containing video frames. The code will automatically write summary frames to a video where the frame rate can be controlled. Use the following command to generate a .mp4 video

python summary2video.py -p path_to/result.h5 -d path_to/video_frames -i 0 --fps 30 --save-dir log --save-name summary.mp4

Please remember to specify the naming format of your video frames on this line.

How to use your own data

We preprocess data by extracting image features for videos and save them to h5 file. The file format looks like this. After that, you can make split via create_split.py. If you wanna train policy network using the entire dataset, just do train_keys = dataset.keys(). Here is the code where we initialize dataset. If you have any problems, feel free to contact me by email or raise an issue.

Citation

@article{zhou2017reinforcevsumm, 
   title={Deep Reinforcement Learning for Unsupervised Video Summarization with Diversity-Representativeness Reward},
   author={Zhou, Kaiyang and Qiao, Yu and Xiang, Tao}, 
   journal={arXiv:1801.00054}, 
   year={2017} 
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].