Skip to content

Commit abfa6bd

Browse files
tensorflower-gardenerfyangf
authored andcommitted
Support output decoded boxes (before NMS) even when NMS is applied.
PiperOrigin-RevId: 501150589
1 parent 9e9bd39 commit abfa6bd

File tree

5 files changed

+455
-256
lines changed

5 files changed

+455
-256
lines changed

official/vision/configs/retinanet.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ class DetectionGenerator(hyperparams.Config):
126126
# custom NMS op and override above parameters.
127127
tflite_post_processing: common.TFLitePostProcessingConfig = common.TFLitePostProcessingConfig(
128128
)
129+
# Return decoded boxes/scores even if apply_nms is set `True`.
130+
return_decoded: Optional[bool] = None
129131

130132

131133
@dataclasses.dataclass

official/vision/modeling/factory.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,9 @@ def build_retinanet(
321321
nms_version=generator_config.nms_version,
322322
use_cpu_nms=generator_config.use_cpu_nms,
323323
soft_nms_sigma=generator_config.soft_nms_sigma,
324-
tflite_post_processing_config=tflite_post_processing_config)
324+
tflite_post_processing_config=tflite_post_processing_config,
325+
return_decoded=generator_config.return_decoded,
326+
)
325327

326328
model = retinanet_model.RetinaNetModel(
327329
backbone,

0 commit comments

Comments
 (0)