{"id":305799,"date":"2020-06-23T15:00:46","date_gmt":"2020-06-23T15:00:46","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=305799"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=305799","title":{"rendered":"YoloV5 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u0440\u043e\u043a \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/507900\/\">\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d <a href=\"https:\/\/blog.roboflow.ai\/yolov5-is-here\/\">\u0430\u043d\u043e\u043d\u0441<\/a> \u043d\u043e\u0432\u043e\u0439 YOLOv5, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0434\u0435\u0439\u043d\u043e \u0434\u0430\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 COCO, \u0447\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438. \u0410\u0432\u0442\u043e\u0440 \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u0440\u043e\u043a \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439.<\/p>\n<h3>\u0414\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>  \u041f\u0435\u0440\u0432\u043e-\u043d\u0430\u043f\u0435\u0440\u0432\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u0430\u0442\u0430\u0441\u0435\u0442 \u0431\u044b\u043b \u0441\u043e\u0431\u0440\u0430\u043d \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043f\u0443\u0442\u0435\u043c \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u043d\u0430 \u0441\u0442\u043e\u044f\u043d\u043a\u0435 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439 \u0441 \u0432\u0438\u0434\u0438\u043c\u044b\u043c \u0437\u043d\u0430\u0447\u043a\u043e\u043c \u043c\u0430\u0440\u043a\u0438 (\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 \u0434\u043e\u043c\u0443 \u0432 5 \u0443\u0442\u0440\u0430, \u0434\u0430\u0431\u044b \u043d\u0435 \u043f\u0443\u0433\u0430\u0442\u044c \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0445\u043e\u0436\u0438\u0445). \u0420\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 <a href=\"https:\/\/github.com\/tzutalin\/labelImg\">labelImg<\/a>. \u0412\u0441\u0435\u0433\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d\u043e 118 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043c\u0430\u0440\u043e\u043a: Lada, Kia, Nissan, Volkswagen, Chevrolet, Ford, Mitsubishi, Renault, Hyundai, Opel. \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u2014 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u043d\u0430 \u0442\u0430\u043a\u043e\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u2014 \u043e\u0434\u043d\u0430\u043a\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u043f\u043e\u043a\u0430\u0436\u0435\u0442!<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u041f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/h3>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 labelImg \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 Pascal VOC \u0438 \u043f\u0438\u0448\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0432 XML-\u0444\u0430\u0439\u043b\u044b, \u0430 YOLOv5 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 TXT-\u0444\u0430\u0439\u043b\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430: \u00ab\u043d\u043e\u043c\u0435\u0440-\u043a\u043b\u0430\u0441\u0441\u0430 x-\u0446\u0435\u043d\u0442\u0440\u0430 y-\u0446\u0435\u043d\u0442\u0440\u0430 width height\u00bb, \u0432\u0441\u0435 \u043d\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443, \u2014 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u043e\u0440\u043c\u0430\u0442\u0443. \u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e CAR_BRANDS\/ \u0438 \u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">from lxml import etree import cv2 from glob import glob import re  CAR_BRANDS_PATH = 'CAR_BRANDS\/'  classes = {'lada': 0, 'kia': 1, 'nissan': 2, 'volkswagen': 3, 'chevrolet': 4,            'ford': 5, 'mitsubishi': 6, 'renault': 7, 'hyundai': 8, 'opel': 9}  def extract_txt(img_path, xml_path, txt_path):     img = cv2.imread(img_path)     W = img.shape[1]     H = img.shape[0]     tree = etree.parse(xml_path)      root = tree.getroot()     with open(txt_path, 'w') as f:         for child in root:             if child.tag == 'object':                 for object_child in child:                     coords = []                     if object_child.tag == 'name':                         f.write(str(classes.get(object_child.text))+' ')                     if object_child.tag == 'bndbox':                         for bbox_child in object_child:                             coords.append(int(bbox_child.text))                         xmin = coords[0]                         xmax = coords[2]                         ymin = coords[1]                         ymax = coords[3]                          w = (xmax - xmin) \/ W                         h = (ymax - ymin) \/ H                         xc = (xmin + (xmax - xmin) \/ 2) \/ W                         yc = (ymin + (ymax - ymin) \/ 2) \/ H                          f.write(str(xc)+' '+str(yc)+' '+str(w)+' '+str(h)+'\\n')   xmls = sorted(glob(CAR_BRANDS_PATH + '*.xml'))  for xml_path in xmls:     img_path = re.findall('[A-Za-z0-9_\/]+', xml_path)[0]+'.jpg'     txt_path = re.findall('[A-Za-z0-9_\/]+', img_path)[0]+'.txt'     extract_txt(img_path, xml_path, txt_path)<\/code><\/pre>\n<p>  \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0433\u043e\u043d\u044f\u0442\u044c \u0432 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u0444\u043e\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 (416, 416), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u0438\u0445 \u043e\u0442\u0440\u0435\u0441\u0430\u0439\u0437\u0438\u0442\u044c:<\/p>\n<pre><code class=\"python\">def resize(folder):     files = glob(folder + '*.jpg')     for file in files:         img = cv2.imread(file)         img = cv2.resize(img, (416, 416))         cv2.imwrite(file, img)<\/code><\/pre>\n<p>  <\/p>\n<h3>\u0410\u0443\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/h3>\n<p>  \u0414\u043b\u044f \u0430\u0443\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0440\u0435\u0441\u0443\u0440\u0441 <a href=\"https:\/\/roboflow.ai\/\">roboflow<\/a>, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u044b\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0432\u0430\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0430\u0443\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u0424\u043e\u0442\u043e \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u043c\u043d\u043e\u0436\u0435\u043d\u044b \u0434\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 4130, \u0442\u0438\u043f\u044b \u0430\u0443\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u2014 Crop, Brightness, Exposure, Noise. \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b \u043d\u0430 \u0442\u0440\u0435\u0439\u043d, \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0438 \u0442\u0435\u0441\u0442 \u0432 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 7:2:1.<\/p>\n<h3>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0421\u043a\u0430\u0447\u0430\u0435\u043c YOLOv5 \u0441 \u0435\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c requirements:<\/p>\n<pre><code class=\"bash\">git clone https:\/\/github.com\/roboflow-ai\/yolov5 pip install -U -r yolov5\/requirements.txt<\/code><\/pre>\n<p>  \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 data.yaml. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"plaintext\">train: ..\/train\/images val: ..\/valid\/images  nc: 10 names: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']<\/code><\/pre>\n<p>  \u0433\u0434\u0435 train \u2014 \u043f\u0443\u0442\u044c \u0434\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u0440\u0435\u0439\u043d\u0430, valid \u2014 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, nc \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432, names \u2014 \u0438\u043c\u0435\u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e yolov5\/models\/. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 yolov5s.yaml \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0432 custom_yolov5s.yaml \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"plaintext\"># parameters nc: 10  # number of classes depth_multiple: 0.33  # model depth multiple width_multiple: 0.50  # layer channel multiple  # anchors anchors:   - [10,13, 16,30, 33,23]  # P3\/8   - [30,61, 62,45, 59,119]  # P4\/16   - [116,90, 156,198, 373,326]  # P5\/32  # yolov5 backbone backbone:   # [from, number, module, args]   [[-1, 1, Focus, [64, 3]],  # 1-P1\/2    [-1, 1, Conv, [128, 3, 2]],  # 2-P2\/4    [-1, 3, Bottleneck, [128]],    [-1, 1, Conv, [256, 3, 2]],  # 4-P3\/8    [-1, 9, BottleneckCSP, [256]],    [-1, 1, Conv, [512, 3, 2]],  # 6-P4\/16    [-1, 9, BottleneckCSP, [512]],    [-1, 1, Conv, [1024, 3, 2]], # 8-P5\/32    [-1, 1, SPP, [1024, [5, 9, 13]]],    [-1, 6, BottleneckCSP, [1024]],  # 10   ]  # yolov5 head head:   [[-1, 3, BottleneckCSP, [1024, False]],  # 11    [-1, 1, nn.Conv2d, [na * (nc + 5), 1, 1, 0]],  # 12 (P5\/32-large)     [-2, 1, nn.Upsample, [None, 2, 'nearest']],    [[-1, 6], 1, Concat, [1]],  # cat backbone P4    [-1, 1, Conv, [512, 1, 1]],    [-1, 3, BottleneckCSP, [512, False]],    [-1, 1, nn.Conv2d, [na * (nc + 5), 1, 1, 0]],  # 17 (P4\/16-medium)     [-2, 1, nn.Upsample, [None, 2, 'nearest']],    [[-1, 4], 1, Concat, [1]],  # cat backbone P3    [-1, 1, Conv, [256, 1, 1]],    [-1, 3, BottleneckCSP, [256, False]],    [-1, 1, nn.Conv2d, [na * (nc + 5), 1, 1, 0]],  # 22 (P3\/8-small)     [[], 1, Detect, [nc, anchors]],  # Detect(P3, P4, P5)   ]<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 yolov5\/:<\/p>\n<pre><code class=\"bash\">cd yolov5\/<\/code><\/pre>\n<p>  \u0438 \u043e\u0431\u0443\u0447\u0438\u043c \u043d\u0430\u0448\u0443 \u043c\u043e\u0434\u0435\u043b\u044c:<\/p>\n<pre><code class=\"bash\">python train.py --img 416 --batch 4 --epochs 50 --data '..\/data.yaml' --cfg .\/models\/custom_yolov5s.yaml --weights '' --name yolov5s_results --nosave --cache<\/code><\/pre>\n<p>  <\/p>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h3>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c, \u0432\u0432\u043e\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"bash\">python detect.py --weights weights\/last_yolov5s_results.pt --img 416 --conf 0.4 --save-txt --source ..\/test\/images<\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0438\u043b\u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 conf \u2014 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043e\u0442\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e, \u0431\u043e\u043b\u044c\u0448\u0435\u0439, \u0447\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 conf.<\/p>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e yolov5\/inference\/output\/ (\u043a\u0430\u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u0438 TXT-\u0444\u0430\u0439\u043b\u044b (\u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0444\u043b\u0430\u0433\u0430 &#8212;save-txt). \u0418\u0437 12 \u0444\u043e\u0442\u043e, \u043e\u0442\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430, \u043c\u0430\u0440\u043a\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043b\u0438\u0441\u044c \u0432 10 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u044b\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0432\u0435\u0440\u043d\u044b\u043c\u0438. \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043b\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0432 118 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439! \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 (\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u043c, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0440\u0430\u043d\u0435\u0435, \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u0430\u0440\u043e\u043a):<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/sun9-41.userapi.com\/c857528\/v857528393\/2178ce\/YnO117GMywE.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0418, \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f YOLOv5 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f\u043c\u0438 \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/sun9-11.userapi.com\/c857528\/v857528393\/2178df\/wdda1rTUxjI.jpg\" alt=\"image\"\/><\/p>\n<p>  \u042d\u0442\u043e \u0442.\u043d. \u00ab\u043c\u043e\u0437\u0430\u0438\u0447\u043d\u0430\u044f \u0430\u0443\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u00bb \u2014 \u043a \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u043d\u0430\u0440\u0435\u0437\u043a\u0430 \u0444\u043e\u0442\u043e \u043d\u0430 \u043a\u0443\u0441\u043e\u0447\u043a\u0438. \u0423\u0431\u0440\u0430\u0442\u044c \u0435\u0435 \u043c\u043e\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u0437\u0430\u043b\u0435\u0437\u0442\u044c \u0432 \u043a\u043e\u0434 train.py \u0438 \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043b\u0430\u0433 augmet \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 False. \u041a\u043e\u0433\u0434\u0430 \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0432\u0440\u0435\u0434\u0438\u0442\u044c? \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0437\u0430\u0434\u0430\u043b\u0438\u0441\u044c \u0446\u0435\u043b\u044c\u044e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439 \u2014 \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u043d\u0430\u0440\u0435\u0437\u043a\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0443\u043a\u0432 \u0438 \u0446\u0438\u0444\u0440 \u043f\u0440\u0438\u0432\u0435\u043b\u0438 \u0431\u044b \u043d\u0435 \u043a \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e, \u0430 \u0443\u0445\u0443\u0434\u0448\u0435\u043d\u0438\u044e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f.<\/p>\n<h3>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h3>\n<p>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440 YOLOv5 \u2014 \u0432\u0441\u0435 \u043e\u043d\u0438 \u043b\u0435\u0436\u0430\u0442 \u0432 yolov5\/models\/. \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 yolov5s \u2014 \u043e\u043d\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0439, \u043d\u043e \u043d\u0435 \u0441\u0430\u043c\u043e\u0439 \u043b\u0443\u0447\u0448\u0435\u0439 \u043f\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0442\u0435\u043c\u0430 \u0434\u043b\u044f YOLO \u2014 \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u044f\u043a\u043e\u0440\u0435\u0439 (anchors). \u0422\u0430\u043a \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0438\u043c \u0437\u0430 \u043d\u043e\u0432\u043e\u0441\u0442\u044f\u043c\u0438 \u043d\u043e\u0432\u044b\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0438 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445! \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u0430.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/507900\/\"> https:\/\/habr.com\/ru\/post\/507900\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/507900\/\">\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d <a href=\"https:\/\/blog.roboflow.ai\/yolov5-is-here\/\">\u0430\u043d\u043e\u043d\u0441<\/a> \u043d\u043e\u0432\u043e\u0439 YOLOv5, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0434\u0435\u0439\u043d\u043e \u0434\u0430\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 COCO, \u0447\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438. \u0410\u0432\u0442\u043e\u0440 \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u0440\u043e\u043a \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439.<\/p>\n<h3>\u0414\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>  \u041f\u0435\u0440\u0432\u043e-\u043d\u0430\u043f\u0435\u0440\u0432\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u0430\u0442\u0430\u0441\u0435\u0442 \u0431\u044b\u043b \u0441\u043e\u0431\u0440\u0430\u043d \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043f\u0443\u0442\u0435\u043c \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u043d\u0430 \u0441\u0442\u043e\u044f\u043d\u043a\u0435 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439 \u0441 \u0432\u0438\u0434\u0438\u043c\u044b\u043c \u0437\u043d\u0430\u0447\u043a\u043e\u043c \u043c\u0430\u0440\u043a\u0438 (\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 \u0434\u043e\u043c\u0443 \u0432 5 \u0443\u0442\u0440\u0430, \u0434\u0430\u0431\u044b \u043d\u0435 \u043f\u0443\u0433\u0430\u0442\u044c \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0445\u043e\u0436\u0438\u0445). \u0420\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 <a href=\"https:\/\/github.com\/tzutalin\/labelImg\">labelImg<\/a>. \u0412\u0441\u0435\u0433\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d\u043e 118 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043c\u0430\u0440\u043e\u043a: Lada, Kia, Nissan, Volkswagen, Chevrolet, Ford, Mitsubishi, Renault, Hyundai, Opel. \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u2014 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u043d\u0430 \u0442\u0430\u043a\u043e\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u2014 \u043e\u0434\u043d\u0430\u043a\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u043f\u043e\u043a\u0430\u0436\u0435\u0442!  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-305799","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=305799"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305799\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=305799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=305799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}