Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
曾经的那一瞬间
Models
提交
6b2ed0df
M
Models
项目概览
曾经的那一瞬间
/
Models
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
Models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6b2ed0df
编写于
5月 03, 2023
作者:
A
A. Unique TensorFlower
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add option to omit the NMS placeholder in object detection.
PiperOrigin-RevId: 529212785
上级
ef3c00df
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
0 deletion
+9
-0
official/vision/configs/common.py
official/vision/configs/common.py
+4
-0
official/vision/modeling/layers/detection_generator.py
official/vision/modeling/layers/detection_generator.py
+5
-0
未找到文件。
official/vision/configs/common.py
浏览文件 @
6b2ed0df
...
...
@@ -139,6 +139,7 @@ class PseudoLabelDataConfig(cfg.DataConfig):
@
dataclasses
.
dataclass
class
TFLitePostProcessingConfig
(
hyperparams
.
Config
):
"""TFLite Post Processing config for inference."""
max_detections
:
int
=
200
max_classes_per_detection
:
int
=
5
# Regular NMS run in a multi-class fashion and is slow. Setting it to False
...
...
@@ -149,3 +150,6 @@ class TFLitePostProcessingConfig(hyperparams.Config):
# Whether to normalize coordinates of anchors to [0, 1]. If setting to True,
# coordinates of output boxes is also normalized but latency increases.
normalize_anchor_coordinates
:
Optional
[
bool
]
=
False
# Whether to omit the final nms placeholder op. If set to True, the output
# will be a tuple of boxes, scores result right before the NMS operation.
omit_nms
:
Optional
[
bool
]
=
False
official/vision/modeling/layers/detection_generator.py
浏览文件 @
6b2ed0df
...
...
@@ -889,6 +889,11 @@ def _generate_detections_tflite(
num_detections
=
tf
.
constant
(
0.0
,
dtype
=
tf
.
float32
,
name
=
'num_detections'
)
return
boxes
,
classes
,
scores
,
num_detections
if
config
.
get
(
'omit_nms'
,
False
):
dummy_classes
=
tf
.
constant
(
0.0
,
dtype
=
tf
.
float32
,
name
=
'classes'
)
dummy_num_detections
=
tf
.
constant
(
0.0
,
dtype
=
tf
.
float32
,
name
=
'num_detections'
)
return
boxes
,
dummy_classes
,
scores
,
dummy_num_detections
return
dummy_post_processing
(
boxes
,
scores
,
anchors
)[::
-
1
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录