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
48546d57
Commit
48546d57
authored
Dec 18, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
point8->point4
parent
9fac1a6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
examples/FasterRCNN/common.py
examples/FasterRCNN/common.py
+4
-2
examples/FasterRCNN/data.py
examples/FasterRCNN/data.py
+4
-4
No files found.
examples/FasterRCNN/common.py
View file @
48546d57
...
...
@@ -62,8 +62,10 @@ class CustomResize(ImageAugmentor):
return
ResizeTransform
(
h
,
w
,
newh
,
neww
,
self
.
interp
)
def
box_to_point
8
(
boxes
):
def
box_to_point
4
(
boxes
):
"""
Convert boxes to its corner points.
Args:
boxes: nx4
...
...
@@ -75,7 +77,7 @@ def box_to_point8(boxes):
return
b
def
point
8
_to_box
(
points
):
def
point
4
_to_box
(
points
):
"""
Args:
points: (nx4)x2
...
...
examples/FasterRCNN/data.py
View file @
48546d57
...
...
@@ -18,8 +18,8 @@ from tensorpack.utils.argtools import log_once
from
modeling.model_rpn
import
get_all_anchors
from
modeling.model_fpn
import
get_all_anchors_fpn
from
common
import
(
CustomResize
,
DataFromListOfDict
,
box_to_point
8
,
filter_boxes_inside_shape
,
np_iou
,
point
8
_to_box
,
polygons_to_mask
,
CustomResize
,
DataFromListOfDict
,
box_to_point
4
,
filter_boxes_inside_shape
,
np_iou
,
point
4
_to_box
,
polygons_to_mask
,
)
from
config
import
config
as
cfg
from
dataset
import
DatasetRegistry
,
register_coco
...
...
@@ -95,9 +95,9 @@ class TrainingDataPreprocessor:
# augmentation:
tfms
=
self
.
aug
.
get_transform
(
im
)
im
=
tfms
.
apply_image
(
im
)
points
=
box_to_point
8
(
boxes
)
points
=
box_to_point
4
(
boxes
)
points
=
tfms
.
apply_coords
(
points
)
boxes
=
point
8
_to_box
(
points
)
boxes
=
point
4
_to_box
(
points
)
if
len
(
boxes
):
assert
klass
.
max
()
<=
self
.
cfg
.
DATA
.
NUM_CATEGORY
,
\
"Invalid category {}!"
.
format
(
klass
.
max
())
...
...
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