Home

Awesome

TorchCV: A PyTorch-Based Framework for Deep Learning in Computer Vision

@misc{you2019torchcv,
    author = {Ansheng You and Xiangtai Li and Zhen Zhu and Yunhai Tong},
    title = {TorchCV: A PyTorch-Based Framework for Deep Learning in Computer Vision},
    howpublished = {\url{https://github.com/donnyyou/torchcv}},
    year = {2019}
}

This repository provides source code for most deep learning based cv problems. We'll do our best to keep this repository up-to-date. If you do find a problem about this repository, please raise an issue or submit a pull request.

- Semantic Flow for Fast and Accurate Scene Parsing
- Code and models: https://github.com/lxtGH/SFSegNets

Implemented Papers

QuickStart with TorchCV

Now only support Python3.x, pytorch 1.3.

pip3 install -r requirements.txt
cd lib/exts
sh make.sh

Performances with TorchCV

All the performances showed below fully reimplemented the papers' results.

Image Classification

ModelTrainTestTop-1Top-5BSItersScripts
ResNet50trainval77.5493.5951230WResNet50
ResNet101trainval78.9494.5651230WResNet101
ShuffleNetV2x0.5trainval60.9082.54102440WShuffleNetV2x0.5
ShuffleNetV2x1.0trainval69.7188.91102440WShuffleNetV2x1.0
DFNetV1trainval70.9989.68102440WDFNetV1
DFNetV2trainval74.2291.61102440WDFNetV2

Semantic Segmentation

ModelBackboneTrainTestmIOUBSItersScripts
PSPNet3x3-Res101trainval78.2084WPSPNet
DeepLabV33x3-Res101trainval79.1384WDeepLabV3
ModelBackboneTrainTestmIOUPixelACCBSItersScripts
PSPNet3x3-Res50trainval41.5280.091615WPSPNet
DeepLabv33x3-Res50trainval42.1680.361615WDeepLabV3
PSPNet3x3-Res101trainval43.6081.301615WPSPNet
DeepLabv33x3-Res101trainval44.1381.421615WDeepLabV3

Object Detection

ModelBackboneTrainTestmAPBSEpochsScripts
SSD300VGG1607+12_trainval07_test0.78632235SSD300
SSD512VGG1607+12_trainval07_test0.80832235SSD512
Faster R-CNNVGG1607_trainval07_test0.706115Faster R-CNN

Pose Estimation

Instance Segmentation

Generative Adversarial Networks

DataSets with TorchCV

TorchCV has defined the dataset format of all the tasks which you could check in the subdirs of data. Following is an example dataset directory trees for training semantic segmentation. You could preprocess the open datasets with the scripts in folder data/seg/preprocess

Dataset
    train
        image
            00001.jpg/png
            00002.jpg/png
            ...
        label
            00001.png
            00002.png
            ...
    val
        image
            00001.jpg/png
            00002.jpg/png
            ...
        label
            00001.png
            00002.png
            ...

Commands with TorchCV

Take PSPNet as an example. ("tag" could be any string, include an empty one.)

cd scripts/seg/cityscapes/
bash run_fs_pspnet_cityscapes_seg.sh train tag
cd scripts/seg/cityscapes/
bash run_fs_pspnet_cityscapes_seg.sh train tag
cd scripts/seg/cityscapes/
bash run_fs_pspnet_cityscapes_seg.sh val tag
cd scripts/seg/cityscapes/
bash run_fs_pspnet_cityscapes_seg.sh test tag

Demos with TorchCV

<div align="center"> <img src="demo/openpose/samples/000000319721_vis.png" width="500px"/> <p> Example output of <b>VGG19-OpenPose</b></p> <img src="demo/openpose/samples/000000475191_vis.png" width="500px"/> <p> Example output of <b>VGG19-OpenPose</b></p> </div>