Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
29c07198
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,体验更适合开发者的 AI 搜索 >>
提交
29c07198
编写于
12月 17, 2020
作者:
S
storypku
提交者:
Liu Jiaming
12月 23, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Perception: one copy of yolo.proto for YOLO and YOLOv4
fix issue#13160
上级
cbdf1499
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
23 addition
and
154 deletion
+23
-154
modules/perception/camera/lib/obstacle/detector/yolo/BUILD
modules/perception/camera/lib/obstacle/detector/yolo/BUILD
+2
-2
modules/perception/camera/lib/obstacle/detector/yolo/proto/yolo.proto
...eption/camera/lib/obstacle/detector/yolo/proto/yolo.proto
+0
-109
modules/perception/camera/lib/obstacle/detector/yolo/region_output.h
...ception/camera/lib/obstacle/detector/yolo/region_output.h
+9
-9
modules/perception/camera/lib/obstacle/detector/yolo/yolo_obstacle_detector.h
...amera/lib/obstacle/detector/yolo/yolo_obstacle_detector.h
+2
-1
modules/perception/camera/lib/obstacle/detector/yolov4/BUILD
modules/perception/camera/lib/obstacle/detector/yolov4/BUILD
+2
-2
modules/perception/camera/lib/obstacle/detector/yolov4/proto/BUILD
...erception/camera/lib/obstacle/detector/yolov4/proto/BUILD
+0
-25
modules/perception/camera/lib/obstacle/detector/yolov4/region_output.h
...ption/camera/lib/obstacle/detector/yolov4/region_output.h
+2
-1
modules/perception/camera/lib/obstacle/detector/yolov4/yolov4_obstacle_detector.cc
.../lib/obstacle/detector/yolov4/yolov4_obstacle_detector.cc
+3
-3
modules/perception/camera/lib/obstacle/detector/yolov4/yolov4_obstacle_detector.h
...a/lib/obstacle/detector/yolov4/yolov4_obstacle_detector.h
+2
-1
modules/perception/camera/proto/BUILD
modules/perception/camera/proto/BUILD
+1
-1
modules/perception/camera/proto/yolo.proto
modules/perception/camera/proto/yolo.proto
+0
-0
未找到文件。
modules/perception/camera/lib/obstacle/detector/yolo/BUILD
浏览文件 @
29c07198
...
...
@@ -12,7 +12,7 @@ cuda_library(
":object_maintainer"
,
"//modules/perception/base"
,
"//modules/perception/camera/common"
,
"//modules/perception/camera/
lib/obstacle/detector/yolo/
proto:yolo_cc_proto"
,
"//modules/perception/camera/proto:yolo_cc_proto"
,
"@local_config_cuda//cuda:cudart"
,
],
)
...
...
@@ -29,7 +29,7 @@ cc_library(
"//cyber"
,
"//modules/perception/base"
,
"//modules/perception/camera/common"
,
"//modules/perception/camera/
lib/obstacle/detector/yolo/
proto:yolo_cc_proto"
,
"//modules/perception/camera/proto:yolo_cc_proto"
,
"@local_config_cuda//cuda:cudart"
,
],
)
...
...
modules/perception/camera/lib/obstacle/detector/yolo/proto/yolo.proto
已删除
100644 → 0
浏览文件 @
cbdf1499
syntax
=
"proto2"
;
package
apollo
.
perception.camera.yolo
;
message
YoloParam
{
optional
ModelParam
model_param
=
1
;
optional
NetworkParam
net_param
=
2
;
optional
NMSParam
nms_param
=
3
;
}
message
ModelParam
{
optional
string
model_name
=
1
[
default
=
"yolo-2d"
];
optional
string
proto_file
=
2
[
default
=
"caffe.pt"
];
optional
string
weight_file
=
3
[
default
=
"caffe.model"
];
optional
string
stage1_pt
=
21
[
default
=
"caffe.pt"
];
optional
string
stage1_md
=
22
[
default
=
"caffe.model"
];
optional
string
stage2_pt
=
23
[
default
=
"caffe.pt"
];
optional
string
stage2_md
=
24
[
default
=
"caffe.model"
];
optional
string
anchors_file
=
4
[
default
=
"anchors.txt"
];
optional
string
types_file
=
5
[
default
=
"types.txt"
];
optional
string
feature_file
=
6
[
default
=
"feature.pt"
];
optional
float
offset_ratio
=
7
[
default
=
0.288889
];
optional
float
cropped_ratio
=
13
[
default
=
0.711111
];
optional
int32
resized_width
=
14
[
default
=
1440
];
optional
int32
aligned_pixel
=
15
[
default
=
32
];
optional
float
confidence_threshold
=
8
[
default
=
0.1
];
optional
float
light_vis_conf_threshold
=
33
[
default
=
0.5
];
optional
float
light_swt_conf_threshold
=
34
[
default
=
0.5
];
optional
float
roi_conf_threshold
=
25
[
default
=
0.1
];
optional
float
box_conf_threshold
=
26
[
default
=
0.5
];
optional
float
stage2_nms_threshold
=
27
[
default
=
0.4
];
optional
float
min_2d_height
=
9
[
default
=
0.0
];
optional
float
min_3d_height
=
30
[
default
=
0.0
];
optional
float
min_3d_width
=
31
[
default
=
0.0
];
optional
float
min_3d_length
=
32
[
default
=
0.0
];
optional
string
calibratetable_root
=
11
[
default
=
"./"
];
optional
string
model_type
=
12
[
default
=
"CaffeNet"
];
optional
int32
ori_cycle
=
16
[
default
=
1
];
optional
bool
per_cls_reg
=
17
[
default
=
false
];
repeated
DimensionStatistics
dimension_statistics
=
18
;
repeated
BBoxStatistics
bbox_statistics
=
19
;
optional
string
expand_file
=
20
[
default
=
"expand.txt"
];
optional
bool
with_box3d
=
41
[
default
=
false
];
optional
bool
with_frbox
=
42
[
default
=
false
];
optional
bool
with_lights
=
43
[
default
=
false
];
optional
bool
with_ratios
=
44
[
default
=
false
];
optional
int32
num_areas
=
46
[
default
=
0
];
optional
float
border_ratio
=
45
[
default
=
.01
];
}
message
NetworkParam
{
optional
string
det1_loc_blob
=
1
[
default
=
"detect1_loc_pred"
];
optional
string
det1_obj_blob
=
2
[
default
=
"detect1_obj_pred"
];
optional
string
det1_cls_blob
=
3
[
default
=
"detect1_cls_pred"
];
optional
string
det1_ori_blob
=
4
[
default
=
"detect1_ori_pred"
];
optional
string
det1_ori_conf_blob
=
5
[
default
=
"detect1_ori_conf_pred"
];
optional
string
det1_dim_blob
=
6
[
default
=
"detect1_dim_pred"
];
optional
string
det2_loc_blob
=
7
[
default
=
"detect2_loc_pred"
];
optional
string
det2_obj_blob
=
8
[
default
=
"detect2_obj_pred"
];
optional
string
det2_cls_blob
=
9
[
default
=
"detect2_cls_pred"
];
optional
string
det2_ori_blob
=
10
[
default
=
"detect2_ori_pred"
];
optional
string
det2_ori_conf_blob
=
11
[
default
=
"detect2_ori_conf_pred"
];
optional
string
det2_dim_blob
=
12
[
default
=
"detect2_dim_pred"
];
optional
string
det3_loc_blob
=
13
[
default
=
"detect3_loc_pred"
];
optional
string
det3_obj_blob
=
14
[
default
=
"detect3_obj_pred"
];
optional
string
det3_cls_blob
=
15
[
default
=
"detect3_cls_pred"
];
optional
string
det3_ori_blob
=
16
[
default
=
"detect3_ori_pred"
];
optional
string
det3_ori_conf_blob
=
17
[
default
=
"detect3_ori_conf_pred"
];
optional
string
det3_dim_blob
=
18
[
default
=
"detect3_dim_pred"
];
optional
string
lof_blob
=
19
[
default
=
"lof_pred"
];
optional
string
lor_blob
=
20
[
default
=
"lor_pred"
];
optional
string
input_blob
=
21
[
default
=
"data"
];
optional
string
rois_blob
=
22
[
default
=
"rois_pred"
];
optional
string
feat_blob
=
23
[
default
=
"conv_feat"
];
optional
string
box_blob
=
24
[
default
=
"box_pred"
];
optional
string
iou_blob
=
25
[
default
=
"iou_pred"
];
optional
string
brvis_blob
=
26
[
default
=
"brvis_pred"
];
optional
string
brswt_blob
=
27
[
default
=
"brswt_pred"
];
optional
string
ltvis_blob
=
28
[
default
=
"ltvis_pred"
];
optional
string
ltswt_blob
=
29
[
default
=
"ltswt_pred"
];
optional
string
rtvis_blob
=
30
[
default
=
"rtvis_pred"
];
optional
string
rtswt_blob
=
31
[
default
=
"rtswt_pred"
];
optional
string
area_id_blob
=
32
[
default
=
"area_id_pred"
];
optional
string
visible_ratio_blob
=
33
[
default
=
"vis_pred"
];
optional
string
cut_off_ratio_blob
=
34
[
default
=
"cut_pred"
];
}
message
NMSParam
{
optional
string
type
=
1
[
default
=
"NormalNMS"
];
optional
float
threshold
=
2
[
default
=
0.4
];
optional
float
sigma
=
3
[
default
=
0.4
];
optional
float
inter_cls_conf_thresh
=
4
[
default
=
0.1
];
optional
float
inter_cls_nms_thresh
=
5
[
default
=
1.0
];
}
message
BBoxStatistics
{
repeated
float
mean
=
1
;
repeated
float
std
=
2
;
}
message
DimensionStatistics
{
optional
float
mean_h
=
1
[
default
=
0.0
];
optional
float
mean_w
=
2
[
default
=
0.0
];
optional
float
mean_l
=
3
[
default
=
0.0
];
optional
float
std_h
=
4
[
default
=
1.0
];
optional
float
std_w
=
5
[
default
=
1.0
];
optional
float
std_l
=
6
[
default
=
1.0
];
}
modules/perception/camera/lib/obstacle/detector/yolo/region_output.h
浏览文件 @
29c07198
...
...
@@ -22,13 +22,14 @@
#include <utility>
#include <vector>
#include "modules/perception/camera/proto/yolo.pb.h"
#include "modules/perception/base/blob.h"
#include "modules/perception/base/box.h"
#include "modules/perception/base/object.h"
#include "modules/perception/base/object_types.h"
#include "modules/perception/camera/common/math_functions.h"
#include "modules/perception/camera/common/util.h"
#include "modules/perception/camera/lib/obstacle/detector/yolo/proto/yolo.pb.h"
namespace
apollo
{
namespace
perception
{
...
...
@@ -163,15 +164,14 @@ void compute_overlapped_by_idx_gpu(const int nthreads, const float *bbox_data,
bool
*
overlapped_data
,
const
cudaStream_t
&
_stream
);
int
get_objects_gpu
(
const
YoloBlobs
&
yolo_blobs
,
const
cudaStream_t
&
stream
,
const
std
::
vector
<
base
::
ObjectSubType
>
&
type
s
,
const
NMSParam
&
nms
,
const
yolo
::
ModelParam
&
model_param
,
float
light_vis_conf_threshold
,
float
light_swt_conf_threshol
d
,
base
::
Blob
<
bool
>
*
overlapped
,
base
::
Blob
<
int
>
*
idx_sm
,
const
std
::
map
<
base
::
ObjectSubType
,
std
::
vector
<
int
>>
&
indices
,
const
std
::
map
<
base
::
ObjectSubType
,
std
::
vector
<
float
>>
&
conf_scores
);
const
YoloBlobs
&
yolo_blobs
,
const
cudaStream_t
&
stream
,
const
std
::
vector
<
base
::
ObjectSubType
>
&
types
,
const
NMSParam
&
nm
s
,
const
yolo
::
ModelParam
&
model_param
,
float
light_vis_conf_threshold
,
float
light_swt_conf_threshold
,
base
::
Blob
<
bool
>
*
overlappe
d
,
base
::
Blob
<
int
>
*
idx_sm
,
const
std
::
map
<
base
::
ObjectSubType
,
std
::
vector
<
int
>>
&
indices
,
const
std
::
map
<
base
::
ObjectSubType
,
std
::
vector
<
float
>>
&
conf_scores
);
void
get_objects_cpu
(
const
YoloBlobs
&
yolo_blobs
,
const
cudaStream_t
&
stream
,
const
std
::
vector
<
base
::
ObjectSubType
>
&
types
,
...
...
modules/perception/camera/lib/obstacle/detector/yolo/yolo_obstacle_detector.h
浏览文件 @
29c07198
...
...
@@ -20,13 +20,14 @@
#include <string>
#include <vector>
#include "modules/perception/camera/proto/yolo.pb.h"
#include "cyber/common/file.h"
#include "modules/perception/base/box.h"
#include "modules/perception/base/object_types.h"
#include "modules/perception/camera/common/util.h"
#include "modules/perception/camera/lib/interface/base_feature_extractor.h"
#include "modules/perception/camera/lib/interface/base_obstacle_detector.h"
#include "modules/perception/camera/lib/obstacle/detector/yolo/proto/yolo.pb.h"
#include "modules/perception/camera/lib/obstacle/detector/yolo/region_output.h"
#include "modules/perception/inference/inference.h"
#include "modules/perception/inference/utils/resize.h"
...
...
modules/perception/camera/lib/obstacle/detector/yolov4/BUILD
浏览文件 @
29c07198
...
...
@@ -12,7 +12,7 @@ cuda_library(
":object_maintainer"
,
"//modules/perception/base"
,
"//modules/perception/camera/common"
,
"//modules/perception/camera/
lib/obstacle/detector/yolov4/proto:yolov4
_cc_proto"
,
"//modules/perception/camera/
proto:yolo
_cc_proto"
,
"@local_config_cuda//cuda:cudart"
,
],
)
...
...
@@ -28,7 +28,7 @@ cc_library(
"//cyber"
,
"//modules/perception/base"
,
"//modules/perception/camera/common"
,
"//modules/perception/camera/
lib/obstacle/detector/yolov4/proto:yolov4
_cc_proto"
,
"//modules/perception/camera/
proto:yolo
_cc_proto"
,
],
)
...
...
modules/perception/camera/lib/obstacle/detector/yolov4/proto/BUILD
已删除
100644 → 0
浏览文件 @
cbdf1499
## Auto generated by `proto_build_generator.py`
load
(
"@rules_proto//proto:defs.bzl"
,
"proto_library"
)
load
(
"@rules_cc//cc:defs.bzl"
,
"cc_proto_library"
)
load
(
"//tools:python_rules.bzl"
,
"py_proto_library"
)
package
(
default_visibility
=
[
"//visibility:public"
])
cc_proto_library
(
name
=
"yolov4_cc_proto"
,
deps
=
[
":yolov4_proto"
,
],
)
proto_library
(
name
=
"yolov4_proto"
,
srcs
=
[
"yolov4.proto"
],
)
py_proto_library
(
name
=
"yolov4_py_pb2"
,
deps
=
[
":yolov4_proto"
,
],
)
modules/perception/camera/lib/obstacle/detector/yolov4/region_output.h
浏览文件 @
29c07198
...
...
@@ -21,13 +21,14 @@
#include <utility>
#include <vector>
#include "modules/perception/camera/proto/yolo.pb.h"
#include "modules/perception/base/blob.h"
#include "modules/perception/base/box.h"
#include "modules/perception/base/object.h"
#include "modules/perception/base/object_types.h"
#include "modules/perception/camera/common/math_functions.h"
#include "modules/perception/camera/common/util.h"
#include "modules/perception/camera/lib/obstacle/detector/yolov4/proto/yolov4.pb.h"
namespace
apollo
{
namespace
perception
{
...
...
modules/perception/camera/lib/obstacle/detector/yolov4/yolov4_obstacle_detector.cc
浏览文件 @
29c07198
...
...
@@ -31,7 +31,7 @@ namespace camera {
using
cyber
::
common
::
GetAbsolutePath
;
void
Yolov4ObstacleDetector
::
LoadInputShape
(
const
yolo
::
ModelParam
&
model_param
)
{
const
yolo
::
ModelParam
&
model_param
)
{
float
offset_ratio
=
model_param
.
offset_ratio
();
float
cropped_ratio
=
model_param
.
cropped_ratio
();
int
resized_width
=
model_param
.
resized_width
();
...
...
@@ -80,7 +80,7 @@ void Yolov4ObstacleDetector::LoadParam(const yolo::YoloParam &yolo_param) {
}
bool
Yolov4ObstacleDetector
::
InitNet
(
const
yolo
::
YoloParam
&
yolo_param
,
const
std
::
string
&
model_root
)
{
const
std
::
string
&
model_root
)
{
const
auto
&
model_param
=
yolo_param
.
model_param
();
std
::
string
proto_file
=
...
...
@@ -313,7 +313,7 @@ bool Yolov4ObstacleDetector::InitFeatureExtractor(const std::string &root_dir) {
}
bool
Yolov4ObstacleDetector
::
Detect
(
const
ObstacleDetectorOptions
&
options
,
CameraFrame
*
frame
)
{
CameraFrame
*
frame
)
{
if
(
frame
==
nullptr
)
{
return
false
;
}
...
...
modules/perception/camera/lib/obstacle/detector/yolov4/yolov4_obstacle_detector.h
浏览文件 @
29c07198
...
...
@@ -20,13 +20,14 @@
#include <string>
#include <vector>
#include "modules/perception/camera/proto/yolo.pb.h"
#include "cyber/common/file.h"
#include "modules/perception/base/box.h"
#include "modules/perception/base/object_types.h"
#include "modules/perception/camera/common/util.h"
#include "modules/perception/camera/lib/interface/base_feature_extractor.h"
#include "modules/perception/camera/lib/interface/base_obstacle_detector.h"
#include "modules/perception/camera/lib/obstacle/detector/yolov4/proto/yolov4.pb.h"
#include "modules/perception/camera/lib/obstacle/detector/yolov4/region_output.h"
#include "modules/perception/inference/inference.h"
#include "modules/perception/inference/utils/resize.h"
...
...
modules/perception/camera/
lib/obstacle/detector/yolo/
proto/BUILD
→
modules/perception/camera/proto/BUILD
浏览文件 @
29c07198
## Auto generated by `proto_build_generator.py`
load
(
"@rules_proto//proto:defs.bzl"
,
"proto_library"
)
load
(
"@rules_cc//cc:defs.bzl"
,
"cc_proto_library"
)
load
(
"
@com_github_grpc_grpc//bazel
:python_rules.bzl"
,
"py_proto_library"
)
load
(
"
//tools
:python_rules.bzl"
,
"py_proto_library"
)
package
(
default_visibility
=
[
"//visibility:public"
])
...
...
modules/perception/camera/
lib/obstacle/detector/yolov4/proto/yolov4
.proto
→
modules/perception/camera/
proto/yolo
.proto
浏览文件 @
29c07198
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录