Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
4ea56919
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
337
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4ea56919
编写于
3月 19, 2019
作者:
qnqinan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sync code with remote
上级
397bb881
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
40 deletion
+0
-40
test/fpga/test_mobilenet_api.cpp
test/fpga/test_mobilenet_api.cpp
+0
-22
test/fpga/test_yolo_api.cpp
test/fpga/test_yolo_api.cpp
+0
-18
未找到文件。
test/fpga/test_mobilenet_api.cpp
浏览文件 @
4ea56919
...
...
@@ -19,13 +19,8 @@ limitations under the License. */
#include <iostream>
#include "../../src/io/paddle_inference_api.h"
<<<<<<<
HEAD
using
namespace
paddle_mobile
;
using
namespace
paddle_mobile
::
fpga
;
=======
using
namespace
paddle_mobile
;
// NOLINT
using
namespace
paddle_mobile
::
fpga
;
// NOLINT
>>>>>>>
upstream
/
develop
static
const
char
*
g_image
=
"../images/mobilenet_txtdata/1.txt"
;
static
const
char
*
g_model
=
"../models/keycurve_l2_regular4_model/__model__"
;
...
...
@@ -57,21 +52,12 @@ signed char float_to_int8(float fdata) {
}
void
quantize
(
float
**
data_in
,
int
data_size
)
{
float
*
tmp
=
*
data_in
;
<<<<<<<
HEAD
signed
char
*
tmp_data
=
(
signed
char
*
)
paddle_mobile
::
fpga
::
fpga_malloc
(
data_size
*
sizeof
(
char
));
=======
signed
char
*
tmp_data
=
(
signed
char
*
)
fpga_malloc
(
data_size
*
sizeof
(
char
));
>>>>>>>
upstream
/
develop
for
(
int
i
=
0
;
i
<
data_size
;
i
++
)
{
tmp_data
[
i
]
=
float_to_int8
((
*
data_in
)[
i
]
+
128
);
}
*
data_in
=
(
float
*
)
tmp_data
;
// NOLINT
<<<<<<<
HEAD
paddle_mobile
::
fpga
::
fpga_free
(
tmp
);
=======
fpga_free
(
tmp
);
>>>>>>>
upstream
/
develop
}
void
convert_to_chw
(
float
**
data_in
,
int
channel
,
int
height
,
int
width
,
...
...
@@ -92,12 +78,8 @@ void dump_stride_float(std::string filename, PaddleTensor input_tensor) {
int
h
=
(
input_tensor
.
shape
)[
2
];
int
w
=
(
input_tensor
.
shape
)[
3
];
int
n
=
(
input_tensor
.
shape
)[
0
];
<<<<<<<
HEAD
float
*
data_tmp
=
reinterpret_cast
<
float
*>
(
malloc
(
c
*
h
*
w
*
sizeof
(
float
)));
=======
float
*
data_tmp
=
reinterpret_cast
<
float
*>
(
malloc
(
c
*
h
*
w
*
sizeof
(
float
)));
>>>>>>>
upstream
/
develop
convert_to_chw
(
&
data_ptr
,
c
,
h
,
w
,
data_tmp
);
std
::
ofstream
out
(
filename
.
c_str
());
float
result
=
0
;
...
...
@@ -138,11 +120,7 @@ int main() {
open_device
();
PaddleMobileConfig
config
=
GetConfig
();
auto
predictor
=
<<<<<<<
HEAD
CreatePaddlePredictor
<
PaddleMobileConfig
,
=======
CreatePaddlePredictor
<
paddle_mobile
::
PaddleMobileConfig
,
>>>>>>>
upstream
/
develop
PaddleEngineKind
::
kPaddleMobile
>
(
config
);
std
::
cout
<<
"Finishing loading model"
<<
std
::
endl
;
...
...
test/fpga/test_yolo_api.cpp
浏览文件 @
4ea56919
...
...
@@ -19,13 +19,8 @@ limitations under the License. */
#include <iostream>
#include "../../src/io/paddle_inference_api.h"
<<<<<<<
HEAD
using
namespace
paddle_mobile
;
using
namespace
paddle_mobile
::
fpga
;
=======
using
namespace
paddle_mobile
;
// NOLINT
using
namespace
paddle_mobile
::
fpga
;
// NOLINT
>>>>>>>
upstream
/
develop
static
const
char
*
g_image
=
"../images/yolo_test_txtimg/1.txt"
;
static
const
char
*
g_model
=
"../models/yolo_bn_l2_model/__model__"
;
...
...
@@ -56,21 +51,12 @@ signed char float_to_int8(float fdata) {
}
void
quantize
(
float
**
data_in
,
int
data_size
)
{
float
*
tmp
=
*
data_in
;
<<<<<<<
HEAD
signed
char
*
tmp_data
=
(
signed
char
*
)
paddle_mobile
::
fpga
::
fpga_malloc
(
data_size
*
sizeof
(
char
));
=======
signed
char
*
tmp_data
=
(
signed
char
*
)
fpga_malloc
(
data_size
*
sizeof
(
char
));
>>>>>>>
upstream
/
develop
for
(
int
i
=
0
;
i
<
data_size
;
i
++
)
{
tmp_data
[
i
]
=
float_to_int8
((
*
data_in
)[
i
]
+
128
);
}
*
data_in
=
(
float
*
)
tmp_data
;
// NOLINT
<<<<<<<
HEAD
paddle_mobile
::
fpga
::
fpga_free
(
tmp
);
=======
fpga_free
(
tmp
);
>>>>>>>
upstream
/
develop
}
void
convert_to_chw
(
float
**
data_in
,
int
channel
,
int
height
,
int
width
,
...
...
@@ -91,12 +77,8 @@ void dump_stride_float(std::string filename, PaddleTensor input_tensor) {
int
h
=
(
input_tensor
.
shape
)[
2
];
int
w
=
(
input_tensor
.
shape
)[
3
];
int
n
=
(
input_tensor
.
shape
)[
0
];
<<<<<<<
HEAD
float
*
data_tmp
=
reinterpret_cast
<
float
*>
(
malloc
(
c
*
h
*
w
*
sizeof
(
float
)));
=======
float
*
data_tmp
=
reinterpret_cast
<
float
*>
(
malloc
(
c
*
h
*
w
*
sizeof
(
float
)));
>>>>>>>
upstream
/
develop
convert_to_chw
(
&
data_ptr
,
c
,
h
,
w
,
data_tmp
);
std
::
ofstream
out
(
filename
.
c_str
());
float
result
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录