Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
887705ec
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
887705ec
编写于
9月 07, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
9月 07, 2020
浏览文件
操作
浏览文件
下载
差异文件
!5808 use MSLIBS_SERVER while downloading third_party
Merge pull request !5808 from hangq/master
上级
5c421984
5b17a69d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
35 addition
and
7 deletion
+35
-7
build.sh
build.sh
+19
-3
mindspore/lite/src/runtime/kernel/arm/fp32/detection_post_process.cc
...ite/src/runtime/kernel/arm/fp32/detection_post_process.cc
+15
-3
mindspore/lite/src/runtime/kernel/arm/fp32/detection_post_process.h
...lite/src/runtime/kernel/arm/fp32/detection_post_process.h
+1
-1
未找到文件。
build.sh
浏览文件 @
887705ec
...
...
@@ -426,7 +426,15 @@ build_flatbuffer() {
cd
${
BASEPATH
}
FLATC
=
"
${
BASEPATH
}
"
/third_party/flatbuffers/build/flatc
if
[[
!
-f
"
${
FLATC
}
"
]]
;
then
git submodule update
--init
--recursive
third_party/flatbuffers
if
[[
${
MSLIBS_SERVER
}
]]
;
then
cd
"
${
BASEPATH
}
"
/third_party/
rm
-rf
./v1.11.0.tar.gz ./flatbuffers
wget http://
${
MSLIBS_SERVER
}
:8081/libs/flatbuffers/v1.11.0.tar.gz
tar
-zxvf
./v1.11.0.tar.gz
mv
./flatbuffers-1.11.0 ./flatbuffers
else
git submodule update
--init
--recursive
third_party/flatbuffers
fi
cd
${
BASEPATH
}
/third_party/flatbuffers
rm
-rf
build
&&
mkdir
-pv
build
&&
cd
build
&&
cmake
-DFLATBUFFERS_BUILD_SHAREDLIB
=
ON ..
&&
make
-j
$THREAD_NUM
gene_flatbuffer
...
...
@@ -447,7 +455,15 @@ build_protobuf() {
cd
${
BASEPATH
}
PROTOC
=
"
${
BASEPATH
}
"
/third_party/protobuf/build/bin/protoc
if
[[
!
-f
"
${
PROTOC
}
"
]]
;
then
git submodule update
--init
--recursive
third_party/protobuf
if
[[
${
MSLIBS_SERVER
}
]]
;
then
cd
"
${
BASEPATH
}
"
/third_party/
rm
-rf
./v3.8.0.tar.gz ./protobuf
wget http://
${
MSLIBS_SERVER
}
:8081/libs/protobuf/v3.8.0.tar.gz
tar
-zxvf
./v3.8.0.tar.gz
mv
./protobuf-3.8.0 ./protobuf
else
git submodule update
--init
--recursive
third_party/protobuf
fi
cd
${
BASEPATH
}
/third_party/protobuf
rm
-rf
build
&&
mkdir
-pv
build
&&
./autogen.sh
./configure
--prefix
=
${
BASEPATH
}
/third_party/protobuf/build
...
...
@@ -584,7 +600,7 @@ build_lite()
fi
build_flatbuffer
build_gtest
if
[
"
${
COMPILE_MINDDATA_LITE
}
"
==
"lite"
]
||
[
"
${
COMPILE_MINDDATA_LITE
}
"
==
"full"
]
;
then
build_minddata_lite_deps
fi
...
...
mindspore/lite/src/runtime/kernel/arm/fp32/detection_post_process.cc
浏览文件 @
887705ec
...
...
@@ -30,6 +30,7 @@ int DetectionPostProcessCPUKernel::Init() {
MS_ASSERT
(
context_
->
allocator
!=
nullptr
);
auto
anchor_tensor
=
in_tensors_
.
at
(
2
);
DetectionPostProcessParameter
*
parameter
=
reinterpret_cast
<
DetectionPostProcessParameter
*>
(
op_parameter_
);
parameter
->
anchors_
=
nullptr
;
if
(
anchor_tensor
->
data_type
()
==
kNumberTypeUInt8
)
{
const
auto
quant_params
=
anchor_tensor
->
GetQuantParams
();
const
double
scale
=
quant_params
.
at
(
0
).
scale
;
...
...
@@ -37,15 +38,21 @@ int DetectionPostProcessCPUKernel::Init() {
auto
anchor_uint8
=
reinterpret_cast
<
uint8_t
*>
(
anchor_tensor
->
Data
());
auto
anchor_fp32
=
reinterpret_cast
<
float
*>
(
context_
->
allocator
->
Malloc
(
anchor_tensor
->
ElementsNum
()
*
sizeof
(
float
)));
if
(
anchor_fp32
==
nullptr
)
{
MS_LOG
(
ERROR
)
<<
"Malloc anchor failed"
;
return
RET_ERROR
;
}
for
(
int
i
=
0
;
i
<
anchor_tensor
->
ElementsNum
();
++
i
)
{
*
(
anchor_fp32
+
i
)
=
static_cast
<
float
>
((
static_cast
<
int
>
(
anchor_uint8
[
i
])
-
zp
)
*
scale
);
}
parameter
->
anchors_
=
anchor_fp32
;
}
else
if
(
anchor_tensor
->
data_type
()
==
kNumberTypeFloat32
)
{
auto
anchor_fp32
=
reinterpret_cast
<
float
*>
(
anchor_tensor
->
Data
());
for
(
int
i
=
0
;
i
<
anchor_tensor
->
ElementsNum
();
++
i
)
{
parameter
->
anchors_
[
i
]
=
anchor_fp32
[
i
];
parameter
->
anchors_
=
reinterpret_cast
<
float
*>
(
context_
->
allocator
->
Malloc
(
anchor_tensor
->
Size
()));
if
(
parameter
->
anchors_
==
nullptr
)
{
MS_LOG
(
ERROR
)
<<
"Malloc anchor failed"
;
return
RET_ERROR
;
}
memcpy
(
parameter
->
anchors_
,
anchor_tensor
->
Data
(),
anchor_tensor
->
Size
());
}
else
{
MS_LOG
(
ERROR
)
<<
"unsupported anchor data type "
<<
anchor_tensor
->
data_type
();
return
RET_ERROR
;
...
...
@@ -53,6 +60,11 @@ int DetectionPostProcessCPUKernel::Init() {
return
RET_OK
;
}
DetectionPostProcessCPUKernel
::~
DetectionPostProcessCPUKernel
()
{
DetectionPostProcessParameter
*
parameter
=
reinterpret_cast
<
DetectionPostProcessParameter
*>
(
op_parameter_
);
context_
->
allocator
->
Free
(
parameter
->
anchors_
);
}
int
DetectionPostProcessCPUKernel
::
ReSize
()
{
return
RET_OK
;
}
int
DetectionPostProcessCPUKernel
::
Run
()
{
...
...
mindspore/lite/src/runtime/kernel/arm/fp32/detection_post_process.h
浏览文件 @
887705ec
...
...
@@ -33,7 +33,7 @@ class DetectionPostProcessCPUKernel : public LiteKernel {
:
LiteKernel
(
parameter
,
inputs
,
outputs
,
ctx
,
primitive
)
{
param_
=
reinterpret_cast
<
DetectionPostProcessCPUKernel
*>
(
parameter
);
}
~
DetectionPostProcessCPUKernel
()
override
=
default
;
~
DetectionPostProcessCPUKernel
()
override
;
int
Init
()
override
;
int
ReSize
()
override
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录