Giter Club home page Giter Club logo

clip-tsa's Introduction

Oral Presentation

The repository discusses the implementation of the paper
"CLIP-TSA: CLIP-Assisted Temporal Self-Attention for Weakly-Supervised Video Anomaly Detection"
using the PyTorch framework.

Paper

CLIP-TSA: CLIP-Assisted Temporal Self-Attention for Weakly-Supervised Video Anomaly Detection (Oral, ICIP 2023)

Kevin Hyekang Joo, Khoa Vo, Kashu Yamazaki, Ngan Le

Requirements

  • pytorch
  • matplotlib
  • tqdm
  • scipy
  • scikit-learn

CLIP Features

FAQ

Q1) I get the following error: "RuntimeError: Expected a 'cuda' device type for generator but found 'cpu'"

  • A1) Please go to venv/lib/python3.8/site-packages/torch/utils/data/sampler.py, and find __iter__ function within RandomSampler class. Then change the line generator = torch.Generator() to generator = torch.Generator(device="cuda").

Q2) I keep getting CUDA OUT OF MEMORY error

  • A2) Each dataset requires varying amounts of VRAM, and a significant amount of VRAM is expected to be used with the TSA feature enabled. Thus, please be advised if you want to run tests on big public datasets such as ShanghaiTech Campus, XD-Violence, and UCF-Crime Datasets. If you would like to test out only the power of CLIP within the model, please disable the TSA by adding --disable_HA to the command, which requires less amount of VRAM and should be operable on most GPUs.

How to Run

python main.py

Please change the hyperparameters & parameters accordingly by first looking at the main.py file. Otherwise, it will be run under default settings.


Citations

@inproceedings{joo2023cliptsa,
  title={CLIP-TSA: CLIP-Assisted Temporal Self-Attention for Weakly-Supervised Video Anomaly Detection},
  author={Joo, Hyekang Kevin and Vo, Khoa and Yamazaki, Kashu and Le, Ngan},
  doi={10.1109/ICIP49359.2023.10222289},
  url={https://ieeexplore.ieee.org/document/10222289}
  publisher={IEEE International Conference on Image Processing (ICIP)},
  pages={3230--3234},
  year={2023},
  organization={IEEE}
}

Contacts

Kevin Hyekang Joo - [email protected] or [email protected]


The codes have been adapted in part from Yu Tian's RTFM.

clip-tsa's People

Contributors

joos2010kj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

clip-tsa's Issues

Congrats on the nice work!

Congrats on the nice work!

I have a small question on the extracted CLIP features. It seems that in your provided CLIP features, the testing set of UCF Crime dataset is not complete? Could you provide the complete version? Thanks so much.

image

I would appreciate it very much if you could reply.

Feature-extraction and pre-processing code

Hi @joos2010kj,

Is it possible for you to share the code/repositories used for feature extraction and pre-processing? Essentially, the code that could help in generating the features that are to be fed during training/evaluation.

Thank you

about gpu?

@joos2010kj hello great work ! I have encountered an issue with insufficient GPU memory and I have tried more gpus to train,such as CUDA_VISIBLE_DEVICES= 0,1,2 python. But it doesn't work,why? Why does using multiple GPUs for training still encounter this problem?

missing file in xdv trainset

Hello

in the xdv train set , there a video missing its npy:
v=8cTqh9tMz_I__#1_label_A

which match the error i got when extracting the actual available files
ERROR: Data Error : v=8cTqh9tMz_I__#1_label_A.mp4

maybe be useful for others,

if in the middletime i find the original mp4, i can upload

cheers

Feature Extraction

Would you share the features of the dataset you extracted with vit? Is there any reference code in the extraction process?

About the codes and features

Nice works!
Have you considered releasing the Clip visual features extracted from UCF Crime and XD violence so that people can follow them better :)

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.