Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleHub
提交
bf0e1b7f
P
PaddleHub
项目概览
PaddlePaddle
/
PaddleHub
大约 1 年 前同步成功
通知
282
Star
12117
Fork
2091
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
200
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleHub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
200
Issue
200
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bf0e1b7f
编写于
4月 18, 2019
作者:
W
wuzewu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add cv dataset
上级
5eade5ce
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
123 addition
and
8 deletion
+123
-8
paddlehub/dataset/__init__.py
paddlehub/dataset/__init__.py
+3
-0
paddlehub/dataset/base_cv_dataset.py
paddlehub/dataset/base_cv_dataset.py
+9
-8
paddlehub/dataset/food101.py
paddlehub/dataset/food101.py
+37
-0
paddlehub/dataset/indoor67.py
paddlehub/dataset/indoor67.py
+36
-0
paddlehub/dataset/stanford_dogs.py
paddlehub/dataset/stanford_dogs.py
+38
-0
未找到文件。
paddlehub/dataset/__init__.py
浏览文件 @
bf0e1b7f
...
@@ -22,3 +22,6 @@ from .lcqmc import LCQMC
...
@@ -22,3 +22,6 @@ from .lcqmc import LCQMC
# CV Dataset
# CV Dataset
from
.dogcat
import
DogCatDataset
as
DogCat
from
.dogcat
import
DogCatDataset
as
DogCat
from
.flowers
import
FlowersDataset
as
Flowers
from
.flowers
import
FlowersDataset
as
Flowers
from
.stanford_dogs
import
StanfordDogsDataset
as
StanfordDogs
from
.food101
import
Food101Dataset
as
Food101
from
.indoor67
import
Indoor67Dataset
as
Indoor67
paddlehub/dataset/base_cv_dataset.py
浏览文件 @
bf0e1b7f
...
@@ -54,15 +54,16 @@ class ImageClassificationDataset(object):
...
@@ -54,15 +54,16 @@ class ImageClassificationDataset(object):
break
break
line
=
line
.
strip
()
line
=
line
.
strip
()
items
=
line
.
split
(
" "
)
items
=
line
.
split
(
" "
)
if
os
.
path
.
isabs
(
items
[
0
])
:
if
len
(
items
)
>
2
:
image_path
=
items
[
0
]
image_path
=
" "
.
join
(
items
[
0
:
-
1
])
else
:
else
:
if
self
.
base_path
is
None
:
image_path
=
items
[
0
]
image_path
=
items
[
0
]
if
not
os
.
path
.
isabs
(
image_path
):
else
:
if
self
.
base_path
is
not
None
:
image_path
=
os
.
path
.
join
(
self
.
base_path
,
items
[
0
])
image_path
=
os
.
path
.
join
(
self
.
base_path
,
label
=
items
[
1
]
image_path
)
data
.
append
((
image_path
,
items
[
1
]))
label
=
items
[
-
1
]
data
.
append
((
image_path
,
items
[
-
1
]))
if
shuffle
:
if
shuffle
:
np
.
random
.
shuffle
(
data
)
np
.
random
.
shuffle
(
data
)
...
...
paddlehub/dataset/food101.py
0 → 100644
浏览文件 @
bf0e1b7f
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
import
paddlehub
as
hub
from
paddlehub.dataset.base_cv_dataset
import
ImageClassificationDataset
class
Food101Dataset
(
ImageClassificationDataset
):
def
__init__
(
self
):
super
(
Food101Dataset
,
self
).
__init__
()
dataset_path
=
os
.
path
.
join
(
hub
.
common
.
dir
.
DATA_HOME
,
"food-101"
,
"images"
)
self
.
base_path
=
self
.
_download_dataset
(
dataset_path
=
dataset_path
,
url
=
"https://paddlehub-dataset.bj.bcebos.com/Food101.tar.gz"
)
self
.
train_list_file
=
"train_list.txt"
self
.
test_list_file
=
"test_list.txt"
self
.
validate_list_file
=
"validate_list.txt"
self
.
label_list_file
=
"label_list.txt"
self
.
num_labels
=
101
paddlehub/dataset/indoor67.py
0 → 100644
浏览文件 @
bf0e1b7f
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
import
paddlehub
as
hub
from
paddlehub.dataset.base_cv_dataset
import
ImageClassificationDataset
class
Indoor67Dataset
(
ImageClassificationDataset
):
def
__init__
(
self
):
super
(
Indoor67Dataset
,
self
).
__init__
()
dataset_path
=
os
.
path
.
join
(
hub
.
common
.
dir
.
DATA_HOME
,
"Indoor67"
)
self
.
base_path
=
self
.
_download_dataset
(
dataset_path
=
dataset_path
,
url
=
"https://paddlehub-dataset.bj.bcebos.com/Indoor67.tar.gz"
)
self
.
train_list_file
=
"train_list.txt"
self
.
test_list_file
=
"test_list.txt"
self
.
validate_list_file
=
"validate_list.txt"
self
.
label_list_file
=
"label_list.txt"
self
.
num_labels
=
67
paddlehub/dataset/stanford_dogs.py
0 → 100644
浏览文件 @
bf0e1b7f
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
import
paddlehub
as
hub
from
paddlehub.dataset.base_cv_dataset
import
ImageClassificationDataset
class
StanfordDogsDataset
(
ImageClassificationDataset
):
def
__init__
(
self
):
super
(
StanfordDogsDataset
,
self
).
__init__
()
dataset_path
=
os
.
path
.
join
(
hub
.
common
.
dir
.
DATA_HOME
,
"StanfordDogs-120"
)
self
.
base_path
=
self
.
_download_dataset
(
dataset_path
=
dataset_path
,
url
=
"https://paddlehub-dataset.bj.bcebos.com/StanfordDogs-120.tar.gz"
)
self
.
train_list_file
=
"train_list.txt"
self
.
test_list_file
=
"test_list.txt"
self
.
validate_list_file
=
"validate_list.txt"
self
.
label_list_file
=
"label_list.txt"
self
.
num_labels
=
120
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录