0


基于yolov5s+bifpn实践隧道裂缝裂痕检测

yolov5系列自诞生已经持续迭代了很多个版本了,目前官方开发者迭代的最新版本是v6.2,已经覆盖了分类、检测盒分割三大主流CV任务了,基于yolov5融合各种tricks是很多开发者或者是学生喜欢做的事情,基于yolov5也已经诞生了很多学术文章了,bifpn是一种比较有效的特征融合技术,最早在efficientnet中提出,之后很多网络也都有尝试进行融合,今天正好有时间就想着,基于yolov5来开发融合bifpn的目标检测模型,用于隧道内的裂缝裂痕检测。

首先看下最终的效果图,如下所示:

为了整体直观,这里专门是开发了对应的界面,方便使用的。

完整项目截图如下所示:

下表是对整个项目中各个文件的介绍说明:
文件名称文件说明dataset/数据集目录models/模型配置目录runs/模型结果目录utils/公共组件目录data/数据参数目录weights/预训练权重目录app.gifapp效果动图demo.gif检测样例动图detect.py检测推理模块export.py模型转化模块guiAPP.pyAPP模块inference.py离线推理精简模块logs.out训练日志startAPP.bat双击启动APP脚本test.jpg测试样例图片train.py训练模块val.py评估模块yolov5s.onnxyolov5s原生模型yolov5s.ptyolov5s原生模型yolov5s-bifpn.onnxyolov5s-bifpn模型yolov5s-bifpn.ptyolov5s-bifpn模型
data目录如下所示:

logo是用于界面的这个不用管,可以根据自己需要直接替换接口,self.yaml是我们编写的用于训练的数据配置,如下:

其他的都是项目自带的这里就不再介绍了。

dataset是我们构建的训练集-测试集目录。数据样例如下所示:

models目录如下所示:

yolov5s.yaml和yolov5s_bifpn.yaml分别表示原生的yolov5s模型和融合bifpn的yolov5s模型,这里以原生的yolov5s为例,如下:

这里需要修改nc。

runs是项目运行自动创建的结果存储目录。

utils是项目公用组件目录。

weights是用于存放预训练权重的目录。

启动train.py模块即可执行模型的训练计算,日志输出如下:

Starting training for 100 epochs...

     Epoch   gpu_mem       box       obj       cls    labels  img_size

  0%|          | 0/59 [00:00<?, ?it/s]
      0/99     6.29G     0.122    0.0985         0       611       640:   0%|          | 0/59 [00:03<?, ?it/s]
      0/99     6.29G     0.122    0.0985         0       611       640:   2%|▏         | 1/59 [00:05<05:28,  5.67s/it]
      0/99     6.35G    0.1225    0.1005         0       699       640:   2%|▏         | 1/59 [00:09<05:28,  5.67s/it]
      0/99     6.35G    0.1225    0.1005         0       699       640:   3%|▎         | 2/59 [00:09<04:08,  4.36s/it]
      0/99     6.35G    0.1221    0.1014         0       655       640:   3%|▎         | 2/59 [00:12<04:08,  4.36s/it]
      0/99     6.35G    0.1221    0.1014         0       655       640:   5%|▌         | 3/59 [00:12<03:39,  3.92s/it]
      0/99     6.35G    0.1219    0.1022         0       671       640:   5%|▌         | 3/59 [00:15<03:39,  3.92s/it]
      0/99     6.35G    0.1219    0.1022         0       671       640:   7%|▋         | 4/59 [00:15<03:24,  3.72s/it]
      0/99     6.35G    0.1216    0.1006         0       573       640:   7%|▋         | 4/59 [00:19<03:24,  3.72s/it]
      0/99     6.35G    0.1216    0.1006         0       573       640:   8%|▊         | 5/59 [00:19<03:18,  3.68s/it]
      0/99     6.35G    0.1216    0.1013         0       676       640:   8%|▊         | 5/59 [00:23<03:18,  3.68s/it]
      0/99     6.35G    0.1216    0.1013         0       676       640:  10%|█         | 6/59 [00:23<03:15,  3.69s/it]
      0/99     6.35G    0.1215    0.1015         0       688       640:  10%|█         | 6/59 [00:26<03:15,  3.69s/it]
      0/99     6.35G    0.1215    0.1015         0       688       640:  12%|█▏        | 7/59 [00:26<03:07,  3.61s/it]
      0/99     6.35G    0.1213    0.1026         0       710       640:  12%|█▏        | 7/59 [00:29<03:07,  3.61s/it]
      0/99     6.35G    0.1213    0.1026         0       710       640:  14%|█▎        | 8/59 [00:29<02:59,  3.51s/it]
      0/99     6.35G     0.121    0.1038         0       701       640:  14%|█▎        | 8/59 [00:33<02:59,  3.51s/it]
      0/99     6.35G     0.121    0.1038         0       701       640:  15%|█▌        | 9/59 [00:33<02:52,  3.45s/it]
      0/99     6.35G    0.1208    0.1039         0       624       640:  15%|█▌        | 9/59 [00:36<02:52,  3.45s/it]
      0/99     6.35G    0.1208    0.1039         0       624       640:  17%|█▋        | 10/59 [00:36<02:46,  3.40s/it]
      0/99     6.35G    0.1207    0.1047         0       812       640:  17%|█▋        | 10/59 [00:40<02:46,  3.40s/it]
      0/99     6.35G    0.1207    0.1047         0       812       640:  19%|█▊        | 11/59 [00:40<02:45,  3.44s/it]
      0/99     6.35G    0.1203    0.1041         0       537       640:  19%|█▊        | 11/59 [00:43<02:45,  3.44s/it]
      0/99     6.35G    0.1203    0.1041         0       537       640:  20%|██        | 12/59 [00:43<02:41,  3.44s/it]
      0/99     6.35G    0.1197    0.1042         0       537       640:  20%|██        | 12/59 [00:46<02:41,  3.44s/it]
      0/99     6.35G    0.1197    0.1042         0       537       640:  22%|██▏       | 13/59 [00:46<02:36,  3.41s/it]
      0/99     6.35G    0.1193    0.1054         0       650       640:  22%|██▏       | 13/59 [00:50<02:36,  3.41s/it]
      0/99     6.35G    0.1193    0.1054         0       650       640:  24%|██▎       | 14/59 [00:50<02:32,  3.38s/it]
      0/99     6.35G    0.1189     0.105         0       549       640:  24%|██▎       | 14/59 [00:53<02:32,  3.38s/it]
      0/99     6.35G    0.1189     0.105         0       549       640:  25%|██▌       | 15/59 [00:53<02:31,  3.44s/it]
      0/99     6.35G    0.1189    0.1053         0       767       640:  25%|██▌       | 15/59 [00:57<02:31,  3.44s/it]
      0/99     6.35G    0.1189    0.1053         0       767       640:  27%|██▋       | 16/59 [00:57<02:30,  3.51s/it]
      0/99     6.35G    0.1185    0.1055         0       634       640:  27%|██▋       | 16/59 [01:00<02:30,  3.51s/it]
      0/99     6.35G    0.1185    0.1055         0       634       640:  29%|██▉       | 17/59 [01:00<02:26,  3.48s/it]
      0/99     6.35G    0.1181    0.1054         0       597       640:  29%|██▉       | 17/59 [01:04<02:26,  3.48s/it]
      0/99     6.35G    0.1181    0.1054         0       597       640:  31%|███       | 18/59 [01:04<02:20,  3.43s/it]
      0/99     6.35G    0.1179    0.1065         0       794       640:  31%|███       | 18/59 [01:07<02:20,  3.43s/it]
      0/99     6.35G    0.1179    0.1065         0       794       640:  32%|███▏      | 19/59 [01:07<02:16,  3.40s/it]
      0/99     6.35G    0.1175    0.1059         0       545       640:  32%|███▏      | 19/59 [01:10<02:16,  3.40s/it]
      0/99     6.35G    0.1175    0.1059         0       545       640:  34%|███▍      | 20/59 [01:10<02:11,  3.38s/it]
      0/99     6.35G    0.1171    0.1052         0       522       640:  34%|███▍      | 20/59 [01:14<02:11,  3.38s/it]
      0/99     6.35G    0.1171    0.1052         0       522       640:  36%|███▌      | 21/59 [01:14<02:07,  3.35s/it]
      0/99     6.35G    0.1167    0.1047         0       505       640:  36%|███▌      | 21/59 [01:17<02:07,  3.35s/it]
      0/99     6.35G    0.1167    0.1047         0       505       640:  37%|███▋      | 22/59 [01:17<02:05,  3.38s/it]
      0/99     6.35G    0.1164    0.1052         0       697       640:  37%|███▋      | 22/59 [01:21<02:05,  3.38s/it]
      0/99     6.35G    0.1164    0.1052         0       697       640:  39%|███▉      | 23/59 [01:21<02:04,  3.47s/it]
      0/99     6.35G    0.1161    0.1057         0       765       640:  39%|███▉      | 23/59 [01:24<02:04,  3.47s/it]
      0/99     6.35G    0.1161    0.1057         0       765       640:  41%|████      | 24/59 [01:24<02:02,  3.50s/it]
      0/99     6.35G    0.1158    0.1062         0       722       640:  41%|████      | 24/59 [01:28<02:02,  3.50s/it]
      0/99     6.35G    0.1158    0.1062         0       722       640:  42%|████▏     | 25/59 [01:28<01:56,  3.43s/it]
      0/99     6.35G    0.1155    0.1062         0       653       640:  42%|████▏     | 25/59 [01:31<01:56,  3.43s/it]
      0/99     6.35G    0.1155    0.1062         0       653       640:  44%|████▍     | 26/59 [01:31<01:52,  3.40s/it]
      0/99     6.35G    0.1152    0.1061         0       693       640:  44%|████▍     | 26/59 [01:34<01:52,  3.40s/it]
      0/99     6.35G    0.1152    0.1061         0       693       640:  46%|████▌     | 27/59 [01:34<01:47,  3.37s/it]
      0/99     6.35G    0.1149    0.1056         0       629       640:  46%|████▌     | 27/59 [01:38<01:47,  3.37s/it]
      0/99     6.35G    0.1149    0.1056         0       629       640:  47%|████▋     | 28/59 [01:38<01:43,  3.35s/it]
      0/99     6.35G    0.1146     0.105         0       603       640:  47%|████▋     | 28/59 [01:41<01:43,  3.35s/it]
      0/99     6.35G    0.1146     0.105         0       603       640:  49%|████▉     | 29/59 [01:41<01:40,  3.35s/it]
      0/99     6.35G    0.1141    0.1045         0       521       640:  49%|████▉     | 29/59 [01:44<01:40,  3.35s/it]
      0/99     6.35G    0.1141    0.1045         0       521       640:  51%|█████     | 30/59 [01:44<01:39,  3.42s/it]
      0/99     6.35G    0.1138    0.1047         0       748       640:  51%|█████     | 30/59 [01:49<01:39,  3.42s/it]
      0/99     6.35G    0.1138    0.1047         0       748       640:  53%|█████▎    | 31/59 [01:49<01:40,  3.60s/it]
      0/99     6.35G    0.1134    0.1044         0       581       640:  53%|█████▎    | 31/59 [01:52<01:40,  3.60s/it]
      0/99     6.35G    0.1134    0.1044         0       581       640:  54%|█████▍    | 32/59 [01:52<01:34,  3.51s/it]
      0/99     6.35G     0.113    0.1041         0       579       640:  54%|█████▍    | 32/59 [01:55<01:34,  3.51s/it]
      0/99     6.35G     0.113    0.1041         0       579       640:  56%|█████▌    | 33/59 [01:55<01:29,  3.44s/it]
      0/99     6.35G    0.1126    0.1042         0       720       640:  56%|█████▌    | 33/59 [01:58<01:29,  3.44s/it]
      0/99     6.35G    0.1126    0.1042         0       720       640:  58%|█████▊    | 34/59 [01:58<01:24,  3.39s/it]
      0/99     6.35G    0.1122    0.1039         0       603       640:  58%|█████▊    | 34/59 [02:02<01:24,  3.39s/it]
      0/99     6.35G    0.1122    0.1039         0       603       640:  59%|█████▉    | 35/59 [02:02<01:20,  3.36s/it]
      0/99     6.35G    0.1119    0.1037         0       702       640:  59%|█████▉    | 35/59 [02:05<01:20,  3.36s/it]
      0/99     6.35G    0.1119    0.1037         0       702       640:  61%|██████    | 36/59 [02:05<01:18,  3.41s/it]
      0/99     6.35G    0.1115    0.1036         0       616       640:  61%|██████    | 36/59 [02:09<01:18,  3.41s/it]
      0/99     6.35G    0.1115    0.1036         0       616       640:  63%|██████▎   | 37/59 [02:09<01:16,  3.50s/it]
      0/99     6.35G    0.1111    0.1034         0       655       640:  63%|██████▎   | 37/59 [02:12<01:16,  3.50s/it]
      0/99     6.35G    0.1111    0.1034         0       655       640:  64%|██████▍   | 38/59 [02:12<01:13,  3.49s/it]
      0/99     6.35G    0.1107    0.1036         0       728       640:  64%|██████▍   | 38/59 [02:16<01:13,  3.49s/it]
      0/99     6.35G    0.1107    0.1036         0       728       640:  66%|██████▌   | 39/59 [02:16<01:08,  3.44s/it]
      0/99     6.35G    0.1103    0.1038         0       801       640:  66%|██████▌   | 39/59 [02:19<01:08,  3.44s/it]
      0/99     6.35G    0.1103    0.1038         0       801       640:  68%|██████▊   | 40/59 [02:19<01:04,  3.40s/it]
      0/99     6.35G      0.11    0.1038         0       723       640:  68%|██████▊   | 40/59 [02:22<01:04,  3.40s/it]
      0/99     6.35G      0.11    0.1038         0       723       640:  69%|██████▉   | 41/59 [02:22<01:00,  3.37s/it]
      0/99     6.35G    0.1096    0.1034         0       555       640:  69%|██████▉   | 41/59 [02:26<01:00,  3.37s/it]
      0/99     6.35G    0.1096    0.1034         0       555       640:  71%|███████   | 42/59 [02:26<00:57,  3.36s/it]
      0/99     6.35G    0.1093    0.1034         0       642       640:  71%|███████   | 42/59 [02:29<00:57,  3.36s/it]
      0/99     6.35G    0.1093    0.1034         0       642       640:  73%|███████▎  | 43/59 [02:29<00:54,  3.43s/it]
      0/99     6.35G    0.1089    0.1032         0       632       640:  73%|███████▎  | 43/59 [02:33<00:54,  3.43s/it]
      0/99     6.35G    0.1089    0.1032         0       632       640:  75%|███████▍  | 44/59 [02:33<00:52,  3.47s/it]
      0/99     6.35G    0.1085     0.103         0       544       640:  75%|███████▍  | 44/59 [02:36<00:52,  3.47s/it]
      0/99     6.35G    0.1085     0.103         0       544       640:  76%|███████▋  | 45/59 [02:36<00:47,  3.41s/it]
      0/99     6.35G    0.1081    0.1025         0       485       640:  76%|███████▋  | 45/59 [02:39<00:47,  3.41s/it]
      0/99     6.35G    0.1081    0.1025         0       485       640:  78%|███████▊  | 46/59 [02:39<00:43,  3.38s/it]
      0/99     6.35G    0.1077    0.1023         0       600       640:  78%|███████▊  | 46/59 [02:43<00:43,  3.38s/it]
      0/99     6.35G    0.1077    0.1023         0       600       640:  80%|███████▉  | 47/59 [02:43<00:40,  3.35s/it]
      0/99     6.35G    0.1073     0.102         0       513       640:  80%|███████▉  | 47/59 [02:46<00:40,  3.35s/it]
      0/99     6.35G    0.1073     0.102         0       513       640:  81%|████████▏ | 48/59 [02:46<00:36,  3.34s/it]
      0/99     6.35G    0.1069    0.1019         0       522       640:  81%|████████▏ | 48/59 [02:49<00:36,  3.34s/it]
      0/99     6.35G    0.1069    0.1019         0       522       640:  83%|████████▎ | 49/59 [02:49<00:33,  3.35s/it]
      0/99     6.35G    0.1065     0.102         0       687       640:  83%|████████▎ | 49/59 [02:53<00:33,  3.35s/it]
      0/99     6.35G    0.1065     0.102         0       687       640:  85%|████████▍ | 50/59 [02:53<00:30,  3.43s/it]
      0/99     6.35G    0.1061    0.1018         0       541       640:  85%|████████▍ | 50/59 [02:57<00:30,  3.43s/it]
      0/99     6.35G    0.1061    0.1018         0       541       640:  86%|████████▋ | 51/59 [02:57<00:28,  3.52s/it]
      0/99     6.35G    0.1058    0.1017         0       615       640:  86%|████████▋ | 51/59 [03:00<00:28,  3.52s/it]
      0/99     6.35G    0.1058    0.1017         0       615       640:  88%|████████▊ | 52/59 [03:00<00:24,  3.49s/it]
      0/99     6.35G    0.1055    0.1018         0       781       640:  88%|████████▊ | 52/59 [03:03<00:24,  3.49s/it]
      0/99     6.35G    0.1055    0.1018         0       781       640:  90%|████████▉ | 53/59 [03:03<00:20,  3.44s/it]
      0/99     6.35G    0.1052    0.1017         0       586       640:  90%|████████▉ | 53/59 [03:07<00:20,  3.44s/it]
      0/99     6.35G    0.1052    0.1017         0       586       640:  92%|█████████▏| 54/59 [03:07<00:16,  3.39s/it]
      0/99     6.35G    0.1049    0.1016         0       575       640:  92%|█████████▏| 54/59 [03:10<00:16,  3.39s/it]
      0/99     6.35G    0.1049    0.1016         0       575       640:  93%|█████████▎| 55/59 [03:10<00:13,  3.36s/it]
      0/99     6.35G    0.1046    0.1019         0       715       640:  93%|█████████▎| 55/59 [03:13<00:13,  3.36s/it]
      0/99     6.35G    0.1046    0.1019         0       715       640:  95%|█████████▍| 56/59 [03:13<00:10,  3.36s/it]
      0/99     6.35G    0.1042    0.1019         0       618       640:  95%|█████████▍| 56/59 [03:17<00:10,  3.36s/it]
      0/99     6.35G    0.1042    0.1019         0       618       640:  97%|█████████▋| 57/59 [03:17<00:06,  3.45s/it]
      0/99     6.35G    0.1039    0.1017         0       544       640:  97%|█████████▋| 57/59 [03:21<00:06,  3.45s/it]
      0/99     6.35G    0.1039    0.1017         0       544       640:  98%|█████████▊| 58/59 [03:21<00:03,  3.49s/it]
      0/99     6.35G    0.1036    0.1016         0        96       640:  98%|█████████▊| 58/59 [03:21<00:03,  3.49s/it]
      0/99     6.35G    0.1036    0.1016         0        96       640: 100%|██████████| 59/59 [03:21<00:00,  2.61s/it]
      0/99     6.35G    0.1036    0.1016         0        96       640: 100%|██████████| 59/59 [03:21<00:00,  3.42s/it]

               Class     Images     Labels          P          R     [email protected] [email protected]:.95:   0%|          | 0/4 [00:00<?, ?it/s]
               Class     Images     Labels          P          R     [email protected] [email protected]:.95:  25%|██▌       | 1/4 [00:02<00:07,  2.63s/it]
               Class     Images     Labels          P          R     [email protected] [email protected]:.95:  50%|█████     | 2/4 [00:05<00:05,  2.75s/it]
               Class     Images     Labels          P          R     [email protected] [email protected]:.95:  75%|███████▌  | 3/4 [00:07<00:02,  2.61s/it]
               Class     Images     Labels          P          R     [email protected] [email protected]:.95: 100%|██████████| 4/4 [00:08<00:00,  1.95s/it]
               Class     Images     Labels          P          R     [email protected] [email protected]:.95: 100%|██████████| 4/4 [00:08<00:00,  2.21s/it]
                 all        207       3407      0.115      0.277     0.0747     0.0141

     Epoch   gpu_mem       box       obj       cls    labels  img_size

  0%|          | 0/59 [00:00<?, ?it/s]
      1/99     6.35G   0.08355   0.09766         0       566       640:   0%|          | 0/59 [00:03<?, ?it/s]
      1/99     6.35G   0.08355   0.09766         0       566       640:   2%|▏         | 1/59 [00:03<03:26,  3.56s/it]
      1/99     6.35G   0.08539   0.09904         0       652       640:   2%|▏         | 1/59 [00:07<03:26,  3.56s/it]
      1/99     6.35G   0.08539   0.09904         0       652       640:   3%|▎         | 2/59 [00:07<03:27,  3.65s/it]
      1/99     6.35G   0.08526   0.09853         0       596       640:   3%|▎         | 2/59 [00:10<03:27,  3.65s/it]
      1/99     6.35G   0.08526   0.09853         0       596       640:   5%|▌         | 3/59 [00:10<03:20,  3.58s/it]
      1/99     6.35G   0.08491   0.09569         0       511       640:   5%|▌         | 3/59 [00:14<03:20,  3.58s/it]
      1/99     6.35G   0.08491   0.09569         0       511       640:   7%|▋         | 4/59 [00:14<03:11,  3.48s/it]
      1/99     6.35G   0.08466   0.09637         0       581       640:   7%|▋         | 4/59 [00:17<03:11,  3.48s/it]
      1/99     6.35G   0.08466   0.09637         0       581       640:   8%|▊         | 5/59 [00:17<03:04,  3.42s/it]
      1/99     6.35G   0.08471   0.09602         0       556       640:   8%|▊         | 5/59 [00:20<03:04,  3.42s/it]
      1/99     6.35G   0.08471   0.09602         0       556       640:  10%|█         | 6/59 [00:20<02:58,  3.37s/it]
      1/99     6.35G   0.08454   0.09583         0       533       640:  10%|█         | 6/59 [00:24<02:58,  3.37s/it]
      1/99     6.35G   0.08454   0.09583         0       533       640:  12%|█▏        | 7/59 [00:24<02:54,  3.36s/it]
      1/99     6.35G   0.08531   0.09746         0       717       640:  12%|█▏        | 7/59 [00:27<02:54,  3.36s/it]
      1/99     6.35G   0.08531   0.09746         0       717       640:  14%|█▎        | 8/59 [00:27<02:54,  3.43s/it]
      1/99     6.35G   0.08575   0.09843         0       679       640:  14%|█▎        | 8/59 [00:31<02:54,  3.43s/it]
      1/99     6.35G   0.08575   0.09843         0       679       640:  15%|█▌        | 9/59 [00:31<02:55,  3.52s/it]
      1/99     6.35G   0.08565   0.09742         0       526       640:  15%|█▌        | 9/59 [00:34<02:55,  3.52s/it]
      1/99     6.35G   0.08565   0.09742         0       526       640:  17%|█▋        | 10/59 [00:34<02:51,  3.49s/it]
      1/99     6.35G   0.08555   0.09815         0       670       640:  17%|█▋        | 10/59 [00:38<02:51,  3.49s/it]
      1/99     6.35G   0.08555   0.09815         0       670       640:  19%|█▊        | 11/59 [00:38<02:44,  3.43s/it]
      1/99     6.35G   0.08521   0.09721         0       519       640:  19%|█▊        | 11/59 [00:41<02:44,  3.43s/it]
      1/99     6.35G   0.08521   0.09721         0       519       640:  20%|██        | 12/59 [00:41<02:39,  3.40s/it]
      1/99     6.35G   0.08517   0.09802         0       659       640:  20%|██        | 12/59 [00:44<02:39,  3.40s/it]
      1/99     6.35G   0.08517   0.09802         0       659       640:  22%|██▏       | 13/59 [00:44<02:35,  3.37s/it]
      1/99     6.35G   0.08511   0.09739         0       530       640:  22%|██▏       | 13/59 [00:47<02:35,  3.37s/it]
      1/99     6.35G   0.08511   0.09739         0       530       640:  24%|██▎       | 14/59 [00:47<02:30,  3.34s/it]
      1/99     6.35G   0.08502     0.097         0       529       640:  24%|██▎       | 14/59 [00:51<02:30,  3.34s/it]
      1/99     6.35G   0.08502     0.097         0       529       640:  25%|██▌       | 15/59 [00:51<02:29,  3.40s/it]
      1/99     6.35G   0.08489    0.0973         0       598       640:  25%|██▌       | 15/59 [00:54<02:29,  3.40s/it]
      1/99     6.35G   0.08489    0.0973         0       598       640:  27%|██▋       | 16/59 [00:54<02:25,  3.38s/it]
      1/99     6.35G    0.0847    0.0974         0       617       640:  27%|██▋       | 16/59 [00:58<02:25,  3.38s/it]
      1/99     6.35G    0.0847    0.0974         0       617       640:  29%|██▉       | 17/59 [00:58<02:23,  3.43s/it]
      1/99     6.35G   0.08468   0.09795         0       681       640:  29%|██▉       | 17/59 [01:01<02:23,  3.43s/it]
      1/99     6.35G   0.08468   0.09795         0       681       640:  31%|███       | 18/59 [01:01<02:19,  3.40s/it]
      1/99     6.35G   0.08477   0.09799         0       644       640:  31%|███       | 18/59 [01:04<02:19,  3.40s/it]
      1/99     6.35G   0.08477   0.09799         0       644       640:  32%|███▏      | 19/59 [01:04<02:14,  3.37s/it]
      1/99     6.35G   0.08452   0.09806         0       592       640:  32%|███▏      | 19/59 [01:08<02:14,  3.37s/it]
      1/99     6.35G   0.08452   0.09806         0       592       640:  34%|███▍      | 20/59 [01:08<02:10,  3.34s/it]
      1/99     6.35G   0.08447   0.09869         0       737       640:  34%|███▍      | 20/59 [01:11<02:10,  3.34s/it]
      1/99     6.35G   0.08447   0.09869         0       737       640:  36%|███▌      | 21/59 [01:11<02:07,  3.34s/it]
      1/99     6.35G   0.08448   0.09933         0       671       640:  36%|███▌      | 21/59 [01:15<02:07,  3.34s/it]
      1/99     6.35G   0.08448   0.09933         0       671       640:  37%|███▋      | 22/59 [01:15<02:06,  3.41s/it]
      1/99     6.35G   0.08434   0.09853         0       439       640:  37%|███▋      | 22/59 [01:18<02:06,  3.41s/it]
      1/99     6.35G   0.08434   0.09853         0       439       640:  39%|███▉      | 23/59 [01:18<02:05,  3.50s/it]
      1/99     6.35G   0.08424    0.0987         0       676       640:  39%|███▉      | 23/59 [01:22<02:05,  3.50s/it]
      1/99     6.35G   0.08424    0.0987         0       676       640:  41%|████      | 24/59 [01:22<02:02,  3.50s/it]
      1/99     6.35G   0.08414   0.09902         0       636       640:  41%|████      | 24/59 [01:25<02:02,  3.50s/it]
      1/99     6.35G   0.08414   0.09902         0       636       640:  42%|████▏     | 25/59 [01:25<01:56,  3.44s/it]
      1/99     6.35G   0.08395   0.09865         0       512       640:  42%|████▏     | 25/59 [01:28<01:56,  3.44s/it]
      1/99     6.35G   0.08395   0.09865         0       512       640:  44%|████▍     | 26/59 [01:28<01:51,  3.38s/it]
      1/99     6.35G   0.08416   0.09865         0       664       640:  44%|████▍     | 26/59 [01:32<01:51,  3.38s/it]
      1/99     6.35G   0.08416   0.09865         0       664       640:  46%|████▌     | 27/59 [01:32<01:47,  3.36s/it]
      1/99     6.35G    0.0841   0.09871         0       606       640:  46%|████▌     | 27/59 [01:35<01:47,  3.36s/it]
      1/99     6.35G    0.0841   0.09871         0       606       640:  47%|████▋     | 28/59 [01:35<01:43,  3.34s/it]
      1/99     6.35G   0.08396   0.09895         0       608       640:  47%|████▋     | 28/59 [01:39<01:43,  3.34s/it]
      1/99     6.35G   0.08396   0.09895         0       608       640:  49%|████▉     | 29/59 [01:39<01:41,  3.39s/it]
      1/99     6.35G   0.08398   0.09889         0       656       640:  49%|████▉     | 29/59 [01:42<01:41,  3.39s/it]
      1/99     6.35G   0.08398   0.09889         0       656       640:  51%|█████     | 30/59 [01:42<01:41,  3.48s/it]
      1/99     6.35G   0.08399   0.09891         0       631       640:  51%|█████     | 30/59 [01:46<01:41,  3.48s/it]
      1/99     6.35G   0.08399   0.09891         0       631       640:  53%|█████▎    | 31/59 [01:46<01:37,  3.47s/it]
      1/99     6.35G   0.08395    0.0986         0       496       640:  53%|█████▎    | 31/59 [01:49<01:37,  3.47s/it]
      1/99     6.35G   0.08395    0.0986         0       496       640:  54%|█████▍    | 32/59 [01:49<01:32,  3.42s/it]
      1/99     6.35G   0.08461   0.09843         0       780       640:  54%|█████▍    | 32/59 [01:52<01:32,  3.42s/it]
      1/99     6.35G   0.08461   0.09843         0       780       640:  56%|█████▌    | 33/59 [01:52<01:28,  3.39s/it]
      1/99     6.35G   0.08516   0.09805         0       686       640:  56%|█████▌    | 33/59 [01:56<01:28,  3.39s/it]
      1/99     6.35G   0.08516   0.09805         0       686       640:  58%|█████▊    | 34/59 [01:56<01:23,  3.35s/it]
      1/99     6.35G   0.08573   0.09772         0       710       640:  58%|█████▊    | 34/59 [01:59<01:23,  3.35s/it]
      1/99     6.35G   0.08573   0.09772         0       710       640:  59%|█████▉    | 35/59 [01:59<01:20,  3.34s/it]
      1/99     6.35G   0.08624    0.0974         0       668       640:  59%|█████▉    | 35/59 [02:02<01:20,  3.34s/it]
      1/99     6.35G   0.08624    0.0974         0       668       640:  61%|██████    | 36/59 [02:02<01:18,  3.40s/it]
      1/99     6.35G   0.08656    0.0973         0       701       640:  61%|██████    | 36/59 [02:06<01:18,  3.40s/it]
      1/99     6.35G   0.08656    0.0973         0       701       640:  63%|██████▎   | 37/59 [02:06<01:16,  3.50s/it]
      1/99     6.35G   0.08677   0.09703         0       619       640:  63%|██████▎   | 37/59 [02:10<01:16,  3.50s/it]
      1/99     6.35G   0.08677   0.09703         0       619       640:  64%|██████▍   | 38/59 [02:10<01:13,  3.48s/it]
      1/99     6.35G   0.08706   0.09693         0       644       640:  64%|██████▍   | 38/59 [02:13<01:13,  3.48s/it]
      1/99     6.35G   0.08706   0.09693         0       644       640:  66%|██████▌   | 39/59 [02:13<01:08,  3.43s/it]
      1/99     6.35G   0.08727   0.09694         0       612       640:  66%|██████▌   | 39/59 [02:16<01:08,  3.43s/it]
      1/99     6.35G   0.08727   0.09694         0       612       640:  68%|██████▊   | 40/59 [02:16<01:04,  3.39s/it]
      1/99     6.35G   0.08724   0.09691         0       534       640:  68%|██████▊   | 40/59 [02:19<01:04,  3.39s/it]
      1/99     6.35G   0.08724   0.09691         0       534       640:  69%|██████▉   | 41/59 [02:19<01:00,  3.35s/it]
      1/99     6.35G   0.08719   0.09647         0       423       640:  69%|██████▉   | 41/59 [02:23<01:00,  3.35s/it]
      1/99     6.35G   0.08719   0.09647         0       423       640:  71%|███████   | 42/59 [02:23<00:56,  3.34s/it]
      1/99     6.35G   0.08732   0.09693         0       876       640:  71%|███████   | 42/59 [02:26<00:56,  3.34s/it]
      1/99     6.35G   0.08732   0.09693         0       876       640:  73%|███████▎  | 43/59 [02:26<00:53,  3.37s/it]
      1/99     6.35G   0.08741   0.09662         0       531       640:  73%|███████▎  | 43/59 [02:30<00:53,  3.37s/it]
      1/99     6.35G   0.08741   0.09662         0       531       640:  75%|███████▍  | 44/59 [02:30<00:53,  3.59s/it]
      1/99     6.35G    0.0875   0.09647         0       597       640:  75%|███████▍  | 44/59 [02:34<00:53,  3.59s/it]
      1/99     6.35G    0.0875   0.09647         0       597       640:  76%|███████▋  | 45/59 [02:34<00:49,  3.56s/it]
      1/99     6.35G   0.08761   0.09656         0       705       640:  76%|███████▋  | 45/59 [02:37<00:49,  3.56s/it]
      1/99     6.35G   0.08761   0.09656         0       705       640:  78%|███████▊  | 46/59 [02:37<00:45,  3.48s/it]
      1/99     6.35G    0.0876   0.09647         0       608       640:  78%|███████▊  | 46/59 [02:40<00:45,  3.48s/it]
      1/99     6.35G    0.0876   0.09647         0       608       640:  80%|███████▉  | 47/59 [02:40<00:41,  3.42s/it]
      1/99     6.35G   0.08763   0.09649         0       665       640:  80%|███████▉  | 47/59 [02:44<00:41,  3.42s/it]
      1/99     6.35G   0.08763   0.09649         0       665       640:  81%|████████▏ | 48/59 [02:44<00:37,  3.39s/it]
      1/99     6.35G   0.08768   0.09669         0       729       640:  81%|████████▏ | 48/59 [02:47<00:37,  3.39s/it]
      1/99     6.35G   0.08768   0.09669         0       729       640:  83%|████████▎ | 49/59 [02:47<00:33,  3.35s/it]
      1/99     6.35G   0.08772   0.09687         0       695       640:  83%|████████▎ | 49/59 [02:50<00:33,  3.35s/it]
      1/99     6.35G   0.08772   0.09687         0       695       640:  85%|████████▍ | 50/59 [02:50<00:30,  3.38s/it]
      1/99     6.35G   0.08773   0.09671         0       549       640:  85%|████████▍ | 50/59 [02:54<00:30,  3.38s/it]
      1/99     6.35G   0.08773   0.09671         0       549       640:  86%|████████▋ | 51/59 [02:54<00:27,  3.47s/it]
      1/99     6.35G   0.08776   0.09689         0       710       640:  86%|████████▋ | 51/59 [02:58<00:27,  3.47s/it]
      1/99     6.35G   0.08776   0.09689         0       710       640:  88%|████████▊ | 52/59 [02:58<00:24,  3.50s/it]
      1/99     6.35G   0.08775   0.09695         0       630       640:  88%|████████▊ | 52/59 [03:01<00:24,  3.50s/it]
      1/99     6.35G   0.08775   0.09695         0       630       640:  90%|████████▉ | 53/59 [03:01<00:20,  3.43s/it]
      1/99     6.35G   0.08779   0.09712         0       693       640:  90%|████████▉ | 53/59 [03:04<00:20,  3.43s/it]
      1/99     6.35G   0.08779   0.09712         0       693       640:  92%|█████████▏| 54/59 [03:04<00:16,  3.39s/it]
      1/99     6.35G   0.08769   0.09716         0       585       640:  92%|█████████▏| 54/59 [03:08<00:16,  3.39s/it]
      1/99     6.35G   0.08769   0.09716         0       585       640:  93%|█████████▎| 55/59 [03:08<00:13,  3.36s/it]
      1/99     6.35G   0.08763   0.09685         0       515       640:  93%|█████████▎| 55/59 [03:11<00:13,  3.36s/it]
      1/99     6.35G   0.08763   0.09685         0       515       640:  95%|█████████▍| 56/59 [03:11<00:10,  3.34s/it]
      1/99     6.35G   0.08765   0.09699         0       705       640:  95%|█████████▍| 56/59 [03:14<00:10,  3.34s/it]
      1/99     6.35G   0.08765   0.09699         0       705       640:  97%|█████████▋| 57/59 [03:14<00:06,  3.36s/it]
      1/99     6.35G   0.08765   0.09736         0       726       640:  97%|█████████▋| 57/59 [03:18<00:06,  3.36s/it]
      1/99     6.35G   0.08765   0.09736         0       726       640:  98%|█████████▊| 58/59 [03:18<00:03,  3.47s/it]
      1/99     6.37G   0.08766   0.09725         0        91       640:  98%|█████████▊| 58/59 [03:18<00:03,  3.47s/it]
      1/99     6.37G   0.08766   0.09725         0        91       640: 100%|██████████| 59/59 [03:18<00:00,  2.58s/it]
      1/99     6.37G   0.08766   0.09725         0        91       640: 100%|██████████| 59/59 [03:18<00:00,  3.37s/it]

               Class     Images     Labels          P          R     [email protected] [email protected]:.95:   0%|          | 0/4 [00:00<?, ?it/s]
               Class     Images     Labels          P          R     [email protected] [email protected]:.95:  25%|██▌       | 1/4 [00:02<00:07,  2.44s/it]
               Class     Images     Labels          P          R     [email protected] [email protected]:.95:  50%|█████     | 2/4 [00:05<00:05,  2.62s/it]
               Class     Images     Labels          P          R     [email protected] [email protected]:.95:  75%|███████▌  | 3/4 [00:07<00:02,  2.53s/it]
               Class     Images     Labels          P          R     [email protected] [email protected]:.95: 100%|██████████| 4/4 [00:08<00:00,  1.90s/it]
               Class     Images     Labels          P          R     [email protected] [email protected]:.95: 100%|██████████| 4/4 [00:08<00:00,  2.14s/it]
                 all        207       3407       0.12      0.382     0.0979     0.0192

训练过程中,结果会自动创建目录存储在runs下,如下所示:

yolov5s-bifpn模型结果:

yolov5s模型结果:

随机选取样例图像测试如下:

为了便于后续使用结果数据,这里对其结果数据进行解析存储如下:

{
    "crack": [
        [
            0.26700732111930849,
            [
                0,
                296,
                23,
                392
            ]
        ],
        [
            0.2672766149044037,
            [
                686,
                648,
                767,
                689
            ]
        ],
        [
            0.2740951180458069,
            [
                1,
                393,
                26,
                498
            ]
        ],
        [
            0.27556174993515017,
            [
                631,
                634,
                722,
                671
            ]
        ],
        [
            0.27758586406707766,
            [
                582,
                247,
                630,
                295
            ]
        ],
        [
            0.2786214053630829,
            [
                801,
                711,
                869,
                753
            ]
        ],
        [
            0.28326842188835146,
            [
                911,
                761,
                966,
                819
            ]
        ],
        [
            0.2855015993118286,
            [
                726,
                61,
                765,
                126
            ]
        ],
        [
            0.2891019582748413,
            [
                541,
                621,
                613,
                658
            ]
        ],
        [
            0.28970593214035036,
            [
                863,
                745,
                932,
                780
            ]
        ],
        [
            0.28980544209480288,
            [
                752,
                8,
                785,
                76
            ]
        ],
        [
            0.2912375032901764,
            [
                986,
                860,
                1020,
                918
            ]
        ],
        [
            0.29403477907180788,
            [
                619,
                205,
                663,
                261
            ]
        ],
        [
            0.29819419980049136,
            [
                666,
                641,
                740,
                677
            ]
        ],
        [
            0.30100756883621218,
            [
                1005,
                903,
                1024,
                951
            ]
        ],
        [
            0.30114322900772097,
            [
                548,
                281,
                588,
                338
            ]
        ],
        [
            0.30483242869377139,
            [
                1,
                342,
                26,
                450
            ]
        ],
        [
            0.3290395140647888,
            [
                820,
                720,
                890,
                763
            ]
        ],
        [
            0.3302559554576874,
            [
                652,
                165,
                695,
                221
            ]
        ],
        [
            0.3334021270275116,
            [
                0,
                693,
                35,
                736
            ]
        ],
        [
            0.33690938353538515,
            [
                605,
                222,
                650,
                275
            ]
        ],
        [
            0.34495481848716738,
            [
                0,
                533,
                27,
                615
            ]
        ],
        [
            0.37444597482681277,
            [
                963,
                713,
                1018,
                755
            ]
        ],
        [
            0.37496164441108706,
            [
                686,
                121,
                735,
                176
            ]
        ],
        [
            0.3889273703098297,
            [
                358,
                590,
                432,
                633
            ]
        ],
        [
            0.40112408995628359,
            [
                5,
                612,
                38,
                693
            ]
        ],
        [
            0.40698984265327456,
            [
                593,
                235,
                640,
                287
            ]
        ],
        [
            0.41528889536857607,
            [
                633,
                185,
                677,
                244
            ]
        ],
        [
            0.4153532385826111,
            [
                446,
                474,
                492,
                534
            ]
        ],
        [
            0.41710415482521059,
            [
                996,
                879,
                1024,
                942
            ]
        ],
        [
            0.42140141129493716,
            [
                762,
                0,
                792,
                47
            ]
        ],
        [
            0.42363840341567995,
            [
                675,
                137,
                724,
                187
            ]
        ],
        [
            0.42380252480506899,
            [
                422,
                583,
                483,
                635
            ]
        ],
        [
            0.43151307106018069,
            [
                709,
                93,
                750,
                155
            ]
        ],
        [
            0.4327857792377472,
            [
                844,
                734,
                915,
                775
            ]
        ],
        [
            0.4366927146911621,
            [
                555,
                272,
                604,
                315
            ]
        ],
        [
            0.4374251663684845,
            [
                233,
                649,
                297,
                688
            ]
        ],
        [
            0.44089221954345705,
            [
                714,
                657,
                784,
                701
            ]
        ],
        [
            0.448123574256897,
            [
                739,
                37,
                774,
                107
            ]
        ],
        [
            0.4551221430301666,
            [
                161,
                641,
                238,
                690
            ]
        ],
        [
            0.45720604062080386,
            [
                769,
                688,
                830,
                736
            ]
        ],
        [
            0.4593600630760193,
            [
                963,
                839,
                1007,
                886
            ]
        ],
        [
            0.48793330788612368,
            [
                607,
                626,
                690,
                664
            ]
        ],
        [
            0.4884047508239746,
            [
                925,
                772,
                979,
                835
            ]
        ],
        [
            0.5071386694908142,
            [
                222,
                597,
                306,
                647
            ]
        ],
        [
            0.5111898183822632,
            [
                473,
                431,
                514,
                497
            ]
        ],
        [
            0.5346865057945252,
            [
                105,
                662,
                182,
                713
            ]
        ],
        [
            0.5522925853729248,
            [
                540,
                303,
                569,
                378
            ]
        ],
        [
            0.5579397082328796,
            [
                506,
                367,
                552,
                432
            ]
        ],
        [
            0.5627263784408569,
            [
                295,
                580,
                388,
                633
            ]
        ],
        [
            0.5672629475593567,
            [
                475,
                617,
                569,
                653
            ]
        ],
        [
            0.574158251285553,
            [
                24,
                693,
                108,
                731
            ]
        ],
        [
            0.5847405791282654,
            [
                426,
                526,
                461,
                594
            ]
        ]
    ]
}

与我之前的文章中的结果格式保持一致。


本文转载自: https://blog.csdn.net/Together_CZ/article/details/127735859
版权归原作者 Together_CZ 所有, 如有侵权,请联系我们删除。

“基于yolov5s+bifpn实践隧道裂缝裂痕检测”的评论:

还没有评论