Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
98f513a7
Commit
98f513a7
authored
Jan 08, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MaskRCNN] update docs about training coco-format dataset (fix #1038)
parent
6f6787db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
examples/FasterRCNN/NOTES.md
examples/FasterRCNN/NOTES.md
+8
-4
examples/FasterRCNN/dataset.py
examples/FasterRCNN/dataset.py
+3
-2
No files found.
examples/FasterRCNN/NOTES.md
View file @
98f513a7
...
@@ -16,10 +16,14 @@ This is a minimal implementation that simply contains these files:
...
@@ -16,10 +16,14 @@ This is a minimal implementation that simply contains these files:
Data:
Data:
1.
It's easy to train on your own data.
1.
It's easy to train on your own data by changing
`dataset.py`
.
If your data is not in COCO format, you can just rewrite all the methods of
`DetectionDataset`
following its documents in
`dataset.py`
.
+
If your data is in COCO format, modify
`COCODetection`
You'll implement the logic to load your dataset and evaluate predictions.
to change the class names and the id mapping.
+
If your data is not in COCO format, ignore
`COCODetection`
completely and
rewrite all the methods of
`DetectionDataset`
following its documents.
You'll implement the logic to load your dataset and evaluate predictions.
2.
You can easily add more augmentations such as rotation, but be careful how a box should be
2.
You can easily add more augmentations such as rotation, but be careful how a box should be
augmented. The code now will always use the minimal axis-aligned bounding box of the 4 corners,
augmented. The code now will always use the minimal axis-aligned bounding box of the 4 corners,
...
...
examples/FasterRCNN/dataset.py
View file @
98f513a7
...
@@ -25,8 +25,10 @@ class COCODetection(object):
...
@@ -25,8 +25,10 @@ class COCODetection(object):
COCO_id_to_category_id
=
{
1
:
1
,
2
:
2
,
3
:
3
,
4
:
4
,
5
:
5
,
6
:
6
,
7
:
7
,
8
:
8
,
9
:
9
,
10
:
10
,
11
:
11
,
13
:
12
,
14
:
13
,
15
:
14
,
16
:
15
,
17
:
16
,
18
:
17
,
19
:
18
,
20
:
19
,
21
:
20
,
22
:
21
,
23
:
22
,
24
:
23
,
25
:
24
,
27
:
25
,
28
:
26
,
31
:
27
,
32
:
28
,
33
:
29
,
34
:
30
,
35
:
31
,
36
:
32
,
37
:
33
,
38
:
34
,
39
:
35
,
40
:
36
,
41
:
37
,
42
:
38
,
43
:
39
,
44
:
40
,
46
:
41
,
47
:
42
,
48
:
43
,
49
:
44
,
50
:
45
,
51
:
46
,
52
:
47
,
53
:
48
,
54
:
49
,
55
:
50
,
56
:
51
,
57
:
52
,
58
:
53
,
59
:
54
,
60
:
55
,
61
:
56
,
62
:
57
,
63
:
58
,
64
:
59
,
65
:
60
,
67
:
61
,
70
:
62
,
72
:
63
,
73
:
64
,
74
:
65
,
75
:
66
,
76
:
67
,
77
:
68
,
78
:
69
,
79
:
70
,
80
:
71
,
81
:
72
,
82
:
73
,
84
:
74
,
85
:
75
,
86
:
76
,
87
:
77
,
88
:
78
,
89
:
79
,
90
:
80
}
# noqa
COCO_id_to_category_id
=
{
1
:
1
,
2
:
2
,
3
:
3
,
4
:
4
,
5
:
5
,
6
:
6
,
7
:
7
,
8
:
8
,
9
:
9
,
10
:
10
,
11
:
11
,
13
:
12
,
14
:
13
,
15
:
14
,
16
:
15
,
17
:
16
,
18
:
17
,
19
:
18
,
20
:
19
,
21
:
20
,
22
:
21
,
23
:
22
,
24
:
23
,
25
:
24
,
27
:
25
,
28
:
26
,
31
:
27
,
32
:
28
,
33
:
29
,
34
:
30
,
35
:
31
,
36
:
32
,
37
:
33
,
38
:
34
,
39
:
35
,
40
:
36
,
41
:
37
,
42
:
38
,
43
:
39
,
44
:
40
,
46
:
41
,
47
:
42
,
48
:
43
,
49
:
44
,
50
:
45
,
51
:
46
,
52
:
47
,
53
:
48
,
54
:
49
,
55
:
50
,
56
:
51
,
57
:
52
,
58
:
53
,
59
:
54
,
60
:
55
,
61
:
56
,
62
:
57
,
63
:
58
,
64
:
59
,
65
:
60
,
67
:
61
,
70
:
62
,
72
:
63
,
73
:
64
,
74
:
65
,
75
:
66
,
76
:
67
,
77
:
68
,
78
:
69
,
79
:
70
,
80
:
71
,
81
:
72
,
82
:
73
,
84
:
74
,
85
:
75
,
86
:
76
,
87
:
77
,
88
:
78
,
89
:
79
,
90
:
80
}
# noqa
"""
"""
Mapping from the incontinuous COCO category id to an id in [1, #category]
Mapping from the incontinuous COCO category id to an id in [1, #category]
For your own dataset, this should usually be an identity mapping.
"""
"""
# 80 names for COCO
class_names
=
[
class_names
=
[
"person"
,
"bicycle"
,
"car"
,
"motorcycle"
,
"airplane"
,
"bus"
,
"train"
,
"truck"
,
"boat"
,
"traffic light"
,
"fire hydrant"
,
"stop sign"
,
"parking meter"
,
"bench"
,
"bird"
,
"cat"
,
"dog"
,
"horse"
,
"sheep"
,
"cow"
,
"elephant"
,
"bear"
,
"zebra"
,
"giraffe"
,
"backpack"
,
"umbrella"
,
"handbag"
,
"tie"
,
"suitcase"
,
"frisbee"
,
"skis"
,
"snowboard"
,
"sports ball"
,
"kite"
,
"baseball bat"
,
"baseball glove"
,
"skateboard"
,
"surfboard"
,
"tennis racket"
,
"bottle"
,
"wine glass"
,
"cup"
,
"fork"
,
"knife"
,
"spoon"
,
"bowl"
,
"banana"
,
"apple"
,
"sandwich"
,
"orange"
,
"broccoli"
,
"carrot"
,
"hot dog"
,
"pizza"
,
"donut"
,
"cake"
,
"chair"
,
"couch"
,
"potted plant"
,
"bed"
,
"dining table"
,
"toilet"
,
"tv"
,
"laptop"
,
"mouse"
,
"remote"
,
"keyboard"
,
"cell phone"
,
"microwave"
,
"oven"
,
"toaster"
,
"sink"
,
"refrigerator"
,
"book"
,
"clock"
,
"vase"
,
"scissors"
,
"teddy bear"
,
"hair drier"
,
"toothbrush"
]
# noqa
"person"
,
"bicycle"
,
"car"
,
"motorcycle"
,
"airplane"
,
"bus"
,
"train"
,
"truck"
,
"boat"
,
"traffic light"
,
"fire hydrant"
,
"stop sign"
,
"parking meter"
,
"bench"
,
"bird"
,
"cat"
,
"dog"
,
"horse"
,
"sheep"
,
"cow"
,
"elephant"
,
"bear"
,
"zebra"
,
"giraffe"
,
"backpack"
,
"umbrella"
,
"handbag"
,
"tie"
,
"suitcase"
,
"frisbee"
,
"skis"
,
"snowboard"
,
"sports ball"
,
"kite"
,
"baseball bat"
,
"baseball glove"
,
"skateboard"
,
"surfboard"
,
"tennis racket"
,
"bottle"
,
"wine glass"
,
"cup"
,
"fork"
,
"knife"
,
"spoon"
,
"bowl"
,
"banana"
,
"apple"
,
"sandwich"
,
"orange"
,
"broccoli"
,
"carrot"
,
"hot dog"
,
"pizza"
,
"donut"
,
"cake"
,
"chair"
,
"couch"
,
"potted plant"
,
"bed"
,
"dining table"
,
"toilet"
,
"tv"
,
"laptop"
,
"mouse"
,
"remote"
,
"keyboard"
,
"cell phone"
,
"microwave"
,
"oven"
,
"toaster"
,
"sink"
,
"refrigerator"
,
"book"
,
"clock"
,
"vase"
,
"scissors"
,
"teddy bear"
,
"hair drier"
,
"toothbrush"
]
# noqa
...
@@ -191,10 +193,9 @@ class DetectionDataset(object):
...
@@ -191,10 +193,9 @@ class DetectionDataset(object):
This function is responsible for setting the dataset-specific
This function is responsible for setting the dataset-specific
attributes in both cfg and self.
attributes in both cfg and self.
"""
"""
self
.
num_category
=
cfg
.
DATA
.
NUM_CATEGORY
=
80
self
.
num_category
=
cfg
.
DATA
.
NUM_CATEGORY
=
len
(
COCODetection
.
class_names
)
self
.
num_classes
=
self
.
num_category
+
1
self
.
num_classes
=
self
.
num_category
+
1
self
.
class_names
=
cfg
.
DATA
.
CLASS_NAMES
=
[
"BG"
]
+
COCODetection
.
class_names
self
.
class_names
=
cfg
.
DATA
.
CLASS_NAMES
=
[
"BG"
]
+
COCODetection
.
class_names
assert
len
(
self
.
class_names
)
==
self
.
num_classes
def
load_training_roidbs
(
self
,
names
):
def
load_training_roidbs
(
self
,
names
):
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment