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
09d9656f
Unverified
Commit
09d9656f
authored
Jan 13, 2022
by
Srihari Humbarwadi
Committed by
GitHub
Jan 13, 2022
Browse files
Merge branch 'panoptic-segmentation' into panoptic-deeplab-modeling
parents
ac671306
49a5706c
Changes
427
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
54 additions
and
57 deletions
+54
-57
official/legacy/detection/configs/retinanet_config.py
official/legacy/detection/configs/retinanet_config.py
+1
-1
official/legacy/detection/configs/shapemask_config.py
official/legacy/detection/configs/shapemask_config.py
+1
-1
official/legacy/detection/dataloader/__init__.py
official/legacy/detection/dataloader/__init__.py
+0
-0
official/legacy/detection/dataloader/anchor.py
official/legacy/detection/dataloader/anchor.py
+1
-1
official/legacy/detection/dataloader/factory.py
official/legacy/detection/dataloader/factory.py
+4
-4
official/legacy/detection/dataloader/input_reader.py
official/legacy/detection/dataloader/input_reader.py
+3
-5
official/legacy/detection/dataloader/maskrcnn_parser.py
official/legacy/detection/dataloader/maskrcnn_parser.py
+9
-13
official/legacy/detection/dataloader/mode_keys.py
official/legacy/detection/dataloader/mode_keys.py
+0
-0
official/legacy/detection/dataloader/olnmask_parser.py
official/legacy/detection/dataloader/olnmask_parser.py
+5
-5
official/legacy/detection/dataloader/retinanet_parser.py
official/legacy/detection/dataloader/retinanet_parser.py
+5
-5
official/legacy/detection/dataloader/shapemask_parser.py
official/legacy/detection/dataloader/shapemask_parser.py
+7
-7
official/legacy/detection/dataloader/tf_example_decoder.py
official/legacy/detection/dataloader/tf_example_decoder.py
+0
-0
official/legacy/detection/evaluation/__init__.py
official/legacy/detection/evaluation/__init__.py
+0
-0
official/legacy/detection/evaluation/coco_evaluator.py
official/legacy/detection/evaluation/coco_evaluator.py
+4
-2
official/legacy/detection/evaluation/coco_utils.py
official/legacy/detection/evaluation/coco_utils.py
+3
-3
official/legacy/detection/evaluation/factory.py
official/legacy/detection/evaluation/factory.py
+1
-1
official/legacy/detection/executor/__init__.py
official/legacy/detection/executor/__init__.py
+0
-0
official/legacy/detection/executor/detection_executor.py
official/legacy/detection/executor/detection_executor.py
+1
-1
official/legacy/detection/executor/distributed_executor.py
official/legacy/detection/executor/distributed_executor.py
+2
-2
official/legacy/detection/main.py
official/legacy/detection/main.py
+7
-6
No files found.
official/
vision
/detection/configs/retinanet_config.py
→
official/
legacy
/detection/configs/retinanet_config.py
View file @
09d9656f
...
...
@@ -14,8 +14,8 @@
"""Config template to train Retinanet."""
from
official.legacy.detection.configs
import
base_config
from
official.modeling.hyperparams
import
params_dict
from
official.vision.detection.configs
import
base_config
# pylint: disable=line-too-long
...
...
official/
vision
/detection/configs/shapemask_config.py
→
official/
legacy
/detection/configs/shapemask_config.py
View file @
09d9656f
...
...
@@ -14,8 +14,8 @@
"""Config to train shapemask on COCO."""
from
official.legacy.detection.configs
import
base_config
from
official.modeling.hyperparams
import
params_dict
from
official.vision.detection.configs
import
base_config
SHAPEMASK_RESNET_FROZEN_VAR_PREFIX
=
r
'(conv2d(|_([1-9]|10))|batch_normalization(|_([1-9]|10)))\/'
...
...
official/
nlp/projects/teams
/__init__.py
→
official/
legacy/detection/dataloader
/__init__.py
View file @
09d9656f
File moved
official/
vision
/detection/dataloader/anchor.py
→
official/
legacy
/detection/dataloader/anchor.py
View file @
09d9656f
...
...
@@ -21,8 +21,8 @@ from __future__ import print_function
import
collections
import
tensorflow
as
tf
from
official.legacy.detection.utils
import
box_utils
from
official.vision.beta.ops
import
iou_similarity
from
official.vision.detection.utils
import
box_utils
from
official.vision.utils.object_detection
import
argmax_matcher
from
official.vision.utils.object_detection
import
balanced_positive_negative_sampler
from
official.vision.utils.object_detection
import
box_list
...
...
official/
vision
/detection/dataloader/factory.py
→
official/
legacy
/detection/dataloader/factory.py
View file @
09d9656f
...
...
@@ -18,10 +18,10 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
print_function
from
official.
vision
.detection.dataloader
import
maskrcnn_parser
from
official.
vision
.detection.dataloader
import
olnmask_parser
from
official.
vision
.detection.dataloader
import
retinanet_parser
from
official.
vision
.detection.dataloader
import
shapemask_parser
from
official.
legacy
.detection.dataloader
import
maskrcnn_parser
from
official.
legacy
.detection.dataloader
import
olnmask_parser
from
official.
legacy
.detection.dataloader
import
retinanet_parser
from
official.
legacy
.detection.dataloader
import
shapemask_parser
def
parser_generator
(
params
,
mode
):
...
...
official/
vision
/detection/dataloader/input_reader.py
→
official/
legacy
/detection/dataloader/input_reader.py
View file @
09d9656f
...
...
@@ -17,13 +17,11 @@
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
from
typing
import
Optional
,
Text
import
tensorflow
as
tf
from
typing
import
Text
,
Optional
from
official.legacy.detection.dataloader
import
factory
from
official.legacy.detection.dataloader
import
mode_keys
as
ModeKeys
from
official.modeling.hyperparams
import
params_dict
from
official.vision.detection.dataloader
import
factory
from
official.vision.detection.dataloader
import
mode_keys
as
ModeKeys
class
InputFn
(
object
):
...
...
official/
vision
/detection/dataloader/maskrcnn_parser.py
→
official/
legacy
/detection/dataloader/maskrcnn_parser.py
View file @
09d9656f
...
...
@@ -16,12 +16,12 @@
import
tensorflow
as
tf
from
official.
vision
.detection.dataloader
import
anchor
from
official.
vision
.detection.dataloader
import
mode_keys
as
ModeKeys
from
official.
vision
.detection.dataloader
import
tf_example_decoder
from
official.
vision
.detection.utils
import
box_utils
from
official.
vision
.detection.utils
import
dataloader_utils
from
official.
vision
.detection.utils
import
input_utils
from
official.
legacy
.detection.dataloader
import
anchor
from
official.
legacy
.detection.dataloader
import
mode_keys
as
ModeKeys
from
official.
legacy
.detection.dataloader
import
tf_example_decoder
from
official.
legacy
.detection.utils
import
box_utils
from
official.
legacy
.detection.utils
import
dataloader_utils
from
official.
legacy
.detection.utils
import
input_utils
class
Parser
(
object
):
...
...
@@ -345,12 +345,8 @@ class Parser(object):
image
=
tf
.
cast
(
image
,
dtype
=
tf
.
bfloat16
)
# Compute Anchor boxes.
input_anchor
=
anchor
.
Anchor
(
self
.
_min_level
,
self
.
_max_level
,
self
.
_num_scales
,
self
.
_aspect_ratios
,
self
.
_anchor_size
,
_
=
anchor
.
Anchor
(
self
.
_min_level
,
self
.
_max_level
,
self
.
_num_scales
,
self
.
_aspect_ratios
,
self
.
_anchor_size
,
(
image_height
,
image_width
))
labels
=
{
...
...
official/
vision
/detection/dataloader/mode_keys.py
→
official/
legacy
/detection/dataloader/mode_keys.py
View file @
09d9656f
File moved
official/
vision
/detection/dataloader/olnmask_parser.py
→
official/
legacy
/detection/dataloader/olnmask_parser.py
View file @
09d9656f
...
...
@@ -16,11 +16,11 @@
import
tensorflow
as
tf
from
official.
vision
.detection.dataloader
import
anchor
from
official.
vision
.detection.dataloader.maskrcnn_parser
import
Parser
as
MaskrcnnParser
from
official.
vision
.detection.utils
import
box_utils
from
official.
vision
.detection.utils
import
class_utils
from
official.
vision
.detection.utils
import
input_utils
from
official.
legacy
.detection.dataloader
import
anchor
from
official.
legacy
.detection.dataloader.maskrcnn_parser
import
Parser
as
MaskrcnnParser
from
official.
legacy
.detection.utils
import
box_utils
from
official.
legacy
.detection.utils
import
class_utils
from
official.
legacy
.detection.utils
import
input_utils
class
Parser
(
MaskrcnnParser
):
...
...
official/
vision
/detection/dataloader/retinanet_parser.py
→
official/
legacy
/detection/dataloader/retinanet_parser.py
View file @
09d9656f
...
...
@@ -23,11 +23,11 @@ Focal Loss for Dense Object Detection. arXiv:1708.02002
import
tensorflow
as
tf
from
official.
vision
.detection.dataloader
import
anchor
from
official.
vision
.detection.dataloader
import
mode_keys
as
ModeKeys
from
official.
vision
.detection.dataloader
import
tf_example_decoder
from
official.
vision
.detection.utils
import
box_utils
from
official.
vision
.detection.utils
import
input_utils
from
official.
legacy
.detection.dataloader
import
anchor
from
official.
legacy
.detection.dataloader
import
mode_keys
as
ModeKeys
from
official.
legacy
.detection.dataloader
import
tf_example_decoder
from
official.
legacy
.detection.utils
import
box_utils
from
official.
legacy
.detection.utils
import
input_utils
def
process_source_id
(
source_id
):
...
...
official/
vision
/detection/dataloader/shapemask_parser.py
→
official/
legacy
/detection/dataloader/shapemask_parser.py
View file @
09d9656f
...
...
@@ -23,13 +23,13 @@ arXiv:1904.03239.
"""
import
tensorflow
as
tf
from
official.
vision
.detection.dataloader
import
anchor
from
official.
vision
.detection.dataloader
import
mode_keys
as
ModeKeys
from
official.
vision
.detection.dataloader
import
tf_example_decoder
from
official.
vision
.detection.utils
import
box_utils
from
official.
vision
.detection.utils
import
class_utils
from
official.
vision
.detection.utils
import
dataloader_utils
from
official.
vision
.detection.utils
import
input_utils
from
official.
legacy
.detection.dataloader
import
anchor
from
official.
legacy
.detection.dataloader
import
mode_keys
as
ModeKeys
from
official.
legacy
.detection.dataloader
import
tf_example_decoder
from
official.
legacy
.detection.utils
import
box_utils
from
official.
legacy
.detection.utils
import
class_utils
from
official.
legacy
.detection.utils
import
dataloader_utils
from
official.
legacy
.detection.utils
import
input_utils
def
pad_to_size
(
input_tensor
,
size
):
...
...
official/
vision
/detection/dataloader/tf_example_decoder.py
→
official/
legacy
/detection/dataloader/tf_example_decoder.py
View file @
09d9656f
File moved
official/
nlp/projects/triviaqa
/__init__.py
→
official/
legacy/detection/evaluation
/__init__.py
View file @
09d9656f
File moved
official/
vision
/detection/evaluation/coco_evaluator.py
→
official/
legacy
/detection/evaluation/coco_evaluator.py
View file @
09d9656f
...
...
@@ -40,11 +40,12 @@ from pycocotools import cocoeval
import
six
import
tensorflow
as
tf
from
official.
vision
.detection.evaluation
import
coco_utils
from
official.
vision
.detection.utils
import
class_utils
from
official.
legacy
.detection.evaluation
import
coco_utils
from
official.
legacy
.detection.utils
import
class_utils
class
MetricWrapper
(
object
):
"""Metric Wrapper of the COCO evaluator."""
# This is only a wrapper for COCO metric and works on for numpy array. So it
# doesn't inherit from tf.keras.layers.Layer or tf.keras.metrics.Metric.
...
...
@@ -52,6 +53,7 @@ class MetricWrapper(object):
self
.
_evaluator
=
evaluator
def
update_state
(
self
,
y_true
,
y_pred
):
"""Update internal states."""
labels
=
tf
.
nest
.
map_structure
(
lambda
x
:
x
.
numpy
(),
y_true
)
outputs
=
tf
.
nest
.
map_structure
(
lambda
x
:
x
.
numpy
(),
y_pred
)
groundtruths
=
{}
...
...
official/
vision
/detection/evaluation/coco_utils.py
→
official/
legacy
/detection/evaluation/coco_utils.py
View file @
09d9656f
...
...
@@ -29,9 +29,9 @@ from pycocotools import mask as mask_api
import
six
import
tensorflow
as
tf
from
official.
vision
.detection.dataloader
import
tf_example_decoder
from
official.
vision
.detection.utils
import
box_utils
from
official.
vision
.detection.utils
import
mask_utils
from
official.
legacy
.detection.dataloader
import
tf_example_decoder
from
official.
legacy
.detection.utils
import
box_utils
from
official.
legacy
.detection.utils
import
mask_utils
class
COCOWrapper
(
coco
.
COCO
):
...
...
official/
vision
/detection/evaluation/factory.py
→
official/
legacy
/detection/evaluation/factory.py
View file @
09d9656f
...
...
@@ -18,7 +18,7 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
print_function
from
official.
vision
.detection.evaluation
import
coco_evaluator
from
official.
legacy
.detection.evaluation
import
coco_evaluator
def
evaluator_generator
(
params
):
...
...
official/
nlp/transforme
r/__init__.py
→
official/
legacy/detection/executo
r/__init__.py
View file @
09d9656f
File moved
official/
vision
/detection/executor/detection_executor.py
→
official/
legacy
/detection/executor/detection_executor.py
View file @
09d9656f
...
...
@@ -21,7 +21,7 @@ from __future__ import print_function
from
absl
import
logging
import
tensorflow
as
tf
from
official.
vision
.detection.executor
import
distributed_executor
as
executor
from
official.
legacy
.detection.executor
import
distributed_executor
as
executor
from
official.vision.utils.object_detection
import
visualization_utils
...
...
official/
vision
/detection/executor/distributed_executor.py
→
official/
legacy
/detection/executor/distributed_executor.py
View file @
09d9656f
...
...
@@ -19,6 +19,7 @@ from __future__ import division
from
__future__
import
print_function
import
os
from
typing
import
Optional
,
Dict
,
List
,
Text
,
Callable
,
Union
,
Iterator
,
Any
from
absl
import
flags
from
absl
import
logging
...
...
@@ -27,10 +28,9 @@ import numpy as np
import
tensorflow
as
tf
# pylint: disable=unused-import,g-import-not-at-top,redefined-outer-name,reimported
from
typing
import
Optional
,
Dict
,
List
,
Text
,
Callable
,
Union
,
Iterator
,
Any
from
official.common
import
distribute_utils
from
official.modeling.hyperparams
import
params_dict
from
official.utils
import
hyperparams_flags
from
official.common
import
distribute_utils
from
official.utils.misc
import
keras_utils
FLAGS
=
flags
.
FLAGS
...
...
official/
vision
/detection/main.py
→
official/
legacy
/detection/main.py
View file @
09d9656f
...
...
@@ -23,16 +23,16 @@ from absl import logging
import
tensorflow
as
tf
from
official.common
import
distribute_utils
from
official.legacy.detection.configs
import
factory
as
config_factory
from
official.legacy.detection.dataloader
import
input_reader
from
official.legacy.detection.dataloader
import
mode_keys
as
ModeKeys
from
official.legacy.detection.executor
import
distributed_executor
as
executor
from
official.legacy.detection.executor.detection_executor
import
DetectionDistributedExecutor
from
official.legacy.detection.modeling
import
factory
as
model_factory
from
official.modeling.hyperparams
import
params_dict
from
official.utils
import
hyperparams_flags
from
official.utils.flags
import
core
as
flags_core
from
official.utils.misc
import
keras_utils
from
official.vision.detection.configs
import
factory
as
config_factory
from
official.vision.detection.dataloader
import
input_reader
from
official.vision.detection.dataloader
import
mode_keys
as
ModeKeys
from
official.vision.detection.executor
import
distributed_executor
as
executor
from
official.vision.detection.executor.detection_executor
import
DetectionDistributedExecutor
from
official.vision.detection.modeling
import
factory
as
model_factory
hyperparams_flags
.
initialize_common_flags
()
flags_core
.
define_log_steps
()
...
...
@@ -173,6 +173,7 @@ def run_executor(params,
def
run
(
callbacks
=
None
):
"""Runs the experiment."""
keras_utils
.
set_session_config
(
enable_xla
=
FLAGS
.
enable_xla
)
params
=
config_factory
.
config_generator
(
FLAGS
.
model
)
...
...
Prev
1
2
3
4
5
6
…
22
Next
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