Ejemplo n.º 1
0
def create_pascal_voc():
    size_list = [640, 426, 3]
    file_name = "000000484951.jpg"
    voc_object_tags = ["labelProperties", "big", "labelProperties3", "labelProperties2", "labelProperties4", "small"]
    voc_object_properties = [{"color": "green", "属性": "绿色", "property": "value", "color2": "blue", "颜色2": "蓝色",
                              "pose": "0", "truncated": "0", "difficult": "0",
                              "@modelarts:shape": "bndbox", "@modelarts:feature": [[199, 356], [230, 385]]},
                             {"pose": "0", "truncated": "0", "difficult": "0",
                              "@modelarts:shape": "bndbox", "@modelarts:feature": [[248, 59], [638, 292]]},
                             {"颜色": "红色", "pose": "0", "truncated": "0", "difficult": "0",
                              "@modelarts:shape": "polygon", "@modelarts:feature": [[202, 293], [199, 308],
                                                                                    [211, 319], [230, 311],
                                                                                    [226, 293], [210, 287],
                                                                                    [202, 293]]},
                             {"color": "yellow", "pose": "0", "truncated": "0", "difficult": "0",
                              "@modelarts:shape": "bndbox", "@modelarts:feature": [[197, 324], [227, 348]]},
                             {"color2": "blue", "pose": "0", "truncated": "0", "difficult": "0",
                              "@modelarts:shape": "bndbox", "@modelarts:feature": [[197, 324], [227, 348]]},
                             {"pose": "0", "truncated": "0", "difficult": "0",
                              "@modelarts:shape": "bndbox", "@modelarts:feature": [[317, 104], [461, 222]]}]
    voc_objects = []
    for i in range(len(voc_object_tags)):
        object_tag = voc_object_tags[i]
        object_properties = voc_object_properties[i]
        voc_objects.append(VocObject(name=object_tag, properties=object_properties))

    return PascalVocIO(file_name=file_name, width=size_list[0], height=size_list[1], depth=size_list[2],
                       voc_objects=voc_objects)
Ejemplo n.º 2
0
def create_pascal_voc():
    size_list = [640, 321, 3]
    file_name = "000000089955.jpg"
    voc_object_tags = ["trafficlight", "trafficlight"]
    voc_object_properties = [{
        "@modelarts:color": "#FFFFF0",
        "@modelarts:shortcut": "C",
        "pose": "0",
        "truncated": "0",
        "difficult": "0",
        "@modelarts:shape": "bndbox",
        "@modelarts:feature": [[347, 186], [382, 249]]
    }, {
        "@modelarts:color": "#FFFFE0",
        "@modelarts:shortcut": "D",
        "pose": "0",
        "truncated": "0",
        "difficult": "0",
        "@modelarts:shape": "bndbox",
        "@modelarts:feature": [[544, 50], [591, 149]]
    }]
    voc_objects = []
    for i in range(len(voc_object_tags)):
        object_tag = voc_object_tags[i]
        object_properties = voc_object_properties[i]
        voc_objects.append(
            VocObject(name=object_tag, properties=object_properties))

    return PascalVocIO(file_name=file_name,
                       width=size_list[0],
                       height=size_list[1],
                       depth=size_list[2],
                       voc_objects=voc_objects)
Ejemplo n.º 3
0
def create_pascal_voc():
    size_list = [640, 480, 3]
    file_name = "000000115967.jpg"
    voc_object_tags = [
        "car", "car", "DottedLine", "DottedLine", "line", "trafficlight",
        "trafficlight", "greenLight", "redPoint", "redPoint", "redPoint"
    ]
    voc_object_properties = [{
        "pose":
        "0",
        "truncated":
        "0",
        "difficult":
        "0",
        "confidence":
        "0.8",
        "@modelarts:shape":
        "polygon",
        "@modelarts:feature": [[0, 292], [12, 279], [102, 280], [122, 294],
                               [134, 326], [137, 321], [138, 312], [148, 314],
                               [152, 319], [150, 326], [136, 331], [149, 349],
                               [147, 414], [128, 422], [111, 422], [104, 403],
                               [26, 403], [24, 415], [7, 419], [0, 424],
                               [1, 413]]
    }, {
        "pose":
        "0",
        "truncated":
        "0",
        "difficult":
        "0",
        "confidence":
        "0.8",
        "@modelarts:shape":
        "polygon",
        "@modelarts:feature": [[259, 340], [258, 328], [263, 322], [278, 322],
                               [281, 329], [282, 333], [282, 341], [280, 342]]
    }, {
        "pose": "0",
        "truncated": "0",
        "difficult": "0",
        "@modelarts:shape": "dashed",
        "@modelarts:feature": [[474, 456], [370, 339]]
    }, {
        "pose": "0",
        "truncated": "0",
        "difficult": "0",
        "@modelarts:shape": "dashed",
        "@modelarts:feature": [[160, 445], [195, 368]]
    }, {
        "pose": "0",
        "truncated": "0",
        "difficult": "0",
        "@modelarts:shape": "line",
        "@modelarts:feature": [[154, 449], [466, 457]]
    }, {
        "pose": "0",
        "truncated": "0",
        "difficult": "0",
        "@modelarts:shape": "bndbox",
        "@modelarts:feature": [[374, 209], [405, 224]]
    }, {
        "pose": "0",
        "truncated": "0",
        "difficult": "0",
        "@modelarts:shape": "bndbox",
        "@modelarts:feature": [[255, 205], [293, 220]]
    }, {
        "pose": "0",
        "truncated": "0",
        "difficult": "1",
        "@modelarts:shape": "circle",
        "@modelarts:feature": [61, 204, 5]
    }, {
        "pose": "0",
        "truncated": "0",
        "difficult": "0",
        "@modelarts:shape": "point",
        "@modelarts:feature": [259, 282]
    }, {
        "pose": "0",
        "truncated": "0",
        "difficult": "0",
        "@modelarts:shape": "point",
        "@modelarts:feature": [226, 281]
    }, {
        "pose": "0",
        "truncated": "0",
        "difficult": "0",
        "@modelarts:shape": "point",
        "@modelarts:feature": [259, 290]
    }]
    voc_objects = []
    for i in range(len(voc_object_tags)):
        object_tag = voc_object_tags[i]
        object_properties = voc_object_properties[i]
        voc_objects.append(
            VocObject(name=object_tag, properties=object_properties))

    return PascalVocIO(file_name=file_name,
                       width=size_list[0],
                       height=size_list[1],
                       depth=size_list[2],
                       voc_objects=voc_objects)