Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
00cbcad1
Unverified
Commit
00cbcad1
authored
Sep 06, 2021
by
srihari-humbarwadi
Browse files
added config flag to turn on/off panoptic eval masks in dataloader
parent
485f4618
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
official/vision/beta/projects/panoptic_maskrcnn/configs/panoptic_maskrcnn.py
...a/projects/panoptic_maskrcnn/configs/panoptic_maskrcnn.py
+17
-0
official/vision/beta/projects/panoptic_maskrcnn/tasks/panoptic_maskrcnn.py
...eta/projects/panoptic_maskrcnn/tasks/panoptic_maskrcnn.py
+5
-2
No files found.
official/vision/beta/projects/panoptic_maskrcnn/configs/panoptic_maskrcnn.py
View file @
00cbcad1
...
@@ -21,6 +21,7 @@ from typing import List, Optional
...
@@ -21,6 +21,7 @@ from typing import List, Optional
from
official.core
import
config_definitions
as
cfg
from
official.core
import
config_definitions
as
cfg
from
official.core
import
exp_factory
from
official.core
import
exp_factory
from
official.modeling
import
optimization
from
official.modeling
import
optimization
from
official.vision.beta.configs
import
common
from
official.vision.beta.configs
import
maskrcnn
from
official.vision.beta.configs
import
maskrcnn
from
official.vision.beta.configs
import
semantic_segmentation
from
official.vision.beta.configs
import
semantic_segmentation
...
@@ -46,10 +47,26 @@ class Parser(maskrcnn.Parser):
...
@@ -46,10 +47,26 @@ class Parser(maskrcnn.Parser):
segmentation_groundtruth_padded_size
:
List
[
int
]
=
dataclasses
.
field
(
segmentation_groundtruth_padded_size
:
List
[
int
]
=
dataclasses
.
field
(
default_factory
=
list
)
default_factory
=
list
)
segmentation_ignore_label
:
int
=
255
segmentation_ignore_label
:
int
=
255
panoptic_ignore_label
:
int
=
0
# Setting this to true will enable parsing category_mask and instance_mask
include_eval_masks
:
bool
=
True
@
dataclasses
.
dataclass
class
TfExampleDecoder
(
common
.
TfExampleDecoder
):
"""A simple TF Example decoder config."""
# Setting this to true will enable decoding category_mask and instance_mask
include_eval_masks
:
bool
=
True
@
dataclasses
.
dataclass
class
DataDecoder
(
common
.
DataDecoder
):
"""Data decoder config."""
simple_decoder
:
TfExampleDecoder
=
TfExampleDecoder
()
@
dataclasses
.
dataclass
@
dataclasses
.
dataclass
class
DataConfig
(
maskrcnn
.
DataConfig
):
class
DataConfig
(
maskrcnn
.
DataConfig
):
"""Input config for training."""
"""Input config for training."""
decoder
:
DataDecoder
=
DataDecoder
()
parser
:
Parser
=
Parser
()
parser
:
Parser
=
Parser
()
@
dataclasses
.
dataclass
@
dataclasses
.
dataclass
...
...
official/vision/beta/projects/panoptic_maskrcnn/tasks/panoptic_maskrcnn.py
View file @
00cbcad1
...
@@ -121,7 +121,8 @@ class PanopticMaskRCNNTask(maskrcnn.MaskRCNNTask):
...
@@ -121,7 +121,8 @@ class PanopticMaskRCNNTask(maskrcnn.MaskRCNNTask):
if
params
.
decoder
.
type
==
'simple_decoder'
:
if
params
.
decoder
.
type
==
'simple_decoder'
:
decoder
=
panoptic_maskrcnn_input
.
TfExampleDecoder
(
decoder
=
panoptic_maskrcnn_input
.
TfExampleDecoder
(
regenerate_source_id
=
decoder_cfg
.
regenerate_source_id
,
regenerate_source_id
=
decoder_cfg
.
regenerate_source_id
,
mask_binarize_threshold
=
decoder_cfg
.
mask_binarize_threshold
)
mask_binarize_threshold
=
decoder_cfg
.
mask_binarize_threshold
,
include_eval_masks
=
decoder_cfg
.
include_eval_masks
)
else
:
else
:
raise
ValueError
(
'Unknown decoder type: {}!'
.
format
(
params
.
decoder
.
type
))
raise
ValueError
(
'Unknown decoder type: {}!'
.
format
(
params
.
decoder
.
type
))
...
@@ -147,7 +148,9 @@ class PanopticMaskRCNNTask(maskrcnn.MaskRCNNTask):
...
@@ -147,7 +148,9 @@ class PanopticMaskRCNNTask(maskrcnn.MaskRCNNTask):
.
segmentation_resize_eval_groundtruth
,
.
segmentation_resize_eval_groundtruth
,
segmentation_groundtruth_padded_size
=
params
.
parser
segmentation_groundtruth_padded_size
=
params
.
parser
.
segmentation_groundtruth_padded_size
,
.
segmentation_groundtruth_padded_size
,
segmentation_ignore_label
=
params
.
parser
.
segmentation_ignore_label
)
segmentation_ignore_label
=
params
.
parser
.
segmentation_ignore_label
,
panoptic_ignore_label
=
params
.
parse
.
panoptic_ignore_label
,
include_eval_masks
=
params
.
parser
.
include_eval_masks
)
reader
=
input_reader_factory
.
input_reader_generator
(
reader
=
input_reader_factory
.
input_reader_generator
(
params
,
params
,
...
...
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