README.md
July 9, 2022 ยท View on GitHub
HGPU
Code for paper: Hierarchical Graph Pattern Understanding for Zero-Shot Video Object Segmentation

Requirements
-
Python (3.6.12)
-
PyTorch (version:1.7.0)
-
Apex (https://github.com/NVIDIA/apex, version: 0.1)
-
Requirements in the requirements.txt files.
Training
Download Datasets
- Download the DAVIS-2017 dataset from DAVIS.
- Download the YouTube-VOS dataset from YouTube-VOS, the validation set is not mandatory to download.
- Download the YouTube2018-hed and davis-hed datasets.
- The optical flow files are obtained by RAFT, we provide demo code that can be run directly on path
flow. We also provide optical flow of YouTube-VOS (18G) in GoogleDrive, optical flow of DAVIS can be found in GoogleDrive.
Dataset Format
Please ensure the datasets are organized as following format.
YouTube-VOS
|----train
|----Annotations
|----JPEGImages
|----YouTube-flow
|----YouTube-hed
|----meta.json
DAVIS
|----Annotations
|----ImageSets
|----JPEGImages
|----davis-flow
|----davis-hed
Run train.py
We provide multi-GPU parallel code based on apex.
Run CUDA_VISIBLE_DEVICES="0,1,2,3" python -m torch.distributed.launch --nproc_per_node 4 train_HGPU.py for distributed training in Pytorch.
Note:
Please change your dada path in two codes (libs/utils/config_davis.py in line 52, and libs/utils/config_youtubevos.py in line 38)
Testing & Results
If you want to test the model results directly, you can follow the settings below.
- Pre-trained models and pre-calculated results.
| Dataset | J Mean | Pre-trained Model | Pre-calculated Mask |
|---|---|---|---|
| DAVIS-16 | 86.0 full-training; 78.6 pre-training; 80.3 main-training | [full-training]; [pre-training]; [main-training] | [DAVIS-16] |
| Youtube-Objects | 73.9 (average 10 category levels) | without fine-tuning | [YouTube-Objects] |
| Long-Videos | 74.0 | without fine-tuning | [Long-Videos] |
| DAVIS-17 | 67.0 | [DAVIS-17] | [DAVIS-17] |
-
Change your path in
test_HGPU.py, then runpython test_HGPU.py. -
Run
python apply_densecrf_davis.py(change your path in line 16) for getting binary masks.
The code directory structure is as follows.
HGPU
|----flow
|----libs
|----model
|----HGPU
|----encoder_0.8394088008745166.pt
|----decoder_0.8394088008745166.pt
|....
|----apply_densecrf_davis.py
|----train_HGPU.py
|----test_HGPU.py
-
Evaluation code from DAVIS_Evaluation, the python version is available at PyDavis16EvalToolbox.
-
The YouTube-Objects dataset can be downloaded from here and annotation can be found here.
-
The Long-Videos dataset can be downloaded from here.
Supplementary
- PWCNet is used to compute optical flow estimation for HGPU training, and the pre-trained model and inference results are in here.
Acknowledge
- Zero-shot Video Object Segmentation via Attentive Graph Neural Networks, ICCV 2019 (https://github.com/carrierlxk/AGNN)
- Motion-Attentive Transition for Zero-Shot Video Object Segmentation, AAAI 2020 (https://github.com/tfzhou/MATNet)
- Video Object Segmentation Using Space-Time Memory Networks, ICCV 2019 (https://github.com/seoungwugoh/STM)
- Video Object Segmentation with Adaptive Feature Bank and Uncertain-Region Refinement, NeurIPS 2020 (https://github.com/xmlyqing00/AFB-URR)