Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
maskrcnn
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
人工智能
maskrcnn
Commits
851660d3
Commit
851660d3
authored
Nov 26, 2018
by
zimenglan
Committed by
Francisco Massa
Nov 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make pixel indexes 0-based for bounding box in pascal voc dataset (#209)
parent
9a1ba140
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
voc.py
maskrcnn_benchmark/data/datasets/voc.py
+11
-9
No files found.
maskrcnn_benchmark/data/datasets/voc.py
View file @
851660d3
...
...
@@ -88,22 +88,24 @@ class PascalVOCDataset(torch.utils.data.Dataset):
boxes
=
[]
gt_classes
=
[]
difficult_boxes
=
[]
TO_REMOVE
=
1
for
obj
in
target
.
iter
(
"object"
):
difficult
=
int
(
obj
.
find
(
"difficult"
)
.
text
)
==
1
if
not
self
.
keep_difficult
and
difficult
:
continue
name
=
obj
.
find
(
"name"
)
.
text
.
lower
()
.
strip
()
bb
=
obj
.
find
(
"bndbox"
)
# Make pixel indexes 0-based
# Refer to "https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/datasets/pascal_voc.py#L208-L211"
box
=
[
bb
.
find
(
"xmin"
)
.
text
,
bb
.
find
(
"ymin"
)
.
text
,
bb
.
find
(
"xmax"
)
.
text
,
bb
.
find
(
"ymax"
)
.
text
,
]
bndbox
=
tuple
(
map
(
int
,
[
bb
.
find
(
"xmin"
)
.
text
,
bb
.
find
(
"ymin"
)
.
text
,
bb
.
find
(
"xmax"
)
.
text
,
bb
.
find
(
"ymax"
)
.
text
,
],
)
map
(
lambda
x
:
x
-
TO_REMOVE
,
list
(
map
(
int
,
box
)))
)
boxes
.
append
(
bndbox
)
...
...
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