wuhang / SRN_multilabel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spatial Regularization Network

This repository contains testing code and trained models for

Feng Zhu, Hongsheng Li, Wanli Ouyang, Nenghai Yu, Xiaogang Wang, "Learning Spatial Regularization with Image-level Supervisions for Multi-label Image Classification", CVPR 2017. pdf.

Directories and Files

  • caffe/: an early version of Yuanjun Xiong's caffe, with OpenMPI-based Multi-GPU support.
  • tools/: demo code for model testing and evaluation.
  • run_test.sh: script for model testing.
  • evaluation.m: matlab code for classification results evaluation.

Prepare data

  • Download train/test split files for NUS-WIDE, MS-COCO and WIDR-Attribute, and extract it to datasets/.
  • Download dataset images
    • NUS-WIDE: this dataset contains many untagged images, and some download links are invalid now. By removing invalid and untagged images, we finally get 119,986 images for training and 80,283 images for testing.
    • MS-COCO_2014: 82,783 images in "train2014" for training, and 40,504 images in "val2014" for testing.
    • WIDER-Attribute: original images are provided here, cropped images for each human bounding box can be downloaded here. 28,340 cropped images in "train" and "val" for training, 29,177 cropped images in "test" for testing.
  • Download trained models (Google Drive, BaiduYun), and extract it to models/
    • the released models containing:
      • trained models for NUS-WIDE, MS-COCO and WIDR-Attribute.
      • a ResNet-101 model pretrained on ImageNet.
  • (Optional) Download reference classification results, and extract it to results/.

Build

See Yuanjun Xiong's github for building this version of caffe.

Run Test

  • Edit run_test.sh
    • uncomment to specify settings of one dataset.
    • modify variable "ROOT": the root directory holding images of each dataset.
    • modify parameters of "--gpus" to specify available gpus for testing.
  • Edit tools/model_test.py
    • add "path to your caffe" to the search path of python at line 4.

Run Training

  • Download training scripts, and extract it to training_script/.

  • Edit paths in the scripts.

  • using 'run_train_[datasetname].sh' to train models on one specific dataset.

Evaluation

About


Languages

Language:Jupyter Notebook 50.2%Language:C++ 39.4%Language:Python 4.8%Language:Cuda 2.7%Language:CMake 1.5%Language:MATLAB 0.6%Language:Makefile 0.3%Language:Shell 0.3%Language:CSS 0.1%Language:HTML 0.1%