Coder Social home page Coder Social logo

sampler's Introduction

Task-adaptive Spatial-Temporal Video Sampler for Few-shot Action Recognition

Please refer to https://arxiv.org/abs/2207.09759 for this paper.

Introduction


A uniform sampler may overlook frames containing key actions. Critical regions involving the actors and objects may be too small to be properly recognized. (b) Our sampler can (I) select frames from an entire video that contribute most to few-shot recognition, (II) amplify discriminative regions in each frame. This sampling strategy is also dynamically adjusted for each video according to the episode task at hand.

Overview


Todo

  • Realease the ActivityNet dataset few-shot split file.
  • Realease the core part of Sampler.
  • Code of Sampler + ProtoNet.
  • Realease the whole training and inference code.
  • Sampler + TA2N/TRX/OTAM.

Usage

Example of spatial-temporal sampling from input query video set

from sampler import Selector

args = ArgsObject() # Refer to sampler.py for details of args
S = Selector(args).cuda()
input = torch.rand(args.way*args.shot*args.seq_len, 3, args.img_size, args.img_size).cuda() 
# Input: way*shot*frame, c, w, h
n, c, w, h = input.size()
print('Input Data shape:', input.shape)

# Indice: way*shot, k, len
indices,_,_,_,_,_ = S(input)
input = input.view(args.way*args.shot, args.seq_len, -1) 
# Output: way*shot, k, c*w*h
subset = torch.bmm(indices, input)
# Output: way*shot*k, c, w, h
subset = subset.view(-1, c, w, h)
print('Data shape output by sampler:', subset.shape)

Bibtex

If you find our work helpful for your research, please consider citing the following BibTeX entry.

@inproceedings{liu2022task,
  title={Task-adaptive Spatial-Temporal Video Sampler for Few-shot Action Recognition},
  author={Liu, Huabin and Lv, Weixian and See, John and Lin, Weiyao},
  booktitle={Proceedings of the 30th ACM International Conference on Multimedia},
  pages={6230--6240},
  year={2022}
}

Contact

Please feel free to contact [email protected] if you have any questions.

sampler's People

Contributors

r00kie-liu avatar

Stargazers

Yuanda avatar  avatar  avatar Xiaotian Ma avatar WFS avatar  avatar  avatar  avatar  avatar Hongyu Qu avatar Yiqin Wang 王逸钦 avatar AidenFan avatar

Watchers

Howard H. Tang avatar  avatar

Forkers

chuck-xu

sampler's Issues

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.