Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
b7dcb39c
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b7dcb39c
编写于
4月 10, 2018
作者:
D
Dong Li
提交者:
Jiangtao Hu
4月 10, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perception: fix lint problems in cuda_util
上级
3dc12c8c
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
117 addition
and
138 deletion
+117
-138
modules/perception/cuda_util/BUILD
modules/perception/cuda_util/BUILD
+0
-3
modules/perception/cuda_util/network.cc
modules/perception/cuda_util/network.cc
+0
-0
modules/perception/cuda_util/region_output.cc
modules/perception/cuda_util/region_output.cc
+117
-111
modules/perception/cuda_util/undistortion.cc
modules/perception/cuda_util/undistortion.cc
+0
-0
modules/perception/cuda_util/util.cc
modules/perception/cuda_util/util.cc
+0
-24
未找到文件。
modules/perception/cuda_util/BUILD
浏览文件 @
b7dcb39c
...
@@ -17,13 +17,10 @@ genrule(
...
@@ -17,13 +17,10 @@ genrule(
"CMakeLists.txt"
,
"CMakeLists.txt"
,
"block_uf.cu"
,
"block_uf.cu"
,
"connected_component_gpu.cu"
,
"connected_component_gpu.cu"
,
"network.cc"
,
"network.cu"
,
"network.cu"
,
"region_output.cc"
,
"region_output.cc"
,
"region_output.cu"
,
"region_output.cu"
,
"undistortion.cc"
,
"undistortion.cu"
,
"undistortion.cu"
,
"util.cc"
,
"util.cu"
,
"util.cu"
,
],
],
outs
=
[
"build/libcuda_util.so"
],
outs
=
[
"build/libcuda_util.so"
],
...
...
modules/perception/cuda_util/network.cc
已删除
100644 → 0
浏览文件 @
3dc12c8c
modules/perception/cuda_util/region_output.cc
浏览文件 @
b7dcb39c
...
@@ -14,17 +14,20 @@
...
@@ -14,17 +14,20 @@
* limitations under the License.
* limitations under the License.
*****************************************************************************/
*****************************************************************************/
#include "region_output.h"
#include "
modules/perception/cuda_util/
region_output.h"
#include <algorithm>
#include <map>
#include <map>
#include <vector>
#include <vector>
#include <opencv2/opencv.hpp>
#include "boost/iterator/counting_iterator.hpp"
#include "boost/iterator/counting_iterator.hpp"
#include "opencv2/opencv.hpp"
namespace
apollo
{
namespace
apollo
{
namespace
perception
{
namespace
perception
{
void
get_intersect_bbox
(
const
NormalizedBBox
&
bbox1
,
const
NormalizedBBox
&
bbox2
,
void
get_intersect_bbox
(
const
NormalizedBBox
&
bbox1
,
const
NormalizedBBox
&
bbox2
,
NormalizedBBox
*
intersect_bbox
)
{
NormalizedBBox
*
intersect_bbox
)
{
if
(
bbox2
.
xmin
>
bbox1
.
xmax
||
bbox2
.
xmax
<
bbox1
.
xmin
||
if
(
bbox2
.
xmin
>
bbox1
.
xmax
||
bbox2
.
xmax
<
bbox1
.
xmin
||
bbox2
.
ymin
>
bbox1
.
ymax
||
bbox2
.
ymax
<
bbox1
.
ymin
)
{
bbox2
.
ymin
>
bbox1
.
ymax
||
bbox2
.
ymax
<
bbox1
.
ymin
)
{
...
@@ -52,12 +55,12 @@ float get_bbox_size(const NormalizedBBox &bbox) {
...
@@ -52,12 +55,12 @@ float get_bbox_size(const NormalizedBBox &bbox) {
float
width
=
bbox
.
xmax
-
bbox
.
xmin
;
float
width
=
bbox
.
xmax
-
bbox
.
xmin
;
float
height
=
bbox
.
ymax
-
bbox
.
ymin
;
float
height
=
bbox
.
ymax
-
bbox
.
ymin
;
return
width
*
height
;
return
width
*
height
;
}
}
}
}
}
}
float
get_jaccard_overlap
(
const
NormalizedBBox
&
bbox1
,
const
NormalizedBBox
&
bbox2
)
{
float
get_jaccard_overlap
(
const
NormalizedBBox
&
bbox1
,
const
NormalizedBBox
&
bbox2
)
{
NormalizedBBox
intersect_bbox
;
NormalizedBBox
intersect_bbox
;
get_intersect_bbox
(
bbox1
,
bbox2
,
&
intersect_bbox
);
get_intersect_bbox
(
bbox1
,
bbox2
,
&
intersect_bbox
);
float
intersect_width
=
0.
f
;
float
intersect_width
=
0.
f
;
...
@@ -75,8 +78,9 @@ float get_jaccard_overlap(const NormalizedBBox &bbox1, const NormalizedBBox &bbo
...
@@ -75,8 +78,9 @@ float get_jaccard_overlap(const NormalizedBBox &bbox1, const NormalizedBBox &bbo
}
}
}
}
void
get_max_score_index
(
const
std
::
vector
<
float
>
&
scores
,
const
float
threshold
,
void
get_max_score_index
(
const
std
::
vector
<
float
>
&
scores
,
const
int
top_k
,
std
::
vector
<
std
::
pair
<
float
,
int
>
>
*
score_index_vec
)
{
const
float
threshold
,
const
int
top_k
,
std
::
vector
<
std
::
pair
<
float
,
int
>
>
*
score_index_vec
)
{
// Generate index score pairs.
// Generate index score pairs.
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
scores
.
size
());
++
i
)
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
scores
.
size
());
++
i
)
{
if
(
scores
[
i
]
>
threshold
)
{
if
(
scores
[
i
]
>
threshold
)
{
...
@@ -94,8 +98,9 @@ void get_max_score_index(const std::vector<float> &scores, const float threshold
...
@@ -94,8 +98,9 @@ void get_max_score_index(const std::vector<float> &scores, const float threshold
}
}
}
}
void
apply_nms_fast
(
const
std
::
vector
<
NormalizedBBox
>
&
bboxes
,
void
apply_nms_fast
(
const
std
::
vector
<
NormalizedBBox
>
&
bboxes
,
const
std
::
vector
<
float
>
&
scores
,
const
float
score_threshold
,
const
std
::
vector
<
float
>
&
scores
,
const
float
nms_threshold
,
const
float
eta
,
const
int
top_k
,
const
float
score_threshold
,
const
float
nms_threshold
,
const
float
eta
,
const
int
top_k
,
std
::
vector
<
int
>
*
indices
)
{
std
::
vector
<
int
>
*
indices
)
{
// Sanity check.
// Sanity check.
CHECK_EQ
(
bboxes
.
size
(),
scores
.
size
())
CHECK_EQ
(
bboxes
.
size
(),
scores
.
size
())
...
@@ -130,9 +135,9 @@ void apply_nms_fast(const std::vector<NormalizedBBox> &bboxes,
...
@@ -130,9 +135,9 @@ void apply_nms_fast(const std::vector<NormalizedBBox> &bboxes,
}
}
}
}
void
cross_class_merge
(
std
::
vector
<
int
>
*
indices_ref
,
std
::
vector
<
int
>
*
indices_target
,
void
cross_class_merge
(
std
::
vector
<
int
>
*
indices_ref
,
std
::
vector
<
int
>
*
indices_target
,
std
::
vector
<
NormalizedBBox
>
bboxes
,
float
scale
)
{
std
::
vector
<
NormalizedBBox
>
bboxes
,
float
scale
)
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
indices_ref
->
size
());
i
++
)
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
indices_ref
->
size
());
i
++
)
{
int
ref_idx
=
indices_ref
->
at
(
i
);
int
ref_idx
=
indices_ref
->
at
(
i
);
NormalizedBBox
&
bbox_ref
=
bboxes
[
ref_idx
];
NormalizedBBox
&
bbox_ref
=
bboxes
[
ref_idx
];
...
@@ -145,7 +150,8 @@ void cross_class_merge(std::vector<int> *indices_ref, std::vector<int> *indices_
...
@@ -145,7 +150,8 @@ void cross_class_merge(std::vector<int> *indices_ref, std::vector<int> *indices_
intersection
.
size
=
get_bbox_size
(
intersection
);
intersection
.
size
=
get_bbox_size
(
intersection
);
bbox_target
.
size
=
get_bbox_size
(
bbox_target
);
bbox_target
.
size
=
get_bbox_size
(
bbox_target
);
bbox_ref
.
size
=
get_bbox_size
(
bbox_ref
);
bbox_ref
.
size
=
get_bbox_size
(
bbox_ref
);
if
(
intersection
.
size
>
bbox_target
.
size
*
scale
&&
bbox_target
.
ymax
<=
bbox_ref
.
ymax
)
{
if
(
intersection
.
size
>
bbox_target
.
size
*
scale
&&
bbox_target
.
ymax
<=
bbox_ref
.
ymax
)
{
it
=
indices_target
->
erase
(
it
);
it
=
indices_target
->
erase
(
it
);
}
else
{
}
else
{
it
++
;
it
++
;
...
@@ -154,5 +160,5 @@ void cross_class_merge(std::vector<int> *indices_ref, std::vector<int> *indices_
...
@@ -154,5 +160,5 @@ void cross_class_merge(std::vector<int> *indices_ref, std::vector<int> *indices_
}
}
}
}
}
//namespace apollo
}
// namespace perception
}
//namespace perception
}
// namespace apollo
modules/perception/cuda_util/undistortion.cc
已删除
100644 → 0
浏览文件 @
3dc12c8c
modules/perception/cuda_util/util.cc
已删除
100644 → 0
浏览文件 @
3dc12c8c
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "util.h"
namespace
apollo
{
namespace
perception
{
}
// namespace perception
}
// namespace apollo
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录