转载自AI Studio

标题项目链接https://aistudio.baidu.com/aistudio/projectdetail/3483533?contributionType=1

海上船舶智能检测

赛题背景

海上船舶目标检测对于领海安全、渔业资源管理和海上运输与救援具有重要意义,但在天气和海浪等不可控的自然因素影响下,依靠派遣海警船或基于可见光数据进行船舶目标监测等手段往往难以有效开展。卫星合成孔径雷达(SAR)是一种全天时、全天候、多维度获取信息的主动式微波成像雷达,为海洋上多尺度的船舶检测提供了强有力的数据保障和技术支持,在遥感图像船舶检测领域占有重要地位。由于SAR的成像原理与光学相机存在很大的差别,如何利用SAR数据特性设计出一套具有针对性的船舶检测方法是一大难点。本赛题鼓励选手通过数据算法寻找这个难题的新颖解法,进一步推动海上船舶智能检测的发展。

赛题任务

快速精准的检测出船舶的垂直边框是船舶智能检测的基本需求。本赛题以训练数据集中船舶和相应垂直边框信息为学习依据,要求参赛者对测试数据集中的船舶进行检测(图a),求解出船舶对应垂直边框(图b)。

参赛选手需要考虑SAR图像和船舶目标的特性,如背景强散射杂波的不均匀性,目标的不完整性、十字旁瓣模糊和临近目标干扰等,设计科学适用的算法模型进行船舶的智能检测。

数据简介

源数据为中国资源卫星应用中心提供的102景GF-3卫星数据及欧空局提供的108景哨兵1号卫星数据。标注数据由中国科学院空天信息创新研究院王超研究员团队制作和提供,通过对源数据进行幅度值生成,位深量化和灰度拉伸处理后,将原始16位复数数据加工为8位数字图像。通过裁剪和筛选,形成像素尺寸为256x256的船舶切片,并通过Labelme目标标注软件,为每一张船舶切片生成对应的船舶标注框信息文本。

数据说明

竞赛训练数据集中包括两类数据文件,第一类是.jpg格式的SAR影像文件,第二类是txt格式的船舶标注信息文本文件,两者通过相同的名称进行关联,名称命名规则可忽略。船舶标注信息文本文件字段说明如下表所示:

要素项(字段)字段中文名称字段度量单位字段代码说明备注
类别编号0代表船舶
目标矩形中心点相对横坐标相对于切片大小的横坐标比例位置,范围为[0,1]
目标矩形中心点相对纵坐标相对于切片大小的纵坐标比例位置,范围为[0,1]
目标矩形相对长度比例相对于切片大小的比例长度,范围为[0,1]
目标矩形相对宽度比例相对于切片大小的比例宽度,范围为[0,1]

举例说明:txt中第一位数字0代表船舶,第二位数字计算公式为LA/L=0.67578125,第三位数字计算公式为DA/D=0.2890625,第四位公式为l/L=0.1484375,第五位公式为d/D=0.1015625,本次数据集中L和D均为256。

提交要求

csv结果提交:针对算法竞赛,参赛者以csv文件格式,提交模型结果到大数据竞赛平台,平台进行在线评分,实时排名。目前平台仅支持单文件提交,即所有提交内容需要放在一个文件中。

提交示例

参赛者需要将所有模型检测结果放入一个csv文件中,命名为submission.csv,文件内容格式如下表所示:每一行为一个待检测影像的信息和结果,其中第一列存储待检测的影像名称(不包含后缀名),第二列存储检测的垂直边框信息,具体边框信息格式为[目标矩形中心点相对横坐标 目标矩形中心点相对纵坐标 目标矩形相对长度比例 目标矩形相对宽度比例](数字间用英文空格隔开),如果有多个垂直边框,用英文的“;”将边框信息进行分离。

评测标准

本次比赛采用Average Domain Accuracy进行结果评价,对于每一幅影像,检测精度评价公式为:

A c c u r a c y I m a g e = T P T P + F N + F P Accuracy Image = \frac{TP}{TP+FN+FP} AccuracyImage=TP+FN+FPTP

其中,TP (True Positive)表示样本被分为正样本,且分类正确;FP (False Positive)表示样本被分为正样本,而分类错误;FN (False Negative)表示样本被分为负样本,而分类错误;根据IoU是否大于0.5这个阈值来判断预测结果属于TP还是FP,IoU 的全称为交并比(Intersection over Union),其计算公式为:

I o U = A r e a o f O v e r l a p A r e a o f U n i o n IoU= \frac{Area of Overlap}{Area of Union} IoU=AreaofUnionAreaofOverlap

如果真值中没有任何船舶垂直边框,但预测结果中有,则该幅影像的船舶检测得分为0,如果预测结果中也没有检测出船舶,则得分为1。最后所有待检测影像的检测精度取平均即为最终得分。

赛题数据处理

数据下载

数据集可以从比赛官网下载:https://www.dcic-china.com/competitions/10022/datasets

!wget https://s3.cn-north-1.amazonaws.com.cn/files.datafountain.cn/uploads/images/competitions/10022/training_dataset-399976.zip
!wget https://s3.cn-north-1.amazonaws.com.cn/files.datafountain.cn/uploads/images/competitions/10022/test_dataset-220446.zip
!wget https://s3.cn-north-1.amazonaws.com.cn/files.datafountain.cn/uploads/images/competitions/10022/submit_example-463547.csv
--2022-02-14 10:06:04--  https://s3.cn-north-1.amazonaws.com.cn/files.datafountain.cn/uploads/images/competitions/10022/training_dataset-399976.zip
Resolving s3.cn-north-1.amazonaws.com.cn (s3.cn-north-1.amazonaws.com.cn)... 54.222.50.42
Connecting to s3.cn-north-1.amazonaws.com.cn (s3.cn-north-1.amazonaws.com.cn)|54.222.50.42|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 227358394 (217M) [application/octet-stream]
Saving to: ‘training_dataset-399976.zip’

training_dataset-39 100%[===================>] 216.83M  57.9MB/s    in 3.8s    

2022-02-14 10:06:08 (56.5 MB/s) - ‘training_dataset-399976.zip’ saved [227358394/227358394]

--2022-02-14 10:06:08--  https://s3.cn-north-1.amazonaws.com.cn/files.datafountain.cn/uploads/images/competitions/10022/test_dataset-220446.zip
Resolving s3.cn-north-1.amazonaws.com.cn (s3.cn-north-1.amazonaws.com.cn)... 54.222.50.42
Connecting to s3.cn-north-1.amazonaws.com.cn (s3.cn-north-1.amazonaws.com.cn)|54.222.50.42|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 189955951 (181M) [application/octet-stream]
Saving to: ‘test_dataset-220446.zip’

test_dataset-220446 100%[===================>] 181.16M  29.2MB/s    in 10s     

2022-02-14 10:06:18 (17.6 MB/s) - ‘test_dataset-220446.zip’ saved [189955951/189955951]
!unzip training_dataset-399976.zip > log.log
!unzip test_dataset-220446.zip > log.log

处理为VOC格式

处理教程:https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.3/docs/tutorials/PrepareDataSet.md

用户数据集转成VOC数据后目录结构如下(注意数据集中路径名、文件名尽量不要使用中文,避免中文编码问题导致出错):

dataset/xxx/
├── annotations
│   ├── xxx1.xml
│   ├── xxx2.xml
│   ├── xxx3.xml
│   |   ...
├── images
│   ├── xxx1.jpg
│   ├── xxx2.jpg
│   ├── xxx3.jpg
│   |   ...
├── label_list.txt (必须提供,且文件名称必须是label_list.txt )
├── train.txt (训练数据集文件列表, ./images/xxx1.jpg ./annotations/xxx1.xml)
└── valid.txt (测试数据集文件列表)
!mkdir dataset
!mkdir dataset/dcic2022/
!mkdir dataset/dcic2022/annotations
!mkdir dataset/dcic2022/images
!cp A/*.jpg dataset/dcic2022/images/
import os, sys, json

import os
from xml.dom import minidom
import xml.etree.cElementTree as ET
from PIL import Image

ANNOTATIONS_DIR_PREFIX = "./A/"

DESTINATION_DIR = "./dataset/dcic2022/annotations"

CLASS_MAPPING = {
    '0': 'boat'
}

def formatter(elem):
    """Return a pretty-printed XML string for the Element.
    """
    rough_string = ET.tostring(elem, 'utf-8')
    reparsed = minidom.parseString(rough_string)
    return reparsed.toprettyxml(indent="    ")

def create_root(file_prefix, width, height):
    root = ET.Element("annotation")
    ET.SubElement(root, "filename").text = "{}.jpg".format(file_prefix)
    size = ET.SubElement(root, "size")
    ET.SubElement(size, "width").text = str(width)
    ET.SubElement(size, "height").text = str(height)
    ET.SubElement(size, "depth").text = "3"
    return root


def create_object_annotation(root, voc_labels):
    for voc_label in voc_labels:
        obj = ET.SubElement(root, "object")
        ET.SubElement(obj, "name").text = voc_label[0]
        bbox = ET.SubElement(obj, "bndbox")
        ET.SubElement(bbox, "xmin").text = str(voc_label[1])
        ET.SubElement(bbox, "ymin").text = str(voc_label[2])
        ET.SubElement(bbox, "xmax").text = str(voc_label[3])
        ET.SubElement(bbox, "ymax").text = str(voc_label[4])
    return root


def create_file(file_prefix, width, height, voc_labels):
    root = create_root(file_prefix, width, height)
    root = create_object_annotation(root, voc_labels)
    with open("{}/{}.xml".format(DESTINATION_DIR, file_prefix), "w") as f:

            f.write(formatter(root))
            f.close()

def read_file(file_path):
    file_prefix = file_path.split(".txt")[0]
    image_file_name = file_path.replace('txt', 'jpg')
    img = Image.open(ANNOTATIONS_DIR_PREFIX + "/" + image_file_name)
    w, h = img.size
    with open(ANNOTATIONS_DIR_PREFIX +"/"+file_path, 'r') as file:
        lines = file.readlines()
        voc_labels = []
        for line in lines:
            voc = []
            line = line.strip()
            data = line.split()
            voc.append(CLASS_MAPPING.get(data[0]))
            bbox_width = float(data[3]) * w
            bbox_height = float(data[4]) * h
            center_x = float(data[1]) * w
            center_y = float(data[2]) * h
            voc.append(round(center_x - (bbox_width / 2)))
            voc.append(round(center_y - (bbox_height / 2)))
            voc.append(round(center_x + (bbox_width / 2)))
            voc.append(round(center_y + (bbox_height / 2)))
            voc_labels.append(voc)
        create_file(file_prefix, w, h, voc_labels)


def start():
    if not os.path.exists(DESTINATION_DIR):
        os.makedirs(DESTINATION_DIR)
    for filename in os.listdir(ANNOTATIONS_DIR_PREFIX):
        if filename.endswith('txt'):
            read_file(filename)


if __name__ == "__main__":
    start()
with open('./dataset/dcic2022/label_list.txt', 'w') as up:
    up.write('boat\n')

import glob
with open('./dataset/dcic2022/train.txt', 'w') as up:
    for filename in glob.glob(ANNOTATIONS_DIR_PREFIX+'/*.txt')[:-1000]:
        filename = os.path.basename(filename)[:-4]
        up.write(f"images/{filename}.jpg annotations/{filename}.xml\n")

with open('./dataset/dcic2022/valid.txt', 'w') as up:
    for filename in glob.glob(ANNOTATIONS_DIR_PREFIX+'/*.txt')[-1000:]:
        filename = os.path.basename(filename)[:-4]
        up.write(f"images/{filename}.jpg annotations/{filename}.xml\n")

安装PaddleDetection

参考教程:https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.3/docs/tutorials/INSTALL_cn.md

# !git clone https://gitee.com/PaddlePaddle/PaddleDetection.git

# 安装其他依赖
!pip install -r PaddleDetection/requirements.txt > log.log

# 编译安装paddledet
!cd PaddleDetection && python setup.py install > log.log
[33mWARNING: You are using pip version 21.3.1; however, version 22.0.3 is available.
You should consider upgrading via the '/opt/conda/envs/python35-paddle120-env/bin/python -m pip install --upgrade pip' command.[0m
zip_safe flag not set; analyzing archive contents...
ppdet.data.transform.__pycache__.autoaugment_utils.cpython-37: module MAY be using inspect.stack
ppdet.modeling.tests.__pycache__.test_ops.cpython-37: module references __file__
ppdet.modeling.tests.__pycache__.test_yolov3_loss.cpython-37: module references __file__
!cd PaddleDetection && python ppdet/modeling/tests/test_architectures.py
W0214 10:36:34.864857  1568 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.0, Runtime API Version: 10.1
W0214 10:36:34.870085  1568 device_context.cc:465] device: 0, cuDNN Version: 7.6.
.......
----------------------------------------------------------------------
Ran 7 tests in 3.139s

OK

模型训练

  1. /home/aistudio/PaddleDetection/configs/目录中找到想要的模型,这里使用VOC标注,则只能用VOC模型。
  2. 若使用yolov3/yolov3_mobilenet_v1_270e_voc.yml, 则需要修改两个文件:

datasets/voc.yml:具体的数据集路径;

metric: VOC
map_type: 11point
num_classes: 1

TrainDataset:
  !VOCDataSet
    dataset_dir: /home/aistudio/dataset/dcic2022
    anno_path: train.txt
    label_list: label_list.txt
    data_fields: ['image', 'gt_bbox', 'gt_class', 'difficult']

EvalDataset:
  !VOCDataSet
    dataset_dir: /home/aistudio/dataset/dcic2022
    anno_path: valid.txt
    label_list: label_list.txt
    data_fields: ['image', 'gt_bbox', 'gt_class', 'difficult']

TestDataset:
  !ImageFolder
    anno_path: /home/aistudio/dataset/dcic2022/label_list.txt

yolov3/yolov3_mobilenet_v1_270e_voc.yml:Epoch个数、学习率等

_BASE_: [
  '../datasets/voc.yml',
  '../runtime.yml',
  '_base_/optimizer_270e.yml',
  '_base_/yolov3_mobilenet_v1.yml',
  '_base_/yolov3_reader.yml',
]

snapshot_epoch: 1
weights: /home/aistudio/PaddleDetection/output/yolov3_mobilenet_v1_270e_voc/model_final

TrainReader:
  mixup_epoch: 3
  batch_size: 20

epoch: 20
! cd PaddleDetection && python tools/train.py -c /home/aistudio/PaddleDetection/configs/yolov3/yolov3_mobilenet_v1_270e_voc.yml
W0214 11:37:30.243651  7222 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.0, Runtime API Version: 10.1
W0214 11:37:30.248795  7222 device_context.cc:465] device: 0, cuDNN Version: 7.6.
[02/14 11:37:33] ppdet.utils.checkpoint INFO: Finish loading model weights: /home/aistudio/.cache/paddle/weights/MobileNetV1_pretrained.pdparams
[02/14 11:37:33] ppdet.engine INFO: Epoch: [0] [  0/250] learning_rate: 0.000000 loss_xy: 4.211523 loss_wh: 4.933544 loss_obj: 12262.643555 loss_cls: 0.984791 loss: 12272.773438 eta: 0:20:58 batch_cost: 0.2517 data_cost: 0.0057 ips: 79.4743 images/s
[02/14 11:37:42] ppdet.engine INFO: Epoch: [0] [ 20/250] learning_rate: 0.000020 loss_xy: 3.918948 loss_wh: 4.238955 loss_obj: 79.142502 loss_cls: 0.916811 loss: 87.835999 eta: 0:35:28 batch_cost: 0.4363 data_cost: 0.1907 ips: 45.8420 images/s
[02/14 11:37:53] ppdet.engine INFO: Epoch: [0] [ 40/250] learning_rate: 0.000040 loss_xy: 3.604503 loss_wh: 3.484425 loss_obj: 20.492111 loss_cls: 0.875418 loss: 28.281525 eta: 0:39:12 batch_cost: 0.5235 data_cost: 0.2605 ips: 38.2017 images/s
[02/14 11:38:01] ppdet.engine INFO: Epoch: [0] [ 60/250] learning_rate: 0.000060 loss_xy: 3.464817 loss_wh: 3.248878 loss_obj: 21.802286 loss_cls: 0.736305 loss: 28.504791 eta: 0:37:41 batch_cost: 0.4236 data_cost: 0.1932 ips: 47.2149 images/s
[02/14 11:38:13] ppdet.engine INFO: Epoch: [0] [ 80/250] learning_rate: 0.000080 loss_xy: 3.168384 loss_wh: 2.552524 loss_obj: 14.709585 loss_cls: 0.611451 loss: 20.969593 eta: 0:40:02 batch_cost: 0.5821 data_cost: 0.3124 ips: 34.3613 images/s
[02/14 11:38:23] ppdet.engine INFO: Epoch: [0] [100/250] learning_rate: 0.000100 loss_xy: 2.979206 loss_wh: 2.321775 loss_obj: 10.492561 loss_cls: 0.524147 loss: 16.544930 eta: 0:40:13 batch_cost: 0.5093 data_cost: 0.2645 ips: 39.2715 images/s
[02/14 11:38:33] ppdet.engine INFO: Epoch: [0] [120/250] learning_rate: 0.000120 loss_xy: 3.020241 loss_wh: 2.099936 loss_obj: 9.058322 loss_cls: 0.449550 loss: 14.438893 eta: 0:39:56 batch_cost: 0.4839 data_cost: 0.2465 ips: 41.3328 images/s
[02/14 11:38:42] ppdet.engine INFO: Epoch: [0] [140/250] learning_rate: 0.000140 loss_xy: 2.910303 loss_wh: 1.936828 loss_obj: 8.196039 loss_cls: 0.338476 loss: 13.385446 eta: 0:39:38 batch_cost: 0.4786 data_cost: 0.2420 ips: 41.7865 images/s
[02/14 11:38:53] ppdet.engine INFO: Epoch: [0] [160/250] learning_rate: 0.000160 loss_xy: 3.015123 loss_wh: 1.784923 loss_obj: 7.639497 loss_cls: 0.311909 loss: 13.008919 eta: 0:39:58 batch_cost: 0.5387 data_cost: 0.2609 ips: 37.1238 images/s
[02/14 11:39:03] ppdet.engine INFO: Epoch: [0] [180/250] learning_rate: 0.000180 loss_xy: 3.029733 loss_wh: 1.755864 loss_obj: 7.514335 loss_cls: 0.257544 loss: 12.280306 eta: 0:39:46 batch_cost: 0.4914 data_cost: 0.2386 ips: 40.6989 images/s
[02/14 11:39:14] ppdet.engine INFO: Epoch: [0] [200/250] learning_rate: 0.000200 loss_xy: 2.974578 loss_wh: 1.713304 loss_obj: 7.368442 loss_cls: 0.252316 loss: 12.241861 eta: 0:39:52 batch_cost: 0.5292 data_cost: 0.2662 ips: 37.7957 images/s
[02/14 11:39:24] ppdet.engine INFO: Epoch: [0] [220/250] learning_rate: 0.000220 loss_xy: 3.050199 loss_wh: 1.670280 loss_obj: 6.662316 loss_cls: 0.186254 loss: 11.605258 eta: 0:39:49 batch_cost: 0.5149 data_cost: 0.2651 ips: 38.8457 images/s
[02/14 11:39:34] ppdet.engine INFO: Epoch: [0] [240/250] learning_rate: 0.000240 loss_xy: 2.984077 loss_wh: 1.622474 loss_obj: 6.716498 loss_cls: 0.173670 loss: 11.701237 eta: 0:39:43 batch_cost: 0.5095 data_cost: 0.2861 ips: 39.2563 images/s
[02/14 11:39:41] ppdet.utils.checkpoint INFO: Save checkpoint: output/yolov3_mobilenet_v1_270e_voc
[02/14 11:39:41] ppdet.engine INFO: Epoch: [1] [  0/250] learning_rate: 0.000250 loss_xy: 2.865397 loss_wh: 1.517569 loss_obj: 6.461586 loss_cls: 0.159698 loss: 10.924330 eta: 0:39:35 batch_cost: 0.4783 data_cost: 0.2646 ips: 41.8162 images/s
[02/14 11:39:50] ppdet.engine INFO: Epoch: [1] [ 20/250] learning_rate: 0.000270 loss_xy: 2.782643 loss_wh: 1.518933 loss_obj: 6.214414 loss_cls: 0.132598 loss: 10.547352 eta: 0:38:56 batch_cost: 0.4156 data_cost: 0.1749 ips: 48.1259 images/s
[02/14 11:40:02] ppdet.engine INFO: Epoch: [1] [ 40/250] learning_rate: 0.000290 loss_xy: 2.916654 loss_wh: 1.435263 loss_obj: 5.931459 loss_cls: 0.096850 loss: 10.364725 eta: 0:39:23 batch_cost: 0.6077 data_cost: 0.3580 ips: 32.9120 images/s
[02/14 11:40:14] ppdet.engine INFO: Epoch: [1] [ 60/250] learning_rate: 0.000310 loss_xy: 3.038536 loss_wh: 1.529920 loss_obj: 6.623701 loss_cls: 0.104412 loss: 11.404231 eta: 0:39:41 batch_cost: 0.5948 data_cost: 0.3130 ips: 33.6240 images/s
[02/14 11:40:22] ppdet.engine INFO: Epoch: [1] [ 80/250] learning_rate: 0.000330 loss_xy: 2.977486 loss_wh: 1.369704 loss_obj: 6.201667 loss_cls: 0.098693 loss: 10.700809 eta: 0:39:04 batch_cost: 0.4149 data_cost: 0.2015 ips: 48.2036 images/s
[02/14 11:40:31] ppdet.engine INFO: Epoch: [1] [100/250] learning_rate: 0.000350 loss_xy: 2.918997 loss_wh: 1.316880 loss_obj: 6.160943 loss_cls: 0.079857 loss: 10.443937 eta: 0:38:44 batch_cost: 0.4648 data_cost: 0.2294 ips: 43.0309 images/s
[02/14 11:40:42] ppdet.engine INFO: Epoch: [1] [120/250] learning_rate: 0.000370 loss_xy: 2.740678 loss_wh: 1.259787 loss_obj: 5.779213 loss_cls: 0.076860 loss: 9.811507 eta: 0:38:40 batch_cost: 0.5217 data_cost: 0.2606 ips: 38.3343 images/s
[02/14 11:40:52] ppdet.engine INFO: Epoch: [1] [140/250] learning_rate: 0.000390 loss_xy: 2.857815 loss_wh: 1.211745 loss_obj: 5.579091 loss_cls: 0.073977 loss: 9.630438 eta: 0:38:35 batch_cost: 0.5218 data_cost: 0.2719 ips: 38.3270 images/s
[02/14 11:41:02] ppdet.engine INFO: Epoch: [1] [160/250] learning_rate: 0.000410 loss_xy: 2.697852 loss_wh: 1.207855 loss_obj: 5.558590 loss_cls: 0.055053 loss: 9.495821 eta: 0:38:24 batch_cost: 0.4978 data_cost: 0.2410 ips: 40.1740 images/s
[02/14 11:41:14] ppdet.engine INFO: Epoch: [1] [180/250] learning_rate: 0.000430 loss_xy: 2.848187 loss_wh: 1.161380 loss_obj: 5.719685 loss_cls: 0.058091 loss: 9.803569 eta: 0:38:33 batch_cost: 0.5930 data_cost: 0.3378 ips: 33.7283 images/s
[02/14 11:41:24] ppdet.engine INFO: Epoch: [1] [200/250] learning_rate: 0.000450 loss_xy: 2.742299 loss_wh: 1.231194 loss_obj: 5.472292 loss_cls: 0.046757 loss: 9.567951 eta: 0:38:21 batch_cost: 0.4998 data_cost: 0.2588 ips: 40.0123 images/s
[02/14 11:41:33] ppdet.engine INFO: Epoch: [1] [220/250] learning_rate: 0.000470 loss_xy: 2.537036 loss_wh: 1.115607 loss_obj: 4.949556 loss_cls: 0.046823 loss: 8.590495 eta: 0:38:00 batch_cost: 0.4493 data_cost: 0.2173 ips: 44.5177 images/s
[02/14 11:41:42] ppdet.engine INFO: Epoch: [1] [240/250] learning_rate: 0.000490 loss_xy: 2.958036 loss_wh: 1.167597 loss_obj: 5.391256 loss_cls: 0.051324 loss: 9.722068 eta: 0:37:40 batch_cost: 0.4447 data_cost: 0.2310 ips: 44.9694 images/s
[02/14 11:41:50] ppdet.utils.checkpoint INFO: Save checkpoint: output/yolov3_mobilenet_v1_270e_voc
[02/14 11:41:50] ppdet.engine INFO: Epoch: [2] [  0/250] learning_rate: 0.000500 loss_xy: 2.763289 loss_wh: 1.206612 loss_obj: 5.253253 loss_cls: 0.046876 loss: 9.466081 eta: 0:37:39 batch_cost: 0.4873 data_cost: 0.2265 ips: 41.0438 images/s
[02/14 11:42:01] ppdet.engine INFO: Epoch: [2] [ 20/250] learning_rate: 0.000520 loss_xy: 2.742019 loss_wh: 1.114718 loss_obj: 5.257817 loss_cls: 0.041148 loss: 9.155441 eta: 0:37:39 batch_cost: 0.5590 data_cost: 0.2863 ips: 35.7790 images/s
[02/14 11:42:12] ppdet.engine INFO: Epoch: [2] [ 40/250] learning_rate: 0.000540 loss_xy: 2.825437 loss_wh: 1.108487 loss_obj: 5.247468 loss_cls: 0.041064 loss: 9.258602 eta: 0:37:37 batch_cost: 0.5542 data_cost: 0.2819 ips: 36.0876 images/s
[02/14 11:42:23] ppdet.engine INFO: Epoch: [2] [ 60/250] learning_rate: 0.000560 loss_xy: 2.618235 loss_wh: 1.180033 loss_obj: 4.937355 loss_cls: 0.035540 loss: 8.780150 eta: 0:37:31 batch_cost: 0.5340 data_cost: 0.2694 ips: 37.4516 images/s
[02/14 11:42:32] ppdet.engine INFO: Epoch: [2] [ 80/250] learning_rate: 0.000580 loss_xy: 2.861189 loss_wh: 1.241123 loss_obj: 5.777656 loss_cls: 0.045183 loss: 9.847123 eta: 0:37:10 batch_cost: 0.4363 data_cost: 0.2094 ips: 45.8414 images/s
[02/14 11:42:42] ppdet.engine INFO: Epoch: [2] [100/250] learning_rate: 0.000600 loss_xy: 2.731591 loss_wh: 1.150417 loss_obj: 5.022276 loss_cls: 0.039340 loss: 9.003639 eta: 0:37:01 batch_cost: 0.5069 data_cost: 0.2575 ips: 39.4533 images/s
[02/14 11:42:53] ppdet.engine INFO: Epoch: [2] [120/250] learning_rate: 0.000620 loss_xy: 2.710895 loss_wh: 1.065850 loss_obj: 4.713553 loss_cls: 0.031407 loss: 8.738023 eta: 0:36:54 batch_cost: 0.5308 data_cost: 0.2685 ips: 37.6755 images/s
[02/14 11:43:03] ppdet.engine INFO: Epoch: [2] [140/250] learning_rate: 0.000640 loss_xy: 2.763243 loss_wh: 1.108770 loss_obj: 5.118391 loss_cls: 0.034212 loss: 9.084898 eta: 0:36:47 batch_cost: 0.5280 data_cost: 0.2676 ips: 37.8753 images/s
[02/14 11:43:14] ppdet.engine INFO: Epoch: [2] [160/250] learning_rate: 0.000660 loss_xy: 2.682302 loss_wh: 1.107045 loss_obj: 4.808344 loss_cls: 0.029852 loss: 8.820806 eta: 0:36:43 batch_cost: 0.5535 data_cost: 0.3017 ips: 36.1364 images/s
[02/14 11:43:24] ppdet.engine INFO: Epoch: [2] [180/250] learning_rate: 0.000680 loss_xy: 2.509732 loss_wh: 1.017913 loss_obj: 4.838999 loss_cls: 0.032071 loss: 8.282619 eta: 0:36:33 batch_cost: 0.5044 data_cost: 0.2499 ips: 39.6524 images/s
[02/14 11:43:34] ppdet.engine INFO: Epoch: [2] [200/250] learning_rate: 0.000700 loss_xy: 2.626160 loss_wh: 0.988519 loss_obj: 4.821582 loss_cls: 0.034374 loss: 8.259589 eta: 0:36:20 batch_cost: 0.4860 data_cost: 0.2407 ips: 41.1496 images/s
[02/14 11:43:44] ppdet.engine INFO: Epoch: [2] [220/250] learning_rate: 0.000720 loss_xy: 2.594471 loss_wh: 0.982242 loss_obj: 4.845818 loss_cls: 0.037054 loss: 8.598868 eta: 0:36:10 batch_cost: 0.5143 data_cost: 0.2556 ips: 38.8871 images/s
[02/14 11:43:54] ppdet.engine INFO: Epoch: [2] [240/250] learning_rate: 0.000740 loss_xy: 2.684312 loss_wh: 1.087606 loss_obj: 4.761986 loss_cls: 0.034154 loss: 8.626896 eta: 0:35:56 batch_cost: 0.4689 data_cost: 0.2134 ips: 42.6504 images/s
[02/14 11:44:01] ppdet.utils.checkpoint INFO: Save checkpoint: output/yolov3_mobilenet_v1_270e_voc
[02/14 11:44:02] ppdet.engine INFO: Epoch: [3] [  0/250] learning_rate: 0.000750 loss_xy: 2.684312 loss_wh: 1.055543 loss_obj: 4.655610 loss_cls: 0.034058 loss: 8.513296 eta: 0:35:52 batch_cost: 0.5099 data_cost: 0.2603 ips: 39.2260 images/s
[02/14 11:44:11] ppdet.engine INFO: Epoch: [3] [ 20/250] learning_rate: 0.000770 loss_xy: 2.564631 loss_wh: 0.956590 loss_obj: 4.633693 loss_cls: 0.027722 loss: 8.371277 eta: 0:35:40 batch_cost: 0.4832 data_cost: 0.2205 ips: 41.3876 images/s
[02/14 11:44:20] ppdet.engine INFO: Epoch: [3] [ 40/250] learning_rate: 0.000790 loss_xy: 2.688945 loss_wh: 1.049507 loss_obj: 4.619424 loss_cls: 0.033207 loss: 8.528358 eta: 0:35:24 batch_cost: 0.4539 data_cost: 0.2186 ips: 44.0646 images/s
[02/14 11:44:31] ppdet.engine INFO: Epoch: [3] [ 60/250] learning_rate: 0.000810 loss_xy: 2.503797 loss_wh: 0.913589 loss_obj: 4.361061 loss_cls: 0.026161 loss: 7.804991 eta: 0:35:16 batch_cost: 0.5259 data_cost: 0.2673 ips: 38.0309 images/s
[02/14 11:44:41] ppdet.engine INFO: Epoch: [3] [ 80/250] learning_rate: 0.000830 loss_xy: 2.681324 loss_wh: 0.977800 loss_obj: 4.696493 loss_cls: 0.029967 loss: 8.294094 eta: 0:35:04 batch_cost: 0.4889 data_cost: 0.2497 ips: 40.9089 images/s
[02/14 11:44:50] ppdet.engine INFO: Epoch: [3] [100/250] learning_rate: 0.000850 loss_xy: 2.667560 loss_wh: 0.991379 loss_obj: 4.663275 loss_cls: 0.029990 loss: 8.384295 eta: 0:34:51 batch_cost: 0.4680 data_cost: 0.2321 ips: 42.7380 images/s
[02/14 11:45:00] ppdet.engine INFO: Epoch: [3] [120/250] learning_rate: 0.000870 loss_xy: 2.698930 loss_wh: 1.097622 loss_obj: 4.658214 loss_cls: 0.024242 loss: 8.475294 eta: 0:34:38 batch_cost: 0.4802 data_cost: 0.2700 ips: 41.6491 images/s
[02/14 11:45:09] ppdet.engine INFO: Epoch: [3] [140/250] learning_rate: 0.000890 loss_xy: 2.628611 loss_wh: 0.970755 loss_obj: 4.470719 loss_cls: 0.028001 loss: 8.023263 eta: 0:34:25 batch_cost: 0.4680 data_cost: 0.2131 ips: 42.7315 images/s
[02/14 11:45:20] ppdet.engine INFO: Epoch: [3] [160/250] learning_rate: 0.000910 loss_xy: 2.454465 loss_wh: 0.900770 loss_obj: 4.301339 loss_cls: 0.025990 loss: 7.591149 eta: 0:34:16 batch_cost: 0.5200 data_cost: 0.2724 ips: 38.4633 images/s
[02/14 11:45:29] ppdet.engine INFO: Epoch: [3] [180/250] learning_rate: 0.000930 loss_xy: 2.659358 loss_wh: 0.951667 loss_obj: 4.785394 loss_cls: 0.027588 loss: 8.411111 eta: 0:34:03 batch_cost: 0.4632 data_cost: 0.2290 ips: 43.1791 images/s
[02/14 11:45:38] ppdet.engine INFO: Epoch: [3] [200/250] learning_rate: 0.000950 loss_xy: 2.648512 loss_wh: 0.972924 loss_obj: 4.647039 loss_cls: 0.026919 loss: 8.171605 eta: 0:33:51 batch_cost: 0.4748 data_cost: 0.2589 ips: 42.1245 images/s
[02/14 11:45:50] ppdet.engine INFO: Epoch: [3] [220/250] learning_rate: 0.000970 loss_xy: 2.570681 loss_wh: 0.994709 loss_obj: 4.751373 loss_cls: 0.025285 loss: 8.406171 eta: 0:33:49 batch_cost: 0.6019 data_cost: 0.3385 ips: 33.2279 images/s
[02/14 11:46:00] ppdet.engine INFO: Epoch: [3] [240/250] learning_rate: 0.000990 loss_xy: 2.636519 loss_wh: 0.945552 loss_obj: 4.316590 loss_cls: 0.025468 loss: 7.904440 eta: 0:33:36 batch_cost: 0.4630 data_cost: 0.2224 ips: 43.1986 images/s
[02/14 11:46:07] ppdet.utils.checkpoint INFO: Save checkpoint: output/yolov3_mobilenet_v1_270e_voc
[02/14 11:46:08] ppdet.engine INFO: Epoch: [4] [  0/250] learning_rate: 0.001000 loss_xy: 2.657236 loss_wh: 0.951558 loss_obj: 4.353420 loss_cls: 0.025765 loss: 8.059834 eta: 0:33:31 batch_cost: 0.4843 data_cost: 0.2460 ips: 41.2973 images/s
[02/14 11:46:16] ppdet.engine INFO: Epoch: [4] [ 20/250] learning_rate: 0.001000 loss_xy: 3.019150 loss_wh: 1.059602 loss_obj: 4.442964 loss_cls: 0.027527 loss: 8.465836 eta: 0:33:14 batch_cost: 0.4128 data_cost: 0.1778 ips: 48.4446 images/s
[02/14 11:46:26] ppdet.engine INFO: Epoch: [4] [ 40/250] learning_rate: 0.001000 loss_xy: 2.830184 loss_wh: 1.256013 loss_obj: 4.130886 loss_cls: 0.025790 loss: 8.210125 eta: 0:33:03 batch_cost: 0.4866 data_cost: 0.2493 ips: 41.0989 images/s
[02/14 11:46:34] ppdet.engine INFO: Epoch: [4] [ 60/250] learning_rate: 0.001000 loss_xy: 2.914722 loss_wh: 0.988376 loss_obj: 4.097473 loss_cls: 0.034991 loss: 8.172005 eta: 0:32:47 batch_cost: 0.4153 data_cost: 0.2037 ips: 48.1560 images/s
[02/14 11:46:44] ppdet.engine INFO: Epoch: [4] [ 80/250] learning_rate: 0.001000 loss_xy: 2.866474 loss_wh: 1.040445 loss_obj: 3.908506 loss_cls: 0.024143 loss: 7.863092 eta: 0:32:38 batch_cost: 0.5198 data_cost: 0.2660 ips: 38.4777 images/s
[02/14 11:46:53] ppdet.engine INFO: Epoch: [4] [100/250] learning_rate: 0.001000 loss_xy: 3.134699 loss_wh: 1.108365 loss_obj: 4.199218 loss_cls: 0.027703 loss: 8.531222 eta: 0:32:22 batch_cost: 0.4191 data_cost: 0.1845 ips: 47.7208 images/s
[02/14 11:47:04] ppdet.engine INFO: Epoch: [4] [120/250] learning_rate: 0.001000 loss_xy: 2.789737 loss_wh: 0.922789 loss_obj: 3.998369 loss_cls: 0.026055 loss: 7.933390 eta: 0:32:18 batch_cost: 0.5741 data_cost: 0.3047 ips: 34.8360 images/s
[02/14 11:47:14] ppdet.engine INFO: Epoch: [4] [140/250] learning_rate: 0.001000 loss_xy: 2.819648 loss_wh: 0.953050 loss_obj: 4.027344 loss_cls: 0.026122 loss: 7.956028 eta: 0:32:06 batch_cost: 0.4691 data_cost: 0.2262 ips: 42.6332 images/s
[02/14 11:47:22] ppdet.engine INFO: Epoch: [4] [160/250] learning_rate: 0.001000 loss_xy: 2.807614 loss_wh: 1.077560 loss_obj: 3.808527 loss_cls: 0.022531 loss: 7.860357 eta: 0:31:51 batch_cost: 0.4340 data_cost: 0.1980 ips: 46.0814 images/s
[02/14 11:47:33] ppdet.engine INFO: Epoch: [4] [180/250] learning_rate: 0.001000 loss_xy: 2.959235 loss_wh: 1.036566 loss_obj: 4.006955 loss_cls: 0.029244 loss: 8.355703 eta: 0:31:42 batch_cost: 0.5091 data_cost: 0.2596 ips: 39.2824 images/s
[02/14 11:47:43] ppdet.engine INFO: Epoch: [4] [200/250] learning_rate: 0.001000 loss_xy: 2.731633 loss_wh: 0.904653 loss_obj: 3.809579 loss_cls: 0.025689 loss: 7.443643 eta: 0:31:34 batch_cost: 0.5281 data_cost: 0.2561 ips: 37.8692 images/s
[02/14 11:47:52] ppdet.engine INFO: Epoch: [4] [220/250] learning_rate: 0.001000 loss_xy: 2.868181 loss_wh: 1.137552 loss_obj: 4.155954 loss_cls: 0.025518 loss: 8.479705 eta: 0:31:22 batch_cost: 0.4592 data_cost: 0.2123 ips: 43.5550 images/s
[02/14 11:48:02] ppdet.engine INFO: Epoch: [4] [240/250] learning_rate: 0.001000 loss_xy: 3.068735 loss_wh: 1.000112 loss_obj: 4.232449 loss_cls: 0.028781 loss: 8.046726 eta: 0:31:10 batch_cost: 0.4613 data_cost: 0.2259 ips: 43.3580 images/s
[02/14 11:48:08] ppdet.utils.checkpoint INFO: Save checkpoint: output/yolov3_mobilenet_v1_270e_voc
[02/14 11:48:09] ppdet.engine INFO: Epoch: [5] [  0/250] learning_rate: 0.001000 loss_xy: 2.912459 loss_wh: 0.961030 loss_obj: 4.093998 loss_cls: 0.025200 loss: 7.923099 eta: 0:31:03 batch_cost: 0.4428 data_cost: 0.2095 ips: 45.1666 images/s
[02/14 11:48:19] ppdet.engine INFO: Epoch: [5] [ 20/250] learning_rate: 0.001000 loss_xy: 2.819469 loss_wh: 0.955270 loss_obj: 3.813091 loss_cls: 0.022501 loss: 7.797729 eta: 0:30:55 batch_cost: 0.5324 data_cost: 0.2744 ips: 37.5679 images/s
[02/14 11:48:28] ppdet.engine INFO: Epoch: [5] [ 40/250] learning_rate: 0.001000 loss_xy: 3.013165 loss_wh: 1.027625 loss_obj: 4.076199 loss_cls: 0.030042 loss: 8.005311 eta: 0:30:42 batch_cost: 0.4491 data_cost: 0.2098 ips: 44.5296 images/s
[02/14 11:48:36] ppdet.engine INFO: Epoch: [5] [ 60/250] learning_rate: 0.001000 loss_xy: 2.835916 loss_wh: 0.823307 loss_obj: 3.422876 loss_cls: 0.020805 loss: 7.108488 eta: 0:30:26 batch_cost: 0.3945 data_cost: 0.2046 ips: 50.6945 images/s
[02/14 11:48:47] ppdet.engine INFO: Epoch: [5] [ 80/250] learning_rate: 0.001000 loss_xy: 2.955272 loss_wh: 1.078380 loss_obj: 3.818774 loss_cls: 0.023902 loss: 7.521904 eta: 0:30:20 batch_cost: 0.5497 data_cost: 0.2930 ips: 36.3852 images/s
[02/14 11:48:56] ppdet.engine INFO: Epoch: [5] [100/250] learning_rate: 0.001000 loss_xy: 2.999118 loss_wh: 0.972738 loss_obj: 3.721312 loss_cls: 0.025809 loss: 7.953426 eta: 0:30:07 batch_cost: 0.4483 data_cost: 0.2098 ips: 44.6135 images/s
[02/14 11:49:06] ppdet.engine INFO: Epoch: [5] [120/250] learning_rate: 0.001000 loss_xy: 2.985615 loss_wh: 1.026657 loss_obj: 4.139192 loss_cls: 0.026472 loss: 8.471451 eta: 0:29:57 batch_cost: 0.4918 data_cost: 0.2310 ips: 40.6681 images/s
[02/14 11:49:16] ppdet.engine INFO: Epoch: [5] [140/250] learning_rate: 0.001000 loss_xy: 2.918096 loss_wh: 0.933082 loss_obj: 3.775796 loss_cls: 0.023197 loss: 7.842833 eta: 0:29:47 batch_cost: 0.4862 data_cost: 0.2389 ips: 41.1337 images/s
[02/14 11:49:25] ppdet.engine INFO: Epoch: [5] [160/250] learning_rate: 0.001000 loss_xy: 2.767118 loss_wh: 0.852808 loss_obj: 3.585180 loss_cls: 0.020037 loss: 6.996584 eta: 0:29:34 batch_cost: 0.4434 data_cost: 0.2263 ips: 45.1058 images/s
[02/14 11:49:35] ppdet.engine INFO: Epoch: [5] [180/250] learning_rate: 0.001000 loss_xy: 2.828590 loss_wh: 0.962670 loss_obj: 3.617646 loss_cls: 0.020477 loss: 7.364550 eta: 0:29:25 batch_cost: 0.5056 data_cost: 0.2635 ips: 39.5557 images/s
[02/14 11:49:45] ppdet.engine INFO: Epoch: [5] [200/250] learning_rate: 0.001000 loss_xy: 2.788789 loss_wh: 0.955206 loss_obj: 3.683655 loss_cls: 0.024221 loss: 7.364789 eta: 0:29:15 batch_cost: 0.5038 data_cost: 0.2736 ips: 39.6982 images/s
[02/14 11:49:55] ppdet.engine INFO: Epoch: [5] [220/250] learning_rate: 0.001000 loss_xy: 2.775155 loss_wh: 0.942037 loss_obj: 3.872842 loss_cls: 0.020432 loss: 7.382660 eta: 0:29:05 batch_cost: 0.4890 data_cost: 0.2338 ips: 40.8962 images/s
[02/14 11:50:05] ppdet.engine INFO: Epoch: [5] [240/250] learning_rate: 0.001000 loss_xy: 2.730427 loss_wh: 0.845021 loss_obj: 3.553670 loss_cls: 0.020631 loss: 7.192092 eta: 0:28:55 batch_cost: 0.4956 data_cost: 0.2386 ips: 40.3546 images/s
[02/14 11:50:11] ppdet.utils.checkpoint INFO: Save checkpoint: output/yolov3_mobilenet_v1_270e_voc
[02/14 11:50:12] ppdet.engine INFO: Epoch: [6] [  0/250] learning_rate: 0.001000 loss_xy: 2.834534 loss_wh: 0.882453 loss_obj: 3.676017 loss_cls: 0.020480 loss: 7.705729 eta: 0:28:50 batch_cost: 0.4867 data_cost: 0.2443 ips: 41.0953 images/s
[02/14 11:50:21] ppdet.engine INFO: Epoch: [6] [ 20/250] learning_rate: 0.001000 loss_xy: 2.993328 loss_wh: 0.923766 loss_obj: 3.519182 loss_cls: 0.022602 loss: 7.435281 eta: 0:28:38 batch_cost: 0.4425 data_cost: 0.1942 ips: 45.2021 images/s
[02/14 11:50:30] ppdet.engine INFO: Epoch: [6] [ 40/250] learning_rate: 0.001000 loss_xy: 2.864497 loss_wh: 0.825285 loss_obj: 3.340815 loss_cls: 0.015925 loss: 7.250584 eta: 0:28:26 batch_cost: 0.4591 data_cost: 0.2258 ips: 43.5639 images/s
[02/14 11:50:40] ppdet.engine INFO: Epoch: [6] [ 60/250] learning_rate: 0.001000 loss_xy: 2.764090 loss_wh: 0.810898 loss_obj: 3.112221 loss_cls: 0.019247 loss: 6.644335 eta: 0:28:16 batch_cost: 0.4850 data_cost: 0.2472 ips: 41.2372 images/s
[02/14 11:50:51] ppdet.engine INFO: Epoch: [6] [ 80/250] learning_rate: 0.001000 loss_xy: 3.002062 loss_wh: 0.907738 loss_obj: 3.538936 loss_cls: 0.023819 loss: 7.449589 eta: 0:28:09 batch_cost: 0.5681 data_cost: 0.2753 ips: 35.2020 images/s
[02/14 11:51:00] ppdet.engine INFO: Epoch: [6] [100/250] learning_rate: 0.001000 loss_xy: 3.049606 loss_wh: 1.011174 loss_obj: 4.039334 loss_cls: 0.021758 loss: 7.887333 eta: 0:27:59 batch_cost: 0.4791 data_cost: 0.2340 ips: 41.7461 images/s
[02/14 11:51:10] ppdet.engine INFO: Epoch: [6] [120/250] learning_rate: 0.001000 loss_xy: 2.690320 loss_wh: 0.875414 loss_obj: 3.355072 loss_cls: 0.017530 loss: 7.050874 eta: 0:27:48 batch_cost: 0.4791 data_cost: 0.2311 ips: 41.7448 images/s
[02/14 11:51:20] ppdet.engine INFO: Epoch: [6] [140/250] learning_rate: 0.001000 loss_xy: 2.833232 loss_wh: 0.916721 loss_obj: 3.477148 loss_cls: 0.016971 loss: 7.308310 eta: 0:27:39 batch_cost: 0.4967 data_cost: 0.1732 ips: 40.2676 images/s
[02/14 11:51:31] ppdet.engine INFO: Epoch: [6] [160/250] learning_rate: 0.001000 loss_xy: 2.833611 loss_wh: 0.850980 loss_obj: 3.585407 loss_cls: 0.016932 loss: 7.447377 eta: 0:27:30 batch_cost: 0.5362 data_cost: 0.2589 ips: 37.2962 images/s
[02/14 11:51:40] ppdet.engine INFO: Epoch: [6] [180/250] learning_rate: 0.001000 loss_xy: 2.869416 loss_wh: 0.890706 loss_obj: 3.570747 loss_cls: 0.019150 loss: 7.310745 eta: 0:27:19 batch_cost: 0.4701 data_cost: 0.2239 ips: 42.5486 images/s
[02/14 11:51:50] ppdet.engine INFO: Epoch: [6] [200/250] learning_rate: 0.001000 loss_xy: 2.834251 loss_wh: 0.877070 loss_obj: 3.586669 loss_cls: 0.016627 loss: 7.192966 eta: 0:27:10 batch_cost: 0.5031 data_cost: 0.2478 ips: 39.7555 images/s
[02/14 11:52:00] ppdet.engine INFO: Epoch: [6] [220/250] learning_rate: 0.001000 loss_xy: 2.788343 loss_wh: 0.862371 loss_obj: 3.240864 loss_cls: 0.016577 loss: 6.877095 eta: 0:27:01 batch_cost: 0.5057 data_cost: 0.2516 ips: 39.5491 images/s
[02/14 11:52:11] ppdet.engine INFO: Epoch: [6] [240/250] learning_rate: 0.001000 loss_xy: 2.882277 loss_wh: 0.788067 loss_obj: 3.090440 loss_cls: 0.016931 loss: 6.601988 eta: 0:26:52 batch_cost: 0.5340 data_cost: 0.2579 ips: 37.4530 images/s
[02/14 11:52:17] ppdet.utils.checkpoint INFO: Save checkpoint: output/yolov3_mobilenet_v1_270e_voc
[02/14 11:52:17] ppdet.engine INFO: Epoch: [7] [  0/250] learning_rate: 0.001000 loss_xy: 2.733566 loss_wh: 0.827359 loss_obj: 3.070842 loss_cls: 0.015047 loss: 6.578712 eta: 0:26:47 batch_cost: 0.4838 data_cost: 0.2245 ips: 41.3368 images/s
[02/14 11:52:27] ppdet.engine INFO: Epoch: [7] [ 20/250] learning_rate: 0.001000 loss_xy: 2.966443 loss_wh: 0.904070 loss_obj: 3.504278 loss_cls: 0.018230 loss: 7.300209 eta: 0:26:37 batch_cost: 0.4975 data_cost: 0.2470 ips: 40.1981 images/s
[02/14 11:52:37] ppdet.engine INFO: Epoch: [7] [ 40/250] learning_rate: 0.001000 loss_xy: 2.946153 loss_wh: 0.812210 loss_obj: 3.432852 loss_cls: 0.021946 loss: 7.327403 eta: 0:26:26 batch_cost: 0.4614 data_cost: 0.2283 ips: 43.3435 images/s
^C

模型验证

! cd PaddleDetection && python tools/eval.py -c /home/aistudio/PaddleDetection/configs/yolov3/yolov3_mobilenet_v1_270e_voc.yml
W0214 11:52:47.999915  9439 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.0, Runtime API Version: 10.1
W0214 11:52:48.005571  9439 device_context.cc:465] device: 0, cuDNN Version: 7.6.
[02/14 11:52:50] ppdet.utils.checkpoint INFO: Finish loading model weights: /home/aistudio/PaddleDetection/output/yolov3_mobilenet_v1_270e_voc/model_final.pdparams
[02/14 11:52:50] ppdet.engine INFO: Eval iter: 0
[02/14 11:52:53] ppdet.engine INFO: Eval iter: 100
[02/14 11:52:56] ppdet.engine INFO: Eval iter: 200
[02/14 11:52:59] ppdet.engine INFO: Eval iter: 300
[02/14 11:53:02] ppdet.engine INFO: Eval iter: 400
[02/14 11:53:05] ppdet.engine INFO: Eval iter: 500
[02/14 11:53:08] ppdet.engine INFO: Eval iter: 600
[02/14 11:53:11] ppdet.engine INFO: Eval iter: 700
[02/14 11:53:13] ppdet.engine INFO: Eval iter: 800
[02/14 11:53:16] ppdet.engine INFO: Eval iter: 900
[02/14 11:53:21] ppdet.metrics.metrics INFO: Accumulating evaluatation results...
[02/14 11:53:21] ppdet.metrics.metrics INFO: mAP(0.50, 11point) = 79.22%
[02/14 11:53:21] ppdet.engine INFO: Total sample number: 1000, averge FPS: 32.73031947540956

模型预测

将预测txt和jpg保存到/home/aistudio/test_a/

这里如果修改具体保存的要求,修改文件:https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.3/ppdet/engine/trainer.py#L566

! cd PaddleDetection && python tools/infer.py -c /home/aistudio/PaddleDetection/configs/yolov3/yolov3_mobilenet_v1_270e_voc.yml --infer_dir=/home/aistudio/测试集/ --save_txt=True --output_dir=/home/aistudio/test_a/ > log.log
W0214 13:06:53.162956  3556 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 10.1, Runtime API Version: 10.1
W0214 13:06:53.168017  3556 device_context.cc:465] device: 0, cuDNN Version: 7.6.

.

生成提交文件

import glob, os
with open('submit.csv', 'w') as up:
    for path in glob.glob('测试集/*.jpg'):
        bbox = open('./test_a/' + os.path.basename(path)[:-4] + '.txt').readlines()
        if len(bbox) == 0:
            up.write(f'{os.path.basename(path)[:-4]},0.1 0.1 0.05 0.05\n')
        elif len(bbox) == 1:
            up.write(f'{os.path.basename(path)[:-4]},')
            box = bbox[0].strip().split()[2:]
            box = [float(x) for x in box]
            up.write(f"{(box[0] + box[2]/2)/256} {(box[1] + box[2]/2)/256} {box[2]/256} {box[3]/256}\n")
        else:
            up.write(f'{os.path.basename(path)[:-4]},')
            boxs = []
            for box in bbox:
                box = box.strip().split()[2:]
                box = [float(x) for x in box]
                boxs.append(f"{(box[0] + box[2]/2)/256} {(box[1] + box[2]/2)/256} {box[2]/256} {box[3]/256}")
            up.write(';'.join(boxs) + '\n')

代码总结与展望

代码使用PaddleDetection完成基础的训练和提交,包括VOC数据集格式转换、模型训练和预测步骤。

如果想要获得更好的精度,可以考虑从以下几个方面考虑:

  1. 需要训练更长时间,可能需要训练500个Epoch;
  2. 需要更加强大的模型。
  3. 预测时概率阈值需要进行修改;

Logo

学大模型,用大模型上飞桨星河社区!每天8点V100G算力免费领!免费领取ERNIE 4.0 100w Token >>>

更多推荐