Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
VisualDL
提交
c9ccb126
V
VisualDL
项目概览
PaddlePaddle
/
VisualDL
大约 2 年 前同步成功
通知
89
Star
4655
Fork
642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
5
Wiki
分析
仓库
DevOps
项目成员
Pages
V
VisualDL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
5
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c9ccb126
编写于
12月 29, 2017
作者:
S
superjom
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
image ready
上级
1cf7781a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
10 addition
and
8 deletion
+10
-8
CMakeLists.txt
CMakeLists.txt
+3
-2
visualdl/logic/CMakeLists.txt
visualdl/logic/CMakeLists.txt
+2
-2
visualdl/logic/sdk.cc
visualdl/logic/sdk.cc
+3
-2
visualdl/logic/sdk_test.cc
visualdl/logic/sdk_test.cc
+1
-1
visualdl/python/test_storage.py
visualdl/python/test_storage.py
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
c9ccb126
...
...
@@ -30,7 +30,8 @@ include(external/python) # find python and set path
include_directories
(
${
PROJECT_SOURCE_DIR
}
)
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
include_directories
(
${
PROJECT_SOURCE_DIR
}
/thirdparty/local/include
)
# TODO(ChunweiYan) debug, remote latter
include_directories
(
/home/superjom/project/VisualDL/build/third_party/eigen3/src/extern_eigen3
)
add_subdirectory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/visualdl/storage
)
add_subdirectory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/visualdl/logic
)
...
...
@@ -38,9 +39,9 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/visualdl/python)
add_executable
(
vl_test
${
PROJECT_SOURCE_DIR
}
/visualdl/test.cc
${
PROJECT_SOURCE_DIR
}
/visualdl/storage/storage_test.cc
${
PROJECT_SOURCE_DIR
}
/visualdl/logic/sdk_test.cc
${
PROJECT_SOURCE_DIR
}
/visualdl/utils/test_concurrency.cc
${
PROJECT_SOURCE_DIR
}
/visualdl/utils/test_image.cc
${
PROJECT_SOURCE_DIR
}
/visualdl/utils/concurrency.h
${
PROJECT_SOURCE_DIR
}
/visualdl/utils/filesystem.h
)
...
...
visualdl/logic/CMakeLists.txt
浏览文件 @
c9ccb126
add_library
(
im
${
PROJECT_SOURCE_DIR
}
/visualdl/logic/im.cc
)
add_library
(
sdk
${
PROJECT_SOURCE_DIR
}
/visualdl/logic/sdk.cc
)
add_library
(
sdk
${
PROJECT_SOURCE_DIR
}
/visualdl/logic/sdk.cc
${
PROJECT_SOURCE_DIR
}
/visualdl/utils/image.h
)
add_dependencies
(
im storage_proto
)
add_dependencies
(
sdk entry storage storage_proto
)
## pybind
add_library
(
core SHARED
${
PROJECT_SOURCE_DIR
}
/visualdl/logic/pybind.cc
)
add_dependencies
(
core pybind python im entry tablet storage sdk protobuf glog
)
add_dependencies
(
core pybind python im entry tablet storage sdk protobuf glog
eigen3
)
target_link_libraries
(
core PRIVATE pybind entry python im tablet storage sdk protobuf glog
)
set_target_properties
(
core PROPERTIES PREFIX
""
SUFFIX
".so"
)
visualdl/logic/sdk.cc
浏览文件 @
c9ccb126
#include "visualdl/logic/sdk.h"
#include "visualdl/utils/image.h"
namespace
visualdl
{
namespace
components
{
...
...
@@ -101,7 +103,7 @@ void Image::SetSample(int index,
const
std
::
vector
<
value_t
>&
data
)
{
// production
int
size
=
std
::
accumulate
(
shape
.
begin
(),
shape
.
end
(),
1.
,
[](
float
a
,
floa
t
b
)
{
return
a
*
b
;
});
shape
.
begin
(),
shape
.
end
(),
1.
,
[](
int
a
,
in
t
b
)
{
return
a
*
b
;
});
CHECK_GT
(
size
,
0
);
CHECK_EQ
(
shape
.
size
(),
3
)
<<
"shape should be something like (width, height, num_channel)"
;
...
...
@@ -111,7 +113,6 @@ void Image::SetSample(int index,
CHECK_LT
(
index
,
num_samples_
);
CHECK_LE
(
index
,
num_records_
);
// set data
auto
entry
=
step_
.
MutableData
<
std
::
vector
<
char
>>
(
index
);
// trick to store int8 to protobuf
std
::
vector
<
char
>
data_str
(
data
.
size
());
...
...
visualdl/logic/sdk_test.cc
浏览文件 @
c9ccb126
...
...
@@ -56,7 +56,7 @@ TEST(Image, test) {
for
(
int
step
=
0
;
step
<
num_steps
;
step
++
)
{
image
.
StartSampling
();
for
(
int
i
=
0
;
i
<
7
;
i
++
)
{
vector
<
int64_t
>
shape
({
3
,
5
,
5
});
vector
<
int64_t
>
shape
({
5
,
5
,
3
});
vector
<
float
>
data
;
for
(
int
j
=
0
;
j
<
3
*
5
*
5
;
j
++
)
{
data
.
push_back
(
float
(
rand
())
/
RAND_MAX
);
...
...
visualdl/python/test_storage.py
浏览文件 @
c9ccb126
...
...
@@ -36,7 +36,7 @@ class StorageTest(unittest.TestCase):
image_writer
=
self
.
writer
.
image
(
tag
,
10
,
1
)
num_passes
=
10
num_samples
=
100
shape
=
[
3
,
10
,
10
]
shape
=
[
10
,
10
,
3
]
for
pass_
in
xrange
(
num_passes
):
image_writer
.
start_sampling
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录