|
|
ultralytics -> cfa -> dataset에는 객체 검출, 영상 분할에 대한 datset의 다운로드 경로와 클래스 등이 명시되어 있다.
개발자가 개인적인 datasets을 추가하여 파일을 만들어야 할 것.
https://nanum.etri.re.kr/share/kimjy/ObjectStateDetectionAIchallenge2024?lang=ko_KR
| 신호등 인식 | 복합 객체 인식 |
| veh_go veh_goLeft veh_noSign veh_stop veh_stopLeft veh_stopWarning veh_warning ped_go ped_noSign ped_stop bus_go bus_noSign bus_stop bus_warning |
dataset구성을 할 때 두가지 방법이 있는데 (복합 객체 인식의 경우)
첫 번째로 클래스의 수를 차종 * 위치 * 상태의 클래스를 모두 나열하는 방법
( 이 경우 클래스의 수가 2 * 5 * (2*2*2*2) = 160 이다. )
두 번째로 Multi Task 기능을 통하여 클래스의 수를 2로 설정하고 내부 속성을 조율하는 방법
( dataset.yaml을 어떻게 구현해야 하는지는 아직... )
Mulit Task 기능에 관한 글
YOLOv8에 대하여 Multi Task 수행한 GitHub 코드, 분할과 검출 기능을 같이 한 코드.
https://github.com/JiayuanWang-JW/YOLOv8-multi-task
ultralytics -> cfg -> models에는 백본이 기록되어 있으며 yolov10x.yaml이 가장 큰 백본이다.
https://velog.io/@d4r6j/YOLOv10-1.-Model-Review
YOLOv8과 YOLOv10의 모델 구조에 대해서 설명해둔 글.
영상 분할과 객체 검출을 하나로 합친 model.yaml 코드
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | # Ultralytics YOLO 🚀, AGPL-3.0 license # YOLOv8 object detection model with P3-P5 outputs. For Usage examples see https://docs.ultralytics.com/tasks/detect # Parameters ######Jiayuan tnc: 3 # number of classes ####### scales: # model compound scaling constants, i.e. 'model=yolov8n.yaml' will call yolov8.yaml with scale 'n' # [depth, width, max_channels] n: [0.33, 0.25, 1024] # YOLOv8n summary: 225 layers, 3157200 parameters, 3157184 gradients, 8.9 GFLOPs s: [0.33, 0.50, 1024] # YOLOv8s summary: 225 layers, 11166560 parameters, 11166544 gradients, 28.8 GFLOPs m: [0.67, 0.75, 768] # YOLOv8m summary: 295 layers, 25902640 parameters, 25902624 gradients, 79.3 GFLOPs l: [1.00, 1.00, 512] # YOLOv8l summary: 365 layers, 43691520 parameters, 43691504 gradients, 165.7 GFLOPs x: [1.00, 1.25, 512] # YOLOv8x summary: 365 layers, 68229648 parameters, 68229632 gradients, 258.5 GFLOPs scale: n # YOLOv8.0n backbone backbone: # [from, repeats, module, args] - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2 - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4 - [-1, 3, C2f, [128, True]] - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8 - [-1, 6, C2f, [256, True]] - [-1, 1, Conv, [512, 3, 2]] # 5-P4/16 - [-1, 6, C2f, [512, True]] - [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32 - [-1, 3, C2f, [1024, True]] - [-1, 1, SPPF, [1024, 5]] # 9 # YOLOv8.0n head head: - [-1, 1, nn.Upsample, [None, 2, 'nearest']] - [[-1, 6], 1, Concat, [1]] # cat backbone P4 - [-1, 3, C2f, [512]] # 12 - [-1, 1, nn.Upsample, [None, 2, 'nearest']] - [[-1, 4], 1, Concat, [1]] # cat backbone P3 - [-1, 3, C2f, [256]] # 15 (P3/8-small) - [-1, 1, Conv, [256, 3, 2]] - [[-1, 12], 1, Concat, [1]] # cat head P4 - [-1, 3, C2f, [512]] # 18 (P4/16-medium) - [-1, 1, Conv, [512, 3, 2]] - [[-1, 9], 1, Concat, [1]] # cat head P5 - [-1, 3, C2f, [1024]] # 21 (P5/32-large) # lane - [9, 1, nn.Upsample, [None, 2, 'nearest']] - [[-1, 6], 1, Concat_dropout, [1]] # cat backbone P4 - [-1, 3, C2f, [512]] # 24 - [-1, 1, nn.Upsample, [None, 2, 'nearest']] - [[-1, 4], 1, Concat_dropout, [1]] # cat backbone P3 - [-1, 3, C2f, [256]] # 27 (P3/8-small) - [-1, 1, nn.Upsample, [None, 2, 'nearest']] # for lane segmentation - [[-1, 2], 1, Concat_dropout, [1]] # cat backbone P2 - [-1, 3, C2f, [128]] # 30 (P2) - [-1, 1, nn.Upsample, [None, 2, 'nearest']] # - [[-1, 0], 1, Concat_dropout, [1]] # cat backbone P1 - [-1, 3, C2f, [64]] # 33 (P1) # - [-1, 1, nn.Upsample, [None, 2, 'nearest']] #28 # - [-1, 3, C2f, [32]] # 29 (original) # drivable - [9, 1, nn.Upsample, [None, 2, 'nearest']] - [[-1, 6], 1, Concat_dropout, [1]] # cat backbone P4 - [-1, 3, C2f, [512]] # 36 - [-1, 1, nn.Upsample, [None, 2, 'nearest']] - [[-1, 4], 1, Concat_dropout, [1]] # cat backbone P3 - [-1, 3, C2f, [256]] # 39 (P3/8-small) - [-1, 1, nn.Upsample, [None, 2, 'nearest']] # 30 for drivable segmentation - [[-1, 2], 1, Concat_dropout, [1]] - [-1, 3, C2f, [128]] # 42 (P2) - [-1, 1, nn.Upsample, [None, 2, 'nearest']] # - [[-1, 0], 1, Concat_dropout, [1]] - [-1, 3, C2f, [64]] # 45 (P1) # - [-1, 1, nn.Upsample, [None, 2, 'nearest']] #34 # - [-1, 3, C2f, [32]] # 35 (original) # # tasks - [[15, 18, 21], 1, Detect, [1]] # 36 Detect(P3, P4, P5) - [[45], 1, Segment, [1, 32, 256]] # 37 drivable-Segment [1,32,256] was not working, you should change the head.py - [[33], 1, Segment, [1, 32, 256]] # 38 lane-Segment [1,32,256] was not working, you should change the head.py | cs |
| head에서 실행되는 코드 | |
| 객체 검출 작업 | |
| 영상 분할 작업 | |
작업(Task) 설정 (모델이 수행할 작업을 정의 - 각각 객체 탐지, 주행 가능 영역 분할, 차선 분할로 나뉘어짐.)
객체 검출에서 " 36 Detect(P3, P4, P5) " 와 같은 주석이 달려있는데 이는 객체의 크기(정확히는 Rounding Box의 크기)를 의미하는 것으로 추정된다.
(확인 과정이 끝나면 내용 수정)
| P3/8-small (8*8 pixel) | P4/16-medium (16*16 pixel) | P5/32-large (32*32 pixel) |
Region-based Approach 기술 후에 추가 정보 탐색

첫댓글 1. Yolo segmentation label format(txt) 설명자료 -> https://docs.ultralytics.com/datasets/segment/
2. segmentation mask image to yolo format(txt) ->https://docs.ultralytics.com/usage/simple-utilities/?h=segmentation+mask+yolo+format+to#auto-labeling-annotations
3. 변환함수 convert_segment_masks_to_yolo_seg 사용예제코드 ->https://docs.ultralytics.com/reference/data/converter/
1. 경진대회 데이터셋의 마스크영상을 컬러맵을 적용하여 컬러영상으로 변환하여 출력해볼것
2. 3번 변환함수를 이용하여 경진대회 데이터셋의 마스크영상을 yolo포맷 txt파일로 변환하고 다시 txt파일 정보를 읽어서 경진대회 데이터셋의 원본영상에 그려보고 변환잘되었는지 확인할것