Some checks failed
deploy / build-n-publish (push) Has been cancelled
lint / lint (push) Has been cancelled
build / build_cpu (3.7, 1.5.1, torch1.5, 0.6.1) (push) Has been cancelled
build / build_cpu (3.7, 1.6.0, torch1.6, 0.7.0) (push) Has been cancelled
build / build_cpu (3.7, 1.7.0, torch1.7, 0.8.1) (push) Has been cancelled
build / build_cpu (3.7, 1.8.0, torch1.8, 0.9.0) (push) Has been cancelled
build / build_cpu (3.7, 1.9.0, torch1.9, 0.10.0) (push) Has been cancelled
build / build_cuda101 (3.7, 1.5.1+cu101, torch1.5, 0.6.1+cu101) (push) Has been cancelled
build / build_cuda101 (3.7, 1.6.0+cu101, torch1.6, 0.7.0+cu101) (push) Has been cancelled
build / build_cuda101 (3.7, 1.7.0+cu101, torch1.7, 0.8.1+cu101) (push) Has been cancelled
build / build_cuda101 (3.7, 1.8.0+cu101, torch1.8, 0.9.0+cu101) (push) Has been cancelled
build / build_cuda102 (3.6, 1.9.0+cu102, torch1.9, 0.10.0+cu102) (push) Has been cancelled
build / build_cuda102 (3.7, 1.9.0+cu102, torch1.9, 0.10.0+cu102) (push) Has been cancelled
build / build_cuda102 (3.8, 1.9.0+cu102, torch1.9, 0.10.0+cu102) (push) Has been cancelled
build / build_cuda102 (3.9, 1.9.0+cu102, torch1.9, 0.10.0+cu102) (push) Has been cancelled
build / test_windows (windows-2022, cpu, 3.8) (push) Has been cancelled
build / test_windows (windows-2022, cu111, 3.8) (push) Has been cancelled
- Add golf1/2/4/7/8 dataset classes for semantic segmentation - Add kneron-specific configs (meconfig series, kn_stdc1_golf4class) - Organize scripts into tools/check/ and tools/kneron/ - Add kneron_preprocessing module - Update README with quick-start guide - Update .gitignore to exclude data dirs, onnx, nef outputs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
72 lines
2.0 KiB
Python
72 lines
2.0 KiB
Python
# dataset settings
|
||
dataset_type = 'GolfDataset'
|
||
data_root = 'data/cityscapes0/' # ✅ 你的資料根目錄
|
||
|
||
img_norm_cfg = dict(
|
||
mean=[128., 128., 128.], std=[256., 256., 256.], to_rgb=True)
|
||
crop_size = (360, 720)
|
||
|
||
train_pipeline = [
|
||
dict(type='LoadImageFromFile'),
|
||
dict(type='LoadAnnotations'),
|
||
dict(type='Resize', img_scale=(724, 362), ratio_range=(0.5, 2.0)),
|
||
dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75),
|
||
dict(type='RandomFlip', prob=0.5),
|
||
dict(type='PhotoMetricDistortion'),
|
||
dict(type='Normalize', **img_norm_cfg),
|
||
dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255),
|
||
dict(type='DefaultFormatBundle'),
|
||
dict(type='Collect', keys=['img', 'gt_semantic_seg']),
|
||
]
|
||
|
||
test_pipeline = [
|
||
dict(type='LoadImageFromFile'),
|
||
dict(
|
||
type='MultiScaleFlipAug',
|
||
img_scale=(724, 362),
|
||
flip=False,
|
||
transforms=[
|
||
dict(type='Resize', keep_ratio=True),
|
||
dict(type='RandomFlip'),
|
||
dict(type='Normalize', **img_norm_cfg),
|
||
dict(type='ImageToTensor', keys=['img']),
|
||
dict(type='Collect', keys=['img']),
|
||
])
|
||
]
|
||
|
||
data = dict(
|
||
samples_per_gpu=2,
|
||
workers_per_gpu=2,
|
||
train=dict(
|
||
type=dataset_type,
|
||
data_root=data_root,
|
||
img_dir='leftImg8bit/train',
|
||
ann_dir='gtFine/train',
|
||
pipeline=train_pipeline
|
||
),
|
||
val=dict(
|
||
type=dataset_type,
|
||
data_root=data_root,
|
||
img_dir='leftImg8bit/val',
|
||
ann_dir='gtFine/val',
|
||
pipeline=test_pipeline
|
||
),
|
||
test=dict(
|
||
type=dataset_type,
|
||
data_root=data_root,
|
||
img_dir='leftImg8bit/test',
|
||
ann_dir='gtFine/test',
|
||
pipeline=test_pipeline
|
||
)
|
||
)
|
||
|
||
# ✅ 類別與對應的調色盤(不傳給 dataset,用於繪圖/推論可視化)
|
||
classes = ('car', 'grass', 'people', 'road')
|
||
palette = [
|
||
[246, 14, 135], # car
|
||
[233, 81, 78], # grass
|
||
[220, 148, 21], # people
|
||
[207, 215, 220], # road
|
||
]
|
||
|