Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleHub
提交
f5146e72
P
PaddleHub
项目概览
PaddlePaddle
/
PaddleHub
1 年多 前同步成功
通知
283
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看板
提交
f5146e72
编写于
3月 28, 2019
作者:
W
wuzewu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update commands
上级
b25dfb58
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
28 addition
and
19 deletion
+28
-19
paddle_hub/commands/hub.py
paddle_hub/commands/hub.py
+5
-0
paddle_hub/commands/install.py
paddle_hub/commands/install.py
+4
-3
paddle_hub/commands/list.py
paddle_hub/commands/list.py
+2
-1
paddle_hub/commands/run.py
paddle_hub/commands/run.py
+1
-1
paddle_hub/commands/show.py
paddle_hub/commands/show.py
+5
-4
paddle_hub/commands/uninstall.py
paddle_hub/commands/uninstall.py
+4
-2
paddle_hub/commands/version.py
paddle_hub/commands/version.py
+2
-1
setup.py
setup.py
+5
-7
未找到文件。
paddle_hub/commands/hub.py
浏览文件 @
f5146e72
...
...
@@ -50,5 +50,10 @@ class HubCommand(BaseCommand):
command
=
HubCommand
.
instance
()
def
main
():
command
.
exec
(
sys
.
argv
[
1
:])
if
__name__
==
"__main__"
:
command
.
exec
(
sys
.
argv
[
1
:])
paddle_hub/commands/install.py
浏览文件 @
f5146e72
...
...
@@ -11,15 +11,16 @@
# 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
argparse
from
paddle_hub.tools.logger
import
logger
from
paddle_hub.commands.base_command
import
BaseCommand
,
ENTRY
from
paddle_hub.tools
import
utils
from
paddle_hub.module.manager
import
default_module_manager
import
argparse
class
InstallCommand
(
BaseCommand
):
...
...
@@ -28,7 +29,7 @@ class InstallCommand(BaseCommand):
def
__init__
(
self
,
name
):
super
(
InstallCommand
,
self
).
__init__
(
name
)
self
.
show_in_help
=
True
self
.
description
=
"Install the specif
y
module to current environment."
self
.
description
=
"Install the specif
ic
module to current environment."
self
.
parser
=
self
.
parser
=
argparse
.
ArgumentParser
(
description
=
self
.
__class__
.
__doc__
,
prog
=
'%s %s <module_name>'
%
(
ENTRY
,
name
),
...
...
paddle_hub/commands/list.py
浏览文件 @
f5146e72
...
...
@@ -15,6 +15,7 @@
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
from
paddle_hub.tools.logger
import
logger
from
paddle_hub.commands.base_command
import
BaseCommand
from
paddle_hub.tools
import
utils
...
...
@@ -28,7 +29,7 @@ class ListCommand(BaseCommand):
def
__init__
(
self
,
name
):
super
(
ListCommand
,
self
).
__init__
(
name
)
self
.
show_in_help
=
True
self
.
description
=
"List all module install in current environment."
self
.
description
=
"List all module
s
install in current environment."
def
exec
(
self
,
argv
):
all_modules
=
default_module_manager
.
all_modules
()
...
...
paddle_hub/commands/run.py
浏览文件 @
f5146e72
...
...
@@ -34,7 +34,7 @@ class RunCommand(BaseCommand):
def
__init__
(
self
,
name
):
super
(
RunCommand
,
self
).
__init__
(
name
)
self
.
show_in_help
=
True
self
.
description
=
"Run the specif
y module
"
self
.
description
=
"Run the specif
ic module.
"
self
.
parser
=
self
.
parser
=
argparse
.
ArgumentParser
(
description
=
self
.
__class__
.
__doc__
,
prog
=
'%s %s <module>'
%
(
ENTRY
,
name
),
...
...
paddle_hub/commands/show.py
浏览文件 @
f5146e72
...
...
@@ -15,12 +15,14 @@
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
import
argparse
from
paddle_hub.tools.logger
import
logger
from
paddle_hub.commands.base_command
import
BaseCommand
,
ENTRY
from
paddle_hub.module.manager
import
default_module_manager
from
paddle_hub.module.module
import
Module
import
os
import
argparse
class
ShowCommand
(
BaseCommand
):
...
...
@@ -29,7 +31,7 @@ class ShowCommand(BaseCommand):
def
__init__
(
self
,
name
):
super
(
ShowCommand
,
self
).
__init__
(
name
)
self
.
show_in_help
=
True
self
.
description
=
"Show the specify module's info"
self
.
description
=
"Show the specify module's info
.
"
self
.
parser
=
self
.
parser
=
argparse
.
ArgumentParser
(
description
=
self
.
__class__
.
__doc__
,
prog
=
'%s %s <module_name/module_dir>'
%
(
ENTRY
,
name
),
...
...
@@ -59,7 +61,6 @@ class ShowCommand(BaseCommand):
show_text
+=
"Author:%s
\n
"
%
module
.
author
show_text
+=
"Author-Email:%s
\n
"
%
module
.
author_email
show_text
+=
"Location:%s
\n
"
%
module_dir
#TODO(wuzewu): add more signature info
print
(
show_text
)
return
True
...
...
paddle_hub/commands/uninstall.py
浏览文件 @
f5146e72
...
...
@@ -15,11 +15,13 @@
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
argparse
from
paddle_hub.tools.logger
import
logger
from
paddle_hub.commands.base_command
import
BaseCommand
,
ENTRY
from
paddle_hub.tools
import
utils
from
paddle_hub.module.manager
import
default_module_manager
import
argparse
class
UninstallCommand
(
BaseCommand
):
...
...
@@ -28,7 +30,7 @@ class UninstallCommand(BaseCommand):
def
__init__
(
self
,
name
):
super
(
UninstallCommand
,
self
).
__init__
(
name
)
self
.
show_in_help
=
True
self
.
description
=
"Uninstall the specif
y
module from current environment."
self
.
description
=
"Uninstall the specif
ic
module from current environment."
self
.
parser
=
self
.
parser
=
argparse
.
ArgumentParser
(
description
=
self
.
__class__
.
__doc__
,
prog
=
'%s %s <module_name>'
%
(
ENTRY
,
name
),
...
...
paddle_hub/commands/version.py
浏览文件 @
f5146e72
...
...
@@ -15,6 +15,7 @@
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
from
paddle_hub.tools.logger
import
logger
from
paddle_hub.commands.base_command
import
BaseCommand
from
paddle_hub
import
version
...
...
@@ -26,7 +27,7 @@ class VersionCommand(BaseCommand):
def
__init__
(
self
,
name
):
super
(
VersionCommand
,
self
).
__init__
(
name
)
self
.
show_in_help
=
True
self
.
description
=
"Get the paddle hub version"
self
.
description
=
"Get the paddle hub version
.
"
def
exec
(
self
,
argv
):
print
(
"hub %s"
%
version
.
hub_version
)
...
...
setup.py
浏览文件 @
f5146e72
...
...
@@ -18,24 +18,22 @@ from __future__ import print_function
from
setuptools
import
find_packages
from
setuptools
import
setup
from
paddle_hub
import
__version__
from
paddle_hub
.version
import
hub_version
REQUIRED_PACKAGES
=
[
'numpy >= 1.12.0'
,
'six >= 1.10.0'
,
'protobuf >= 3.1.0'
,
'numpy >= 1.12.0'
,
'six >= 1.10.0'
,
'protobuf >= 3.1.0'
,
'pyyaml'
,
'numpy'
]
setup
(
name
=
'paddle_hub'
,
version
=
__version__
.
replace
(
'-'
,
''
),
version
=
hub_version
.
replace
(
'-'
,
''
),
description
=
(
'PaddleHub is a library to foster the publication, '
'discovery, and consumption of reusable parts of machine '
'learning models.'
),
long_description
=
''
,
url
=
'https://github.com/PaddlePaddle/PaddleHub'
,
author
=
'PaddlePaddle Author'
,
author_email
=
'
chenzeyu01
@baidu.com'
,
author_email
=
'
paddle-dev
@baidu.com'
,
install_requires
=
REQUIRED_PACKAGES
,
packages
=
find_packages
(),
# PyPI package information.
...
...
@@ -59,4 +57,4 @@ setup(
],
license
=
'Apache 2.0'
,
keywords
=
(
'paddlepaddle pretrained paddle-hub'
),
)
entry_points
=
{
'console_scripts'
:
[
'hub=paddle_hub.commands.hub:main'
]}
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录