当前位置:   article > 正文

基于轻量级YOLOv5开发构建汉字检测识别分析系统_yolov5 文字识别

yolov5 文字识别

汉字检测、字母检测、手写数字检测、藏文检测、甲骨文检测在我之前的文章中都有做过了,今天主要是因为实际项目的需要,之前的汉字检测模型较为古老了还使用的yolov3时期的模型,检测精度和推理速度都有不小的滞后了,这里要基于yolov5轻量级的模型来开发构建新版的目标检测模型,首先看下效果图:

接下来简单看下数据集情况:

YOLO格式标注文件截图如下:

实例标注内容如下所示:

  1. 17 0.245192 0.617788 0.038462 0.038462
  2. 6 0.102163 0.830529 0.045673 0.045673
  3. 16 0.894231 0.096154 0.134615 0.134615
  4. 4 0.456731 0.524038 0.134615 0.134615
  5. 15 0.367788 0.317308 0.269231 0.269231

VOC格式数据标注文件截图如下:

实例标注内容如下所示:

  1. <annotation>
  2. <folder>DATASET</folder>
  3. <filename>0ace8eaf-8e86-488b-9229-95255c69158c.jpg</filename>
  4. <source>
  5. <database>The DATASET Database</database>
  6. <annotation>DATASET</annotation>
  7. <image>DATASET</image>
  8. </source>
  9. <owner>
  10. <name>YMGZS</name>
  11. </owner>
  12. <size>
  13. <width>416</width>
  14. <height>416</height>
  15. <depth>3</depth>
  16. </size>
  17. <segmented>0</segmented>
  18. <object>
  19. <name>17</name>
  20. <pose>Unspecified</pose>
  21. <truncated>0</truncated>
  22. <difficult>0</difficult>
  23. <bndbox>
  24. <xmin>214</xmin>
  25. <ymin>302</ymin>
  26. <xmax>230</xmax>
  27. <ymax>318</ymax>
  28. </bndbox>
  29. </object>
  30. <object>
  31. <name>16</name>
  32. <pose>Unspecified</pose>
  33. <truncated>0</truncated>
  34. <difficult>0</difficult>
  35. <bndbox>
  36. <xmin>210</xmin>
  37. <ymin>67</ymin>
  38. <xmax>229</xmax>
  39. <ymax>86</ymax>
  40. </bndbox>
  41. </object>
  42. <object>
  43. <name>18</name>
  44. <pose>Unspecified</pose>
  45. <truncated>0</truncated>
  46. <difficult>0</difficult>
  47. <bndbox>
  48. <xmin>260</xmin>
  49. <ymin>7</ymin>
  50. <xmax>274</xmax>
  51. <ymax>21</ymax>
  52. </bndbox>
  53. </object>
  54. <object>
  55. <name>10</name>
  56. <pose>Unspecified</pose>
  57. <truncated>0</truncated>
  58. <difficult>0</difficult>
  59. <bndbox>
  60. <xmin>121</xmin>
  61. <ymin>103</ymin>
  62. <xmax>143</xmax>
  63. <ymax>125</ymax>
  64. </bndbox>
  65. </object>
  66. <object>
  67. <name>11</name>
  68. <pose>Unspecified</pose>
  69. <truncated>0</truncated>
  70. <difficult>0</difficult>
  71. <bndbox>
  72. <xmin>296</xmin>
  73. <ymin>289</ymin>
  74. <xmax>352</xmax>
  75. <ymax>345</ymax>
  76. </bndbox>
  77. </object>
  78. <object>
  79. <name>0</name>
  80. <pose>Unspecified</pose>
  81. <truncated>0</truncated>
  82. <difficult>0</difficult>
  83. <bndbox>
  84. <xmin>56</xmin>
  85. <ymin>132</ymin>
  86. <xmax>196</xmax>
  87. <ymax>272</ymax>
  88. </bndbox>
  89. </object>
  90. <object>
  91. <name>0</name>
  92. <pose>Unspecified</pose>
  93. <truncated>0</truncated>
  94. <difficult>0</difficult>
  95. <bndbox>
  96. <xmin>213</xmin>
  97. <ymin>142</ymin>
  98. <xmax>353</xmax>
  99. <ymax>282</ymax>
  100. </bndbox>
  101. </object>
  102. </annotation>

因为是主打轻量级网络,这里选择了也是最为轻量级的n系列的模型,最终训练得到的模型文件不足4MB大小,网络结构图如下所示:

默认100次epoch的计算,结果目录如下所示:

【混淆矩阵】

【F1值曲线】

【PR曲线】

【训练日志可视化】

【batch计算实例】

可视化界面推理样例如下:

从评估指标结果上面来看检测效果还是很不错的。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/724008
推荐阅读
相关标签
  

闽ICP备14008679号