WoodsGao / rotatable_yolov3

A rotatable yolov3 model which can regress the angle of the bounding box
GNU General Public License v3.0
19 stars 5 forks source link

数据标注格式 #5

Open Lmoer opened 4 years ago

Lmoer commented 4 years ago

你好,想问一下,这个项目的代码的数据集标注格式是怎么样的,一般的水平框检测时[x,y,w,h],那旋转的框是怎么标注的呢

WoodsGao commented 4 years ago

标准使用coco格式的polygon,可以使用labelme标注polygon。dataset类自动实现了对polygon求最接近的旋转框的过程,具体可以参考datasets的实现方式

Lmoer commented 4 years ago

class YOLOV3(nn.Module):

YOLOv3 object detection model

def __init__(
        self,
        num_classes,
        img_size=(416, 416),
        anchors=[
            [[116, 90], [156, 198], [373, 326]],
            [[30, 61], [62, 45], [59, 119]],
            [[10, 13], [16, 30], [33, 23]],
        ]):
    super(YOLOV3, self).__init__()
    self.backbone = mobilenet_v2(pretrained=True)
    depth = 5
    width = [512, 256, 128]
    planes_list = [1280, 96, 32]

你好,请问这些先验的参数,要怎么结合polygon设置,训练上,感觉loss没下来过,一直很高

WoodsGao commented 4 years ago

yolo中的anchor size是通过kmeans计算出来的,可以参考https://github.com/woodsgao/cv_utils/blob/master/kmeans_anchor.py 的方式计算

Lmoer commented 4 years ago

做数据的前向预测时 出现下列错误,请问是什么原因造成的 python3 inference.py data/JPEGImages outputs --weights weights/best.pth

Traceback (most recent call last): File "inference.py", line 83, in opt.conf_thres, opt.nms_thres, opt.show) File "inference.py", line 39, in run nms_thres)[0] File "/home/chengjiahao/anaconda3/envs/rotate_yolo/lib/python3.6/site-packages/torch-1.6.0-py3.6-linux-x86_64.egg/torch/autograd/grad_mode.py", line 15, in decorate_context return func(*args, **kwargs) File "/home/chengjiahao/lijingyuan/test/rotatable_yolov3-master/utils/inference.py", line 23, in inference det = non_max_suppression(pred, conf_thres, nms_thres)[0] File "/home/chengjiahao/lijingyuan/test/rotatable_yolov3-master/utils/utils.py", line 445, in non_max_suppression i = (pred[:, 8] > conf_thres) & torch.isfinite(pred).all(1) IndexError: index 8 is out of bounds for dimension 1 with size 8