/arirang_detect

dacon arirang objecte detection

Primary LanguageJupyter Notebook

arirang_detect

dacon arirang objecte detection

공통수행 작업

  1. download data from dacon
  2. notebook/read_json.ipynb 를 실행하여 라벨을 csv로 바꿔준다.

YoloV5 사용법

  1. yolo_v5 폴더 내에 python munge_data.py 으로 데이터 전처리 수행
  2. python train.py을 이용하여 train
  3. 예제 코드 python train.py --img 1024 --batch 1 --epochs 40 --data ./config/fold_0.yaml --cfg ./config/yolov5x.yaml --name yolov5x_fold0 --logdir fold0

EfficientDet 사용법

  1. pretrained model download
  2. python src/main.py

albumentation image augmentation 문제 발생

bbox가 0 ~ 1.0 구간을 벗어나면 error가 발생하는 문제
albumentations/augmentations/bbox_utils.py의 check_bbox를 아래와 같이 수정

def check_bbox(bbox):
    """Check if bbox boundaries are in range 0, 1 and minimums are lesser then maximums"""
    for name, value in zip(["x_min", "y_min", "x_max", "y_max"], bbox[:4]):
        if not 0 <= value <= 1:
            bbox = np.clip(bbox, 0., 1.)
            # raise ValueError(
            #     "Expected {name} for bbox {bbox} "
            #     "to be in the range [0.0, 1.0], got {value}.".format(bbox=bbox, name=name, value=value)
            # )
    x_min, y_min, x_max, y_max = bbox[:4]
    if x_max <= x_min:
        raise ValueError("x_max is less than or equal to x_min for bbox {bbox}.".format(bbox=bbox))
    if y_max <= y_min:
        raise ValueError("y_max is less than or equal to y_min for bbox {bbox}.".format(bbox=bbox))

Models

Variant Download mAP (val2017) mAP (test-dev2017) mAP (TF official val2017) mAP (TF official test-dev2017)
lite0 tf_efficientdet_lite0.pth 32.0 TBD N/A N/A
D0 efficientdet_d0.pth 33.6 TBD 33.5 33.8
D0 tf_efficientdet_d0.pth 34.2 TBD 34.3 34.6
D1 efficientdet_d1.pth 39.4 39.5 39.1 39.6
D1 tf_efficientdet_d1.pth 40.1 TBD 40.2 40.5
D2 tf_efficientdet_d2.pth 43.4 TBD 42.5 43
D3 tf_efficientdet_d3.pth 47.1 TBD 47.2 47.5
D4 tf_efficientdet_d4.pth 49.2 TBD 49.3 49.7
D5 tf_efficientdet_d5.pth 51.2 TBD 51.2 51.5
D6 tf_efficientdet_d6.pth 52.0 TBD 52.1 52.6
D7 tf_efficientdet_d7.pth 53.1 53.4 53.4 53.7
D7X tf_efficientdet_d7x.pth 54.3 TBD 54.4 55.1

NOTE: Official scores for all modules now using soft-nms, but still using normal NMS here.