Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
de41fc47
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
大约 1 年 前同步成功
通知
115
Star
4999
Fork
1114
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
6
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleClas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
6
合并请求
6
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
de41fc47
编写于
7月 08, 2021
作者:
W
Wei Shengyu
提交者:
GitHub
7月 08, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1017 from weisy11/develop
decorate "open" with "with"
上级
0c3c266a
3d7be00d
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
17 addition
and
13 deletion
+17
-13
deploy/paddleserving/image_http_client.py
deploy/paddleserving/image_http_client.py
+3
-4
docs/en/advanced_tutorials/image_augmentation/ImageAugment_en.md
.../advanced_tutorials/image_augmentation/ImageAugment_en.md
+6
-4
docs/zh_CN/advanced_tutorials/image_augmentation/ImageAugment.md
..._CN/advanced_tutorials/image_augmentation/ImageAugment.md
+6
-4
ppcls/data/dataloader/vehicle_dataset.py
ppcls/data/dataloader/vehicle_dataset.py
+2
-1
未找到文件。
deploy/paddleserving/image_http_client.py
浏览文件 @
de41fc47
...
...
@@ -22,10 +22,9 @@ py_version = sys.version_info[0]
def
predict
(
image_path
,
server
):
if
py_version
==
2
:
image
=
base64
.
b64encode
(
open
(
image_path
).
read
())
else
:
image
=
base64
.
b64encode
(
open
(
image_path
,
"rb"
).
read
()).
decode
(
"utf-8"
)
with
open
(
image_path
,
"rb"
)
as
f
:
image
=
base64
.
b64encode
(
f
.
read
()).
decode
(
"utf-8"
)
req
=
json
.
dumps
({
"feed"
:
[{
"image"
:
image
}],
"fetch"
:
[
"prediction"
]})
r
=
requests
.
post
(
server
,
data
=
req
,
headers
=
{
"Content-Type"
:
"application/json"
})
...
...
docs/en/advanced_tutorials/image_augmentation/ImageAugment_en.md
浏览文件 @
de41fc47
...
...
@@ -154,10 +154,12 @@ cutout_op = Cutout(n_holes=1, length=112)
ops
=
[
decode_op
,
resize_op
,
cutout_op
]
imgs_dir
=
image_path
fnames
=
os
.
listdir
(
imgs_dir
)
for
f
in
fnames
:
data
=
open
(
os
.
path
.
join
(
imgs_dir
,
f
)).
read
()
imgs_dir
=
"imgs_dir"
file_names
=
os
.
listdir
(
imgs_dir
)
for
file_name
in
file_names
:
file_path
=
os
.
join
(
imgs_dir
,
file_name
)
with
open
(
file_path
)
as
f
:
data
=
f
.
read
()
img
=
transform
(
data
,
ops
)
```
...
...
docs/zh_CN/advanced_tutorials/image_augmentation/ImageAugment.md
浏览文件 @
de41fc47
...
...
@@ -74,10 +74,12 @@ autoaugment_op = ImageNetPolicy()
ops
=
[
decode_op
,
resize_op
,
autoaugment_op
]
imgs_dir
=
图像路径
fnames
=
os
.
listdir
(
imgs_dir
)
for
f
in
fnames
:
data
=
open
(
os
.
path
.
join
(
imgs_dir
,
f
)).
read
()
imgs_dir
=
"imgs_dir"
file_names
=
os
.
listdir
(
imgs_dir
)
for
file_name
in
file_names
:
file_path
=
os
.
join
(
imgs_dir
,
file_name
)
with
open
(
file_path
)
as
f
:
data
=
f
.
read
()
img
=
transform
(
data
,
ops
)
```
...
...
ppcls/data/dataloader/vehicle_dataset.py
浏览文件 @
de41fc47
...
...
@@ -61,7 +61,8 @@ class CompCars(Dataset):
label_path
=
os
.
path
.
join
(
self
.
_label_root
,
l
[
0
].
split
(
'.'
)[
0
]
+
'.txt'
)
assert
os
.
path
.
exists
(
label_path
)
bbox
=
open
(
label_path
).
readlines
()[
-
1
].
strip
().
split
()
with
open
(
label_path
)
as
f
:
bbox
=
f
.
readlines
()[
-
1
].
strip
().
split
()
bbox
=
[
int
(
x
)
for
x
in
bbox
]
self
.
images
.
append
(
os
.
path
.
join
(
self
.
_img_root
,
l
[
0
]))
self
.
labels
.
append
(
int
(
l
[
1
]))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录