|
a |
|
b/Readme.md |
|
|
1 |
# 1. Goal: 使用 YoloV8 对医学影像CT/磁共振图像进行肺炎区域分割: |
|
|
2 |
|
|
|
3 |
### part1 : |
|
|
4 |
A. init data [nii(Nifit) -> png]: 将CT原始数据从 三维转二维, 保存png格式 |
|
|
5 |
B. mask data [nii -> json]: 将CT的分割标注数据从 三维转二维, 再转Labelme可以识别的json文件 |
|
|
6 |
|
|
|
7 |
### part2: |
|
|
8 |
**Algorithm: Yolo-V8** |
|
|
9 |
A. make dataset [train/val/test + label]: 对二维数据和json文件进行数据划分, 并json转换Yolo标签格式 |
|
|
10 |
B. Segmentation [Yolo-V8]: 使用YoloV8进行分割 |
|
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
# 2. JSON format (eg:) : |
|
|
15 |
{ |
|
|
16 |
"version": "4.5.6", // Labelme software version |
|
|
17 |
"flags": {}, // Additional flag information |
|
|
18 |
"shapes": [ |
|
|
19 |
{ |
|
|
20 |
"label": "dog", // Label name |
|
|
21 |
"points": [ // Polygon vertex points of the annotation |
|
|
22 |
[298, 151], |
|
|
23 |
[324, 151], |
|
|
24 |
[324, 160], |
|
|
25 |
[317, 160], |
|
|
26 |
[317, 168], |
|
|
27 |
[307, 168], |
|
|
28 |
[307, 151], |
|
|
29 |
[298, 151] |
|
|
30 |
], |
|
|
31 |
"group_id": null, |
|
|
32 |
"shape_type": "polygon", // Shape type |
|
|
33 |
"flags": {} |
|
|
34 |
}, |
|
|
35 |
{ |
|
|
36 |
"label": "cat", |
|
|
37 |
"points": [ |
|
|
38 |
[400, 200], |
|
|
39 |
[425, 200], |
|
|
40 |
[425, 210], |
|
|
41 |
[415, 210], |
|
|
42 |
[415, 220], |
|
|
43 |
[405, 220], |
|
|
44 |
[405, 200], |
|
|
45 |
[400, 200] |
|
|
46 |
], |
|
|
47 |
"group_id": null, |
|
|
48 |
"shape_type": "polygon", |
|
|
49 |
"flags": {} |
|
|
50 |
} |
|
|
51 |
... |
|
|
52 |
], |
|
|
53 |
"imagePath": "path/to/image.jpg", // Image file path |
|
|
54 |
"imageData": null, // Image data (Base64 encoded) |
|
|
55 |
"imageHeight": 480, // Image height |
|
|
56 |
"imageWidth": 640 // Image width |
|
|
57 |
} |
|
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
YOLO .txt format: |
|
|
64 |
one object -> one row |
|
|
65 |
(classID, x_center, y_center, width_normalized, height_normalized) |
|
|
66 |
|
|
|
67 |
(eg): |
|
|
68 |
1 0.375000 0.625000 0.312500 0.416667 |
|
|
69 |
0 0.656250 0.291667 0.156250 0.208333 |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
|
74 |
|
|
|
75 |
dataset.yaml format(eg): |
|
|
76 |
train: /path/to/your/dataset/images/train |
|
|
77 |
val: /path/to/your/dataset/images/val |
|
|
78 |
nc: 5 |
|
|
79 |
names: ['cat', 'dog', 'person', 'car', 'truck'] |