基于PyTorch的CV模型框架,北大學生出品TorchCV
在機器學習帶來的所有顛覆性技術中,計算機視覺領域吸引了業(yè)內人士和學術界最大的關注。
剛剛推出 1.3 正式版的 PyTorch 風頭正勁,人們已經圍繞這一深度學習框架開發(fā)出了越來越多的工具。最近,一個名為 TorchCV 的計算機視覺模型框架站上了 GitHub 趨勢榜。
項目鏈接:https://github.com/donnyyou/torchcv
該庫提供了基于深度學習的大部分 CV 問題研究的源代碼,對于使用者來說,調用最常用、最為先進的計算機模型從此可以變得更加容易。TorchCV 的作者 Donny You 來自北京大學,是機器感知與智能教育部重點實驗室的一名研三學生。
TorchCV 支持的模型
TorchCV 支持圖像分類、語義分割、目標檢測、姿態(tài)檢測、實例分割、生成對抗網(wǎng)絡等任務中的多個常見模型,列表如下:
圖像分類
- VGG: Very Deep Convolutional Networks for Large-Scale Image Recognition
- ResNet: Deep Residual Learning for Image Recognition
- DenseNet: Densely Connected Convolutional Networks
- ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices
- ShuffleNet V2: Practical Guidelines for Ecient CNN Architecture Design
- Partial Order Pruning: for Best Speed/Accuracy Trade-off in Neural Architecture Search
語義分割
- DeepLabV3: Rethinking Atrous Convolution for Semantic Image Segmentation
- PSPNet: Pyramid Scene Parsing Network
- DenseASPP: DenseASPP for Semantic Segmentation in Street Scenes
- Asymmetric Non-local Neural Networks for Semantic Segmentation
目標檢測
- SSD: Single Shot MultiBox Detector
- Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
- YOLOv3: An Incremental Improvement
- FPN: Feature Pyramid Networks for Object Detection
姿態(tài)檢測
- CPM: Convolutional Pose Machines
- OpenPose: Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields
實例分割
Mask R-CNN
生成對抗網(wǎng)絡
- Pix2pix: Image-to-Image Translation with Conditional Adversarial Nets
- CycleGAN: Unpaired Image-to-Image Translation using Cycle-Consistent
快速啟動 TorchCV
TorchCV 目前僅支持 Python3.x 和 pytorch 1.0。
- pip3 install -r requirements.txtcd extensions
- sh make.sh
利用 TorchCV 得到的模型性能數(shù)據(jù)
以下所示的性能數(shù)據(jù)完全復現(xiàn)了論文的結果。
圖像分類
語義分割
目標檢測
姿態(tài)估計
- OpenPose: Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields
實例分割
- Mask R-CNN
生成對抗網(wǎng)絡
- Pix2pix
- CycleGAN
TorchCV 的數(shù)據(jù)集
TorchCV 定義了你能在數(shù)據(jù)集子目錄中查到的所有任務的數(shù)據(jù)格式。下面是一個用于訓練語義分割的數(shù)據(jù)集目錄樹示例。你可以使用 datasets/seg/preprocess文件夾中的腳本對開源數(shù)據(jù)集進行預處理。
文件夾地址:https://github.com/donnyyou/torchcv/tree/master/datasets/seg/preprocess
TorchCV 的命令
項目作者提供了命令行工具,供用戶使用模型,代碼如下:
訓練
- 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
2019 年,PyTorch 正在逐漸趕超 TensorFlow,在研究領域成為最為流行的深度學習框架。隨著后者使用人數(shù)的增多,我們未來還會看到更多高效工具。