Skip to content

Commit

Permalink
Merge pull request #31 from rapzag/main
Browse files Browse the repository at this point in the history
Add GOOSE Dataset
  • Loading branch information
rayguan97 authored Apr 2, 2024
2 parents 0b320dd + 8d881b3 commit 9490f0d
Show file tree
Hide file tree
Showing 10 changed files with 10,243 additions and 2 deletions.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ To be able to run our network, please follow those steps for generating processe

### Dataset Download:

Please go to [RUGD](http://rugd.vision/) and [RELLIS-3D](https://github.com/unmannedlab/RELLIS-3D/blob/main/README.md#annotated-data) (we use the ID annotation instead of color annotation for RELLIS-3D) officail website to download their data.
Please go to [RUGD](http://rugd.vision/) and [RELLIS-3D](https://github.com/unmannedlab/RELLIS-3D/blob/main/README.md#annotated-data) (we use the ID annotation instead of color annotation for RELLIS-3D) officail website to download their data. Download the [GOOSE](https://goose-dataset.de/docs/setup/#download-dataset) dataset, and extract all zips in `data/goose` to match the below structure.
<!-- Please structure the downloaded data as follows: -->

Note: Since RELLIS-3D dataset has been updated, please run `python ./tools/process_rellis.py` to remove "pylon_camera_node/", "pylon_camera_node_label_id/" folder, after structure the data as follows:
Expand All @@ -117,6 +117,18 @@ GANav
│ │ │ ├── creek & park-1/2/8 & trail-(1 & 3-7 & 9-15) & village
│ │ │── RUGD_frames-with-annotations
│ │ │ ├── creek & park-1/2/8 & trail-(1 & 3-7 & 9-15) & village
│ ├── goose
│ │ ├── goose_label_mapping.csv
│ │ ├── images
│ │ │ ├── train
│ │ │ └── val
│ │ ├── labels
│ │ │ ├── train
│ │ │ └── val
│ │ ├── LICENSE
│ │ ├── test.txt
│ │ ├── train.txt
│ │ └── val.txt
├── configs
├── tools
...
Expand All @@ -140,6 +152,12 @@ For RUGD dataset, run:

Replease [x] with 4 or 6, to generated data with 4 annotation groups or 6 annotation groups.

For the GOOSE dataset, run:

```
python ./tools/convert_datasets/goose_relabel6.py
```

## Training

To train a model on RUGD datasets with our methods on 6 groups:
Expand All @@ -154,6 +172,12 @@ To train a model on multiple GPUs(RUGD, 6 groups, 2 GPUs):
./tools/dist_train.sh ./configs/ours/ganav_group6_rugd.py 2
```

To train on the GOOSE dataset run:

```
python ./tools/train.py ./configs/ours/ganav_group6_goose.py
```

## Testing

An example to evaluate our method with 6 groups on RUGD datasets with mIoU metrics:
Expand Down
62 changes: 62 additions & 0 deletions configs/_base_/datasets/goose_group6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# dataset settings
dataset_type = 'GOOSEDataset_Group6'
data_root = 'data/goose/'
img_norm_cfg = dict(
mean=[80.66, 77.73, 76.87], std=[61.40, 61.08, 64.47], to_rgb=True)
img_size = (2048, 1000)
crop_size = (375, 600)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(type='Resize', img_scale=img_size, ratio_range=(0.5, 2.0)),
dict(type='RandomCrop', crop_size=crop_size),
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=crop_size,
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
flip=False,
transforms=[
dict(type='Resize', keep_ratio=True),
dict(type='RandomFlip'),
dict(type='Normalize', **img_norm_cfg),
dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255),
dict(type='ImageToTensor', keys=['img']),
dict(type='Collect', keys=['img']),
])
]
data = dict(
samples_per_gpu=1,
workers_per_gpu=2,
img_size=crop_size,
train=dict(
type=dataset_type,
data_root=data_root,
img_dir='images/train/',
ann_dir='labels/train/',
split='train.txt',
pipeline=train_pipeline),
val=dict(
type=dataset_type,
data_root=data_root,
img_dir='images/val/',
ann_dir='labels/val/',
split='val.txt',
pipeline=test_pipeline),
# test=dict(
# type=dataset_type,
# data_root=data_root,
# img_dir='image',
# ann_dir='labels',
# split='test.txt',
# pipeline=test_pipeline)
)
27 changes: 27 additions & 0 deletions configs/ours/ganav_group6_goose.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
_base_ = [
'../_base_/models/ours_class_att.py', '../_base_/datasets/goose_group6.py',
'../_base_/default_runtime.py'
]


optimizer = dict(type='SGD', lr=0.003, momentum=0.9, weight_decay=4e-5)
optimizer_config = dict()
# learning policy
# runtime settings
runner = dict(type='IterBasedRunner', max_iters=240000)
total_iters = 240000
checkpoint_config = dict(by_epoch=False, interval=16000)
evaluation = dict(interval=240000, metric='mIoU')

# optimizer
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, warmup='linear',
warmup_iters=1500,
warmup_ratio=1e-6,
by_epoch=False)

model=dict(
decode_head=dict(img_size=(375, 600)))

data = dict(
samples_per_gpu=2,
workers_per_gpu=2)
4 changes: 4 additions & 0 deletions data/goose/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
goose_label_mapping.csv
images/*
labels/*
LICENSE
Loading

0 comments on commit 9490f0d

Please sign in to comment.