• 카테고리

    질문 & 답변
  • 세부 분야

    컴퓨터 비전

  • 해결 여부

    미해결

customdataset 구성 질문

22.04.23 16:18 작성 조회수 249

0

안녕하세요!! 저는 bdd100k dataset을 이용해 mmdetection framework를 이용해 보려고 하는데요

bdd100k는 json파일로 이루어져있고 우선 강의를 통해 mmdetection의 customdataset으로 만들때 

data_info와 data_anno을 만들어 dict파일을 만들어야 된다는 것은 이해했습니다.

그러면 data_info와 data_anno를 구성하기 위해 bdd100k의 json파일에서 필요한 정보를 가져와야되는데 

강의의 dataset과는 많이 다른 방식이다보니 어떻게 가져와야될지에 대해 했갈리는 부분이 많아서

강사님이라면 어떻게 접근하셨을지에 대해서 여쭙고 싶습니다.

아래는 json파일의 일부이며 데이터가 이미지 갯수만큼 있는 파일입니다.

{
    "name": "0000f77c-6257be58.jpg",
    "attributes": {
      "weather": "clear",
      "timeofday": "daytime",
      "scene": "city street"
    },
    "timestamp": 10000,
    "labels": [
      {
        "id": "0",
        "attributes": {
          "occluded": false,
          "truncated": false,
          "trafficLightColor": "G"
        },
        "category": "traffic light",
        "box2d": {
          "x1": 1125.902264,
          "y1": 133.184488,
          "x2": 1156.978645,
          "y2": 210.875445
        }
      },
      {
        "id": "1",
        "attributes": {
          "occluded": false,
          "truncated": false,
          "trafficLightColor": "G"
        },
        "category": "traffic light",
        "box2d": {
          "x1": 1156.978645,
          "y1": 136.637417,
          "x2": 1191.50796,
          "y2": 210.875443
        }
      },
      {
        "id": "2",
        "attributes": {
          "occluded": false,
          "truncated": false,
          "trafficLightColor": "NA"
        },
        "category": "traffic sign",
        "box2d": {
          "x1": 1105.66915985699,
          "y1": 211.122087,
          "x2": 1170.79037,
          "y2": 233.566141
        }
      },
      {
        "id": "3",
        "attributes": {
          "occluded": false,
          "truncated": true,
          "trafficLightColor": "NA"
        },
        "category": "traffic sign",
        "box2d": {
          "x1": 0.0,
          "y1": 0.246631,
          "x2": 100.381647,
          "y2": 122.825696
        }
      },
      {
        "id": "4",
        "attributes": {
          "occluded": false,
          "truncated": false,
          "trafficLightColor": "NA"
        },
        "category": "car",
        "box2d": {
          "x1": 49.44476737704903,
          "y1": 254.530367,
          "x2": 357.805838,
          "y2": 487.906215
        }
      },
      {
        "id": "5",
        "attributes": {
          "occluded": false,
          "truncated": false,
          "trafficLightColor": "NA"
        },
        "category": "car",
        "box2d": {
          "x1": 507.82755,
          "y1": 221.727518,
          "x2": 908.367588,
          "y2": 441.0052451528153
        }
      },
      {
        "id": "6",
        "attributes": {
          "occluded": false,
          "truncated": true,
          "trafficLightColor": "NA"
        },
        "category": "traffic sign",
        "box2d": {
          "x1": 0.156955,
          "y1": 0.809282,
          "x2": 102.417429,
          "y2": 133.411856
        }
      }
    ]
}

답변 1

답변을 작성해보세요.

0

안녕하십니까, 

bdd100k 문서를 찾아보니 coco 형태로 데이터 세트를 변경할 수 있군요.  coco 형태로 변경한 후에 mmdetection을 적용하면 될 것 같습니다. 

https://doc.bdd100k.com/format.html 에 접속하셔서 쭉 내려가 보시면 to_coco 항목이 있습니다. 

여기에 아래와 같이 적용해보라고 되어 있군요. 

python3 -m bdd100k.label.to_coco -m det|box_track|pose \
    -i ${in_path} -o ${out_path} [--nproc ${process_num}]

bdd100k.label.to_coco는  bdd100k github에 가보시면 to_coco.py 가 있습니다. 이를 이용하시면 될 것 같습니다.  아래 URL에서 to_coco.py를 확인하실 수 있습니다. 

https://github.com/bdd100k/bdd100k/tree/master/bdd100k/label

to_coco.py 소스 코드를 좀 분석해 보셔야 할 것 같습니다. 

감사합니다.