Giter VIP home page Giter VIP logo

video-shadow-detection's Introduction

Pytorch Lightning Implemented TVSD

This repo contains the Pytorch Lightning version "Triple-cooperative Video Shadow Detection, CVPR'21" based on Zhihao Chen's original Pytorch implemented TVSD written by Lihao Liu.

Instead of writing a lot of code for the training logic (such as data parallel on multiple GPUs, map tensors to GPU using .cuda() function, visualization using tensorboard, and so on), we will use the high-level PyTorch framework PyTorch Lightning to manage the training and testing logic. Moreover, we simplify the data loaders in the original repo to enhance the readability for video data preprocessing.

Requirement

cuda==11.1
cudnn==8.0

torch==1.9.0
pytorch-lightning==1.5.10
tensorboard==2.7.0
tensorboardX==2.5
apex==0.1 (download from https://github.com/NVIDIA/apex)

Usage

  1. Clone the repository:
git clone https://github.com/lihaoliu-cambridge/video-shadow-detection.git
cd video-shadow-detection
  1. Download and unzip Visha dataset, and put the unzipped Visha directory into the dataset directory:
./dataset/Visha
  1. Modify the configurations for data loader, model architecture, and training logic in:
./config/visha_tvsd_config.yaml
  1. Download the pre-trained weight for the model backbone resnext_101_32x4d.pth, and modify the path to this pre-trained weight in:
./model/resnext_modify/config.py
resnext_101_32_path = '[Your Project Directory]/backbone_pth/resnext_101_32x4d.pth'
  1. Train the model:
python train.py
  1. Run the tensorboard monitor and open the tensorboard link: (http://127.0.0.1:6006/) in your browser:
tensorboard --port=6006  --logdir=[Your Project Directory]/output/tensorboard/tvsd_visha
  1. After training, modify the generated checkpoint file path in test.py file, and then you can test the trained model:
python test.py  

Citation

@inproceedings{chen2021triple,
   title={Triple-cooperative video shadow detection},
   author={Chen, Zhihao and Wan, Liang and Zhu, Lei and Shen, Jia and Fu, Huazhu and Liu, Wennan and Qin, Jing},
   booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
   pages={2715--2724},
   year={2021}
}

video-shadow-detection's People

Contributors

lihaoliu-cambridge avatar

Stargazers

sketch avatar Guanhao Zhu avatar xuheny avatar EmilyM avatar  avatar Matt Franchi avatar  avatar  avatar Brian Pugh avatar Jiaying Lin avatar  avatar  avatar

Watchers

 avatar

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.