# Pytorch-CV-backbones **Repository Path**: firslov/Pytorch_CV_backbones ## Basic Information - **Project Name**: Pytorch-CV-backbones - **Description**: A collection of several CV backbones. - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-02-04 - **Last Updated**: 2023-01-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: Python, Deep-learning, Computer-vision ## README # CV classifiers 本仓库包含多种cv分类模型的pytorch实现及若干实用工具,配置了统一的train及predict接口。 ## 网络列表 | 序号 | 网络名 | 序号 | 网络名 | 序号 | 网络名 | | ---- | --------- | ---- | ------------------ | ---- | ---------------- | | 1 | LeNet | 11 | ResNet101 | 21 | efficientnet_b2 | | 2 | AlexNet | 12 | ResNext50_32x4d | 22 | efficientnet_b3 | | 3 | Vgg11 | 13 | ResNext101_32x8d | 23 | efficientnet_b4 | | 4 | Vgg13 | 14 | MobileNetV2 | 24 | efficientnet_b5 | | 5 | Vgg16 | 15 | mobilenet_v3_small | 25 | efficientnet_b6 | | 6 | Vgg19 | 16 | mobilenet_v3_large | 26 | efficientnet_b7 | | 7 | GoogLeNet | 17 | shufflenet_v2_x0_5 | 27 | efficientnetv2_s | | 8 | ResNet18 | 18 | shufflenet_v2_x1_0 | 28 | efficientnetv2_m | | 9 | ResNet34 | 19 | efficientnet_b0 | 29 | efficientnetv2_l | | 10 | ResNet50 | 20 | efficientnet_b1 | | | 备注: - 网络名区分大小写 - GoogLeNet预测过程中实例化网络时,aux_logits设置为False以降低运算量 - efficientnetv1、efficientnetv2原论文中激活函数均为SiLU,只有pytorch1.7版本以上存在nn.SiLU,本仓库使用ReLU替代 - efficientnetv1、efficientnetv2采用特殊的图片预处理参数 ## 文件结构 - dataset 数据集 - flower_data 花分类数据集 - rose - tulip - ... - trafic_data 交通标志物数据集 - ... - dataproc 数据集划分脚本 - model_repo 模型仓库 - test_pics 测试图片 - weights 模型权重 - train.py 训练脚本 - predict.py 预测脚本 ## 使用 ### 安装 ```shell git clone --depth=1 https://github.com/firslov/CV_classifier_repo.git ``` ### 训练 ```shell python3 train.py arg1 arg2 arg3 ... # for example python3 train.py --model "Vgg16" --pre "self" --epochs 10 ``` 参数说明: | 参数 | 默认值 | 说明 | | ---------- | ------------------------------------- | ------------------------------------------------------------ | | model | AlexNet | 模型种类,使用简介中模型名称 | | dataDir | ./dataset/flower_data/flower_photos | 数据集路径 | | pre | '' | 预训练参数路径,默认不进行预训练,取值'self'时使用自训练权重 | | numcls | 5 | 类别数量 | | batchSize | 8 | - | | epochs | 1 | - | | numWorkers | 4 | - | | picsize | 224 | 规范化图片尺寸,EfficientNet需要适配 | ### 预测 ```shell python3 predict.py arg1 arg2 arg3 ... # for example python3 predict.py --pics 3.jpeg ``` 参数说明: | 参数 | 默认值 | 说明 | | ------- | --------- | ------------------------------------ | | model | AlexNet | 模型种类,使用简介中模型名称 | | pics | 1.jpeg | 预测图片,默认根路径./pics/ | | numcls | 5 | 类别数量 | | picsize | 224 | 规范化图片尺寸,EfficientNet需要适配 |