BMN: Boundary-Matching Network

Overview

BMN: Boundary-Matching Network

A pytorch-version implementation codes of paper: "BMN: Boundary-Matching Network for Temporal Action Proposal Generation", which is accepted in ICCV 2019.

[Arxiv Preprint]

Result

Update(2020-06-19): improved the pefermance. The new model can be download here. 提取码:nk3h

Update(2019-10-17): I update the pytorch BMN codebase according to PaddlePaddle code provided by Baidu officially. Now my codebase get very close results to the paper. Actually my results are slightly higher than the original paper. The model can be download here.

AN Recall
AR@1 33.6%
AR@5 49.9%
AR@10 57.1%
AR@100 75.5%
AUC 67.7

Prerequisites

These code is implemented in Pytorch 0.4.1 + Python3 .

Download Datasets

The author rescaled the feature length of all videos to same length 100, and he provided the rescaled feature at here .

Training and Testing of BMN

All configurations of BMN are saved in opts.py, where you can modify training and model parameter.

  1. To train the BMN:
python main.py --mode train
  1. To get the inference proposal of the validation videos and evaluate the proposals with recall and AUC:
python main.py --mode inference

Of course, you can complete all the process above in one line:

sh bmn.sh

Reference

This implementation largely borrows from BSN by Tianwei Lin.

code:BSN

paper:BMN: Boundary-Matching Network for Temporal Action Proposal Generation

Comments
  • Expected Performence

    Expected Performence

    Thanks for your work to implement BMN on PyTorch!

    May I ask, what is the model performance that you get?

    On my side, the AUC is 64.5% and AR@100 is 73.5. Please find the details below.

    I did not change any parameters before running the code. Minor typos were fixed.

    + python main.py --module Evaluation                                                                                                                                        
    [INIT] Loaded annotations from validation subset.                                                                                                     
            Number of ground truth instances: 7293                                                                                                                              
            Number of proposals: 472628                                                                                                                   
            Fixed threshold for tiou score: [0.5  0.55 0.6  0.65 0.7  0.75 0.8  0.85 0.9  0.95]                                                                                 
    [RESULTS] Performance on ActivityNet proposal task.                                                                                                   
            Area Under the AR vs AN curve: 64.50481283422461%                                                                                                                   
    /home/xum/anaconda3/envs/GTAL/lib/python3.7/site-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning:                                      
    Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version,                                                     a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior                               ensured, by passing a unique label to each axes instance.                                                                                                                   
      "Adding an axes using the same arguments as a previous axes "                                                                                       
    AR@1 is          0.30287947346770877                                                                                                                                        
    AR@5 is          0.43831070889894425                                                                                                                  
    AR@10 is         0.5157136980666392                                                                                                                                         
    AR@100 is        0.7352392705333882
    
    good first issue 
    opened by frostinassiky 13
  • about the length of temporal dimension?

    about the length of temporal dimension?

    Since the training used fixed length of the feature's temporal dimension (~100), is that can be used to unfixed the length of the temporal dimension? and how? thanks a lot.

    opened by semchan 10
  • nan tem_loss in the middle of the traing

    nan tem_loss in the middle of the traing

    Thank you for the great work!

    I tried your training program, and printed the loss after each batch. The loss seems correct in the beginning of the training, then "nan" values appear as shown in the following. Wonder if you guessed the possible reasons. ... BMN training loss(epoch 0): tem_loss: 1.184, pem class_loss: 0.458, pem reg_loss: 0.024, total_loss: 1.883 BMN training loss(epoch 0): tem_loss: 1.184, pem class_loss: 0.458, pem reg_loss: 0.024, total_loss: 1.884 BMN training loss(epoch 0): tem_loss: 1.184, pem class_loss: nan, pem reg_loss: 0.024, total_loss: nan BMN training loss(epoch 0): tem_loss: nan, pem class_loss: nan, pem reg_loss: 0.024, total_loss: nan

    Thanks!

    opened by yangsusanyang 5
  • the pth file cannot be decompressed

    the pth file cannot be decompressed

    i download the BMN_best.pth.tar from the BaiduYun(pan.baidu.com) link u provided, for 2 times, both cannot be decompressed.

    >tar -xvf BMN_best.pth.tar
    tar: Error opening archive: Unrecognized archive format
    

    Could u pls. help to check if the compressed file corrupted?

    opened by Light-- 5
  • Fix BMN model's structure

    Fix BMN model's structure

    Hi, I am a graduate student who is interseted in TAD and hope more communication. First, thank you for the implementation of BMN. I find BMN model's structure is not the same as introduced in the paper, so I checked the source code by Tianwei Lin. I think the output dimension of x_1d_p and input dimension of x_3d_p may be changed to 128(hidden_dim_2d) as follows: # Proposal Evaluation Module self.x_1d_p = nn.Sequential( nn.Conv1d(self.hidden_dim_1d, self.hidden_dim_2d, kernel_size=3, padding=1), nn.ReLU(inplace=True) ) self.x_3d_p = nn.Sequential( nn.Conv3d(self.hidden_dim_2d, self.hidden_dim_3d, kernel_size=(self.num_sample, 1, 1),stride=(self.num_sample, 1, 1)), nn.ReLU(inplace=True) ) Lin's source code in this link: https://github.com/PaddlePaddle/models/blob/release/1.8/PaddleCV/video/models/bmn/bmn_net.py#L141-L149

    Best wishes!

    opened by FuNian788 4
  • Non-ASCII character '\xe9' in file main.py

    Non-ASCII character '\xe9' in file main.py

    Maybe Chinese characters need to be handled...

    $ sh bmn.sh
      File "main.py", line 136
    SyntaxError: Non-ASCII character '\xe9' in file main.py on line 136, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
      File "main.py", line 136
    SyntaxError: Non-ASCII character '\xe9' in file main.py on line 136, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
    
    
    opened by Light-- 4
  • PEM loss=NaN

    PEM loss=NaN

    Thanks a lot for this code! I simply run the script to train BMN model. However I got PEM loss=NaN , and I find that label confidence is all 0. What 's wrong there?

    opened by yklilfft 4
  • The effect of temporal scale on this model and hyperparameters.

    The effect of temporal scale on this model and hyperparameters.

    In default BMN, the temporal scale is 100. if I want to generate 200*200 proposal map by feature with 200-length, need I change some hyperparameters ?

    For instance, need I change the positive threshold of cls_pem_loss or three thresholds of reg_pem_loss ? Is there anything else that needs to be modified

    opened by takfate 3
  • About the label and the best_loss

    About the label and the best_loss

    谢谢你的工作,但是在你最新的代码中,opt文件中的"video_info_backup.csv"文件和"anet_anno_action_backup.json"文件好像没有提供,使用的还是之前的label文件? 另外一个问题是:在训练过程中,你使用了best_loss变量,按照我的理解,这应该是一个局部变量,每一个epoch都会初始化为一个极大的值,而每一次保存都是会保存当前epoch的参数?请你确认一下。

    opened by doudou123456 2
  • How does the author turn unequal video into equal length? rescaled the feature length of all videos to same length 100,

    How does the author turn unequal video into equal length? rescaled the feature length of all videos to same length 100,

    Is each video sampled at different intervals How does the author turn unequal video into equal length? rescaled the feature length of all videos to same length 100,

    opened by Niclaus233 2
  • about feature extraction

    about feature extraction

    Hi, thanks for the code. I'd like to try this on my own datasets, but when I was extracting features by using TSN, I can only get RGB.jpg and Flow_x_y.jpg. How can I get csv features which is used in your code? (like csv_mean_100/v_oOnKQgQZOZ0.csv) Or can I use jpg to do training and testing?

    opened by sunnymoon155 2
  • How to do CLASSIFICATION TASK with BMN work?

    How to do CLASSIFICATION TASK with BMN work?

    Hi! Thanks for your great work! I'd like to combine your algorithm with temporal action classification,but I have no idea to do it.Would you please give me some advice?

    opened by xianguo-dev 0
  • Training speed

    Training speed

    Good afternoon! Thank you very much for your work! It's great that the model is not only on paddlepaddle.

    Could you please share model training speed? I'm using a non-standard environment and would like to compare to the "original".

    opened by VitalyyBezuglyj 0
  • some questions...

    some questions...

    1. What is the meaning of featureframe,is it randomly extract from video then extract feature and reshape to (400,100)?
    2. i have generated featurefrom video,and i extract per frame from 200ms,the length of feature is unfixed because of unfixed video,how can i make its length to be fixed ?
    3. my dataset is hoi video,so the orginal label is (subject,object,relation),but in this project ,the label is action ,how can i present it?
    4. the means of temeporal_scale?
    opened by jojolee123 1
  • BMN model 没有完成分类任务吗?只完成proposal generation ?

    BMN model 没有完成分类任务吗?只完成proposal generation ?

    在网络模型的输入中没有发现类别label 信息的载入?太奇怪了,这样自己做一个数据集和修改都不知道从何处 下手。 现在我能把数据集做成 json 文件格式的样子,能够包含起始位置,类型信息等。可以指没看见label类别信息的映射~帮忙指点一下,按照我的理解。比如activitynet 有个200类别,最后肯定有一个分类模块。并且输入输出结果映射指导类别上

    opened by fangxu622 3
  • The number of temporal proposals.

    The number of temporal proposals.

    Thanks for sharing your code. I'd like to change the number of temporal proposals of the model, but I couldn't find this parameter. Would you please tell me the specific location?

    opened by Zoe-Ziyi 0
Owner
qinxin
qinxin
A Python implementation of the Locality Preserving Matching (LPM) method for pruning outliers in image matching.

LPM_Python A Python implementation of the Locality Preserving Matching (LPM) method for pruning outliers in image matching. The code is established ac

AoxiangFan 11 Nov 7, 2022
TransNet V2: Shot Boundary Detection Neural Network

TransNet V2: Shot Boundary Detection Neural Network This repository contains code for TransNet V2: An effective deep network architecture for fast sho

Tomáš Souček 212 Dec 27, 2022
Code for Boundary-Aware Segmentation Network for Mobile and Web Applications

BASNet Boundary-Aware Segmentation Network for Mobile and Web Applications This repository contain implementation of BASNet in tensorflow/keras. comme

Hamid Ali 8 Nov 24, 2022
Boundary IoU API (Beta version)

Boundary IoU API (Beta version) Bowen Cheng, Ross Girshick, Piotr Dollár, Alexander C. Berg, Alexander Kirillov [arXiv] [Project] [BibTeX] This API is

Bowen Cheng 177 Dec 29, 2022
Code for CVPR2021 paper "Learning Salient Boundary Feature for Anchor-free Temporal Action Localization"

AFSD: Learning Salient Boundary Feature for Anchor-free Temporal Action Localization This is an official implementation in PyTorch of AFSD. Our paper

Tencent YouTu Research 146 Dec 24, 2022
A public available dataset for road boundary detection in aerial images

Topo-boundary This is the official github repo of paper Topo-boundary: A Benchmark Dataset on Topological Road-boundary Detection Using Aerial Images

Zhenhua Xu 79 Jan 4, 2023
code for `Look Closer to Segment Better: Boundary Patch Refinement for Instance Segmentation`

Look Closer to Segment Better: Boundary Patch Refinement for Instance Segmentation (CVPR 2021) Introduction PBR is a conceptually simple yet effective

H.Chen 143 Jan 5, 2023
Generic Event Boundary Detection: A Benchmark for Event Segmentation

Generic Event Boundary Detection: A Benchmark for Event Segmentation We release our data annotation & baseline codes for detecting generic event bound

null 47 Nov 22, 2022
Out-of-boundary View Synthesis towards Full-frame Video Stabilization

Out-of-boundary View Synthesis towards Full-frame Video Stabilization Introduction | Update | Results Demo | Introduction This repository contains the

null 25 Oct 10, 2022
A pytorch-version implementation codes of paper: "BSN++: Complementary Boundary Regressor with Scale-Balanced Relation Modeling for Temporal Action Proposal Generation"

BSN++: Complementary Boundary Regressor with Scale-Balanced Relation Modeling for Temporal Action Proposal Generation A pytorch-version implementation

null 11 Oct 8, 2022
Qimera: Data-free Quantization with Synthetic Boundary Supporting Samples

Qimera: Data-free Quantization with Synthetic Boundary Supporting Samples This repository is the official implementation of paper [Qimera: Data-free Q

Kanghyun Choi 21 Nov 3, 2022
[AAAI-2021] Visual Boundary Knowledge Translation for Foreground Segmentation

Trans-Net Code for (Visual Boundary Knowledge Translation for Foreground Segmentation, AAAI2021). [https://ojs.aaai.org/index.php/AAAI/article/view/16

ZJU-VIPA 2 Mar 4, 2022
Boundary-preserving Mask R-CNN (ECCV 2020)

BMaskR-CNN This code is developed on Detectron2 Boundary-preserving Mask R-CNN ECCV 2020 Tianheng Cheng, Xinggang Wang, Lichao Huang, Wenyu Liu Video

Hust Visual Learning Team 178 Nov 28, 2022
A Weakly Supervised Amodal Segmenter with Boundary Uncertainty Estimation

Paper Khoi Nguyen, Sinisa Todorovic "A Weakly Supervised Amodal Segmenter with Boundary Uncertainty Estimation", accepted to ICCV 2021 Our code is mai

Khoi Nguyen 5 Aug 14, 2022
Finite difference solution of 2D Poisson equation. Can handle Dirichlet, Neumann and mixed boundary conditions.

Poisson-solver-2D Finite difference solution of 2D Poisson equation Current version can handle Dirichlet, Neumann, and mixed (combination of Dirichlet

Mohammad Asif Zaman 34 Dec 23, 2022
BADet: Boundary-Aware 3D Object Detection from Point Clouds (Pattern Recognition 2022)

BADet: Boundary-Aware 3D Object Detection from Point Clouds (Pattern Recognition

Rui Qian 17 Dec 12, 2022
An official PyTorch Implementation of Boundary-aware Self-supervised Learning for Video Scene Segmentation (BaSSL)

An official PyTorch Implementation of Boundary-aware Self-supervised Learning for Video Scene Segmentation (BaSSL)

Kakao Brain 72 Dec 28, 2022
the code for our CVPR 2021 paper Bilateral Grid Learning for Stereo Matching Network [BGNet]

BGNet This repository contains the code for our CVPR 2021 paper Bilateral Grid Learning for Stereo Matching Network [BGNet] Environment Python 3.6.* C

3DCV developer 87 Nov 29, 2022
Stacked Recurrent Hourglass Network for Stereo Matching

SRH-Net: Stacked Recurrent Hourglass Introduction This repository is supplementary material of our RA-L submission, which helps reviewers to understan

null 28 Jan 3, 2023