Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Audi's A2D2 dataset #175

Closed
wants to merge 52 commits into from

Conversation

robin-karlsson0
Copy link

This PR adds the following functionalities

  1. Generate new A2D2's labels from instance to categorical segmentation labels, and restructure the directory structure by symbolically linking files within the existing structure.
  2. Necessary files required to load the dataset for training and evaluation.

Dataset conversion, training, and evaluation are tested.

About the dataset:

Our dataset includes more than 40,000 frames with semantic segmentation image and point cloud labels, of which more than 12,000 frames also have annotations for 3D bounding boxes. In addition, we provide unlabelled sensor data (approx. 390,000 frames) for sequences with several loops, recorded in three cities.
Ref: https://www.a2d2.audi/a2d2/en/dataset.html

@CLAassistant
Copy link

CLAassistant commented Oct 7, 2020

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Oct 7, 2020

Codecov Report

Merging #175 (e5ca2d4) into master (8a174a3) will increase coverage by 0.98%.
The diff coverage is 95.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #175      +/-   ##
==========================================
+ Coverage   83.69%   84.67%   +0.98%     
==========================================
  Files          89       91       +2     
  Lines        4128     4425     +297     
  Branches      651      706      +55     
==========================================
+ Hits         3455     3747     +292     
- Misses        535      538       +3     
- Partials      138      140       +2     
Flag Coverage Δ
unittests 84.67% <95.71%> (+0.98%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmseg/models/decode_heads/decode_head.py 91.66% <ø> (ø)
mmseg/models/losses/cross_entropy_loss.py 78.12% <73.33%> (+2.68%) ⬆️
mmseg/datasets/a2d2.py 80.00% <80.00%> (ø)
mmseg/core/evaluation/metrics.py 94.11% <94.11%> (ø)
mmseg/datasets/custom.py 87.42% <95.23%> (+1.53%) ⬆️
mmseg/models/backbones/cgnet.py 96.75% <96.75%> (ø)
mmseg/datasets/pipelines/transforms.py 97.97% <99.09%> (+1.69%) ⬆️
mmseg/__init__.py 73.68% <100.00%> (ø)
mmseg/core/evaluation/__init__.py 100.00% <100.00%> (ø)
mmseg/datasets/__init__.py 100.00% <100.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a174a3...9d488af. Read the comment docs.

@hellock hellock requested a review from Junjun2016 October 11, 2020 09:46
@hellock
Copy link
Member

hellock commented Oct 14, 2020

Task linked: CU-4qt10u [Review] Audi's A2D2 dataset

(241, 230, 255): 15, # Buildings
(96, 69, 143): 255, # Blurred area
(53, 46, 82): 255, # Rain dirt
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice that the official website says that "The dataset features 41,280 frames with semantic segmentation in 38 categories", but there are only 35 categories in 'SEG_COLOR_DICT_A2D2'.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I double cross-checked the original class list (a2d2_root/camera_lidar_semantic/class_list.json). With instance segmentations collapsed into categorical segmentation classes, the number add up to 38 in both class_list.json and SEG_COLOR_DICT_A2D2

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied class_list.json with an additional semantic class counter number to the right

{
"#ff0000": "Car 1",
"#c80000": "Car 2",
"#960000": "Car 3",
"#800000": "Car 4", 1
"#b65906": "Bicycle 1",
"#963204": "Bicycle 2",
"#5a1e01": "Bicycle 3",
"#5a1e1e": "Bicycle 4", 2
"#cc99ff": "Pedestrian 1",
"#bd499b": "Pedestrian 2",
"#ef59bf": "Pedestrian 3", 3
"#ff8000": "Truck 1",
"#c88000": "Truck 2",
"#968000": "Truck 3", 4
"#00ff00": "Small vehicles 1",
"#00c800": "Small vehicles 2",
"#009600": "Small vehicles 3", 5
"#0080ff": "Traffic signal 1",
"#1e1c9e": "Traffic signal 2",
"#3c1c64": "Traffic signal 3", 6
"#00ffff": "Traffic sign 1",
"#1edcdc": "Traffic sign 2",
"#3c9dc7": "Traffic sign 3", 7
"#ffff00": "Utility vehicle 1",
"#ffffc8": "Utility vehicle 2", 8
"#e96400": "Sidebars", 9
"#6e6e00": "Speed bumper", 10
"#808000": "Curbstone", 11
"#ffc125": "Solid line", 12
"#400040": "Irrelevant signs", 13
"#b97a57": "Road blocks", 14
"#64": "Tractor", 15
"#8b636c": "Non-drivable street", 16
"#d23273": "Zebra crossing", 17
"#ff0080": "Obstacles / trash", 18
"#fff68f": "Poles", 19
"#960096": "RD restricted area", 20
"#ccff99": "Animals", 21
"#eea2ad": "Grid structure", 22
"#212cb1": "Signal corpus", 23
"#b432b4": "Drivable cobblestone", 24
"#ff46b9": "Electronic traffic", 25
"#eee9bf": "Slow drive area", 26
"#93fdc2": "Nature object", 27
"#9696c8": "Parking area", 28
"#b496c8": "Sidewalk", 29
"#48d1cc": "Ego car", 30
"#c87dd2": "Painted driv. instr.", 31
"#9f79ee": "Traffic guide obj.", 32
"#8000ff": "Dashed line", 33
"#ff00ff": "RD normal street", 34
"#87ceff": "Sky", 35
"#f1e6ff": "Buildings", 36
"#60458f": "Blurred area", 37
"#352e52": "Rain dirt", 38
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SEG_COLOR_DICT_A2D2 = {
(255, 0, 0): 28, # Car 1
(200, 0, 0): 28, # Car 2
(150, 0, 0): 28, # Car 3
(128, 0, 0): 28, # Car 4
(182, 89, 6): 27, # Bicycle 1
(150, 50, 4): 27, # Bicycle 2
(90, 30, 1): 27, # Bicycle 3
(90, 30, 30): 27, # Bicycle 4
(204, 153, 255): 26, # Pedestrian 1
(189, 73, 155): 26, # Pedestrian 2
(239, 89, 191): 26, # Pedestrian 3
(255, 128, 0): 30, # Truck 1
(200, 128, 0): 30, # Truck 2
(150, 128, 0): 30, # Truck 3
(0, 255, 0): 32, # Small vehicles 1
(0, 200, 0): 32, # Small vehicles 2
(0, 150, 0): 32, # Small vehicles 3
(0, 128, 255): 19, # Traffic signal 1
(30, 28, 158): 19, # Traffic signal 2
(60, 28, 100): 19, # Traffic signal 3
(0, 255, 255): 20, # Traffic sign 1
(30, 220, 220): 20, # Traffic sign 2
(60, 157, 199): 20, # Traffic sign 3
(255, 255, 0): 29, # Utility vehicle 1
(255, 255, 200): 29, # Utility vehicle 2
(233, 100, 0): 16, # Sidebars
(110, 110, 0): 12, # Speed bumper
(128, 128, 0): 14, # Curbstone
(255, 193, 37): 6, # Solid line
(64, 0, 64): 22, # Irrelevant signs
(185, 122, 87): 17, # Road blocks
(0, 0, 100): 31, # Tractor
(139, 99, 108): 1, # Non-drivable street
(210, 50, 115): 8, # Zebra crossing
(255, 0, 128): 34, # Obstacles / trash
(255, 246, 143): 18, # Poles
(150, 0, 150): 2, # RD restricted area
(204, 255, 153): 33, # Animals
(238, 162, 173): 9, # Grid structure
(33, 44, 177): 21, # Signal corpus
(180, 50, 180): 3, # Drivable cobblestone
(255, 70, 185): 23, # Electronic traffic
(238, 233, 191): 4, # Slow drive area
(147, 253, 194): 24, # Nature object
(150, 150, 200): 5, # Parking area
(180, 150, 200): 13, # Sidewalk
(72, 209, 204): 255, # Ego car
(200, 125, 210): 11, # Painted driv. instr.
(159, 121, 238): 10, # Traffic guide obj.
(128, 0, 255): 7, # Dashed line
(255, 0, 255): 0, # RD normal street
(135, 206, 255): 25, # Sky
(241, 230, 255): 15, # Buildings
(96, 69, 143): 255, # Blurred area
(53, 46, 82): 255, # Rain dirt
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only difference is that the labeling in SEG_COLOR_DICT_A2D2 is not instance based, because I believe mmsegmentation is intended for categorical segmentation.

Which do you prefer? Perhaps adding an additional instance-based dictionary would be good?

(241, 230, 255): 2, # Buildings --> Building
(96, 69, 143): 255, # Blurred area --> Ignore ?
(53, 46, 82): 255, # Rain dirt --> Ignore ?
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 14 categories in 'SEG_COLOR_DICT_CITYSCAPES' which are subclasses of CITYSCAPES, so we can use subcalss train in dataset and model configs.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, could you please elaborate on what you think should be modified?

data_root=data_root,
img_dir='img_dir/train',
ann_dir='ann_dir/train',
pipeline=train_pipeline),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add custom classes train (PR #71)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also elaborate on what you mean with classes (str | Sequence[str], optional): Specify classes to load.?

data_root=data_root,
img_dir='img_dir/val',
ann_dir='ann_dir/val',
pipeline=test_pipeline),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add custom classes train (PR #71)

data_root=data_root,
img_dir='img_dir/val',
ann_dir='ann_dir/val',
pipeline=test_pipeline))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add custom classes train (PR #71)

@xvjiarui
Copy link
Collaborator

Hi @rufuzzz0
Thanks for your contribution.
Could you please fix the lint error?

@robin-karlsson0
Copy link
Author

robin-karlsson0 commented Oct 26, 2020

Hi @xvjiarui
About the lint error, could you help me out to understand why the following lintings fail during the server check but not when I check them on my own computer?

What does this part mean?

  • hook id: isort
  • files were modified by this hook

Ref:

isort....................................................................Failed

  • hook id: isort
  • files were modified by this hook

yapf.....................................................................Failed

  • hook id: yapf
  • files were modified by this hook
    Trim Trailing Whitespace.................................................Passed
    Check Yaml...............................................................Passed
    Fix End of Files.........................................................Passed
    Fix requirements.txt.....................................................Passed
    Fix double quoted strings................................................Failed
  • hook id: double-quote-string-fixer
  • exit code: 1
  • files were modified by this hook

docformatter.............................................................Failed

  • hook id: docformatter
  • files were modified by this hook

@xvjiarui
Copy link
Collaborator

Hi @rufuzzz0
You may try to use the pre-commit. Also, you may fix the conflict.

Comment on lines 288 to 291
try:
symlink(img_filepath, img_symlink_path)
except FileExistsError:
pass
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what case the file would exist already?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xvjiarui I imagine handling a scenario where a user might want to repair the converted dataset by re-running the conversion function without getting an error regarding existing symlink files (i.e. do not have to remember to manually delete the symlink directory structure)

Does this potential elimination of error messaging make sense to you?

Of course we can remove it and throw an error instead, reminding the user to delete the old symlink files?

@robin-karlsson0
Copy link
Author

Hi @xvjiarui
Is there any update on this PR? Do you wish me to do something else, like add instructions to the documentation?

As a demonstration of the PR's working condition, here is a DeepLabv3+ ResNet 50 40k iterations result achieving 81.25% mIoU on a validation set. The model is trained on a dual RTX3090 system.

a2d2_demo

@xvjiarui
Copy link
Collaborator

Hi @rufuzzz0
It looks nice!
I apologize for the late reply.
Could you please merge master to make review easier?

@xvjiarui xvjiarui closed this Dec 10, 2020
@xvjiarui xvjiarui reopened this Dec 10, 2020
@robin-karlsson0
Copy link
Author

robin-karlsson0 commented Dec 10, 2020

@xvjiarui Thank you for your rapid response!
I've recently merged new updates, and believe the fork is up to date with the latest master.

$ git fetch upstream
From https://github.com/open-mmlab/mmsegmentation

  • [new branch] master -> upstream/master
  • [new tag] v0.7.0 -> v0.7.0
  • [new tag] v0.8.0 -> v0.8.0
  • [new tag] v0.9.0 -> v0.9.0

$ git merge upstream/master
Already up to date.

@xvjiarui
Copy link
Collaborator

@xvjiarui Thank you for your rapid response!
I've recently merged new updates, and believe the fork is up to date with the latest master.

$ git fetch upstream
From https://github.com/open-mmlab/mmsegmentation

  • [new branch] master -> upstream/master
  • [new tag] v0.7.0 -> v0.7.0
  • [new tag] v0.8.0 -> v0.8.0
  • [new tag] v0.9.0 -> v0.9.0

$ git merge upstream/master
Already up to date.

However, in the File Changed tab, there are 52 files changed.

@robin-karlsson0
Copy link
Author

@xvjiarui Thank you for your rapid response!
I've recently merged new updates, and believe the fork is up to date with the latest master.
$ git fetch upstream
From https://github.com/open-mmlab/mmsegmentation

  • [new branch] master -> upstream/master
  • [new tag] v0.7.0 -> v0.7.0
  • [new tag] v0.8.0 -> v0.8.0
  • [new tag] v0.9.0 -> v0.9.0

$ git merge upstream/master
Already up to date.

However, in the File Changed tab, there are 52 files changed.

Yes, because these files were modified in my fork in order to sync with the upstream master branch, right?
Sorry, I'm not aware of the procedure to remove the files from the list without making a new PR from scratch.

What would you like me to do?

@xvjiarui
Copy link
Collaborator

Not exactly, the file changed should display the difference between your branch and the upstream master branch.
I don't know why it looks weird.
Could you please create a PR from the non-master branch? So that I could change or push to your branch to fix it.

@robin-karlsson0
Copy link
Author

Not exactly, the file changed should display the difference between your branch and the upstream master branch.
I don't know why it looks weird.
Could you please create a PR from the non-master branch? So that I could change or push to your branch to fix it.

Sure, let me try to redo the PR later today. Sorry for missing the instructions originally.

wjkim81 pushed a commit to wjkim81/mmsegmentation that referenced this pull request Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants