未验证 提交 49e482ea 编写于 作者: D dyning 提交者: GitHub

Merge pull request #17 from WuHaobo/master

init English docs
......@@ -6,4 +6,4 @@ checkpoints/
output/
pretrained/
*.ipynb*
build/
_build/
ResNet18
ResNet34
ResNet50
ResNet101
ResNet152
ResNet50_vc
ResNet18_vd
ResNet34_vd
ResNet50_vd
ResNet50_vd_v2
ResNet101_vd
ResNet152_vd
ResNet200_vd
ResNet50_vd_ssld
MobileNetV3_large_x0_35
MobileNetV3_large_x0_5
MobileNetV3_large_x0_75
MobileNetV3_large_x1_0
MobileNetV3_large_x1_25
MobileNetV3_small_x0_35
MobileNetV3_small_x0_5
MobileNetV3_small_x0_75
MobileNetV3_small_x1_0
MobileNetV3_small_x1_25
MobileNetV3_large_x1_0_ssld
MobileNetV3_large_x1_0_ssld_int8
MobileNetV3_small_x1_0_ssld
MobileNetV2_x0_25
MobileNetV2_x0_5
MobileNetV2_x0_75
MobileNetV2
MobileNetV2_x1_5
MobileNetV2_x2_0
MobileNetV2_ssld
MobileNetV1_x0_25
MobileNetV1_x0_5
MobileNetV1_x0_75
MobileNetV1
MobileNetV1_ssld
ShuffleNetV2_x0_25
ShuffleNetV2_x0_33
ShuffleNetV2_x0_5
ShuffleNetV2
ShuffleNetV2_x1_5
ShuffleNetV2_x2_0
ShuffleNetV2_swish
ResNeXt50_32x4d
ResNeXt50_64x4d
ResNeXt101_32x4d
ResNeXt101_64x4d
ResNeXt152_32x4d
ResNeXt152_64x4d
ResNeXt50_vd_32x4d
ResNeXt50_vd_64x4d
ResNeXt101_vd_32x4d
ResNeXt101_vd_64x4d
ResNeXt152_vd_32x4d
ResNeXt152_vd_64x4d
SE_ResNet18_vd
SE_ResNet34_vd
SE_ResNet50_vd
SE_ResNeXt50_32x4d
SE_ResNeXt101_32x4d
SE_ResNeXt50_vd_32x4d
SENet154_vd
Res2Net50_26w_4s
Res2Net50_vd_26w_4s
Res2Net50_14w_8s
Res2Net101_vd_26w_4s
Res2Net200_vd_26w_4s
GoogLeNet
InceptionV4
Xception41
Xception41_deeplab
Xception65
Xception65_deeplab
Xception71
HRNet_W18_C
HRNet_W30_C
HRNet_W32_C
HRNet_W40_C
HRNet_W44_C
HRNet_W48_C
HRNet_W64_C
DPN68
DPN92
DPN98
DPN107
DPN131
DenseNet121
DenseNet161
DenseNet169
DenseNet201
DenseNet264
EfficientNetB0_small
EfficientNetB0
EfficientNetB1
EfficientNetB2
EfficientNetB3
EfficientNetB4
EfficientNetB5
EfficientNetB6
EfficientNetB7
ResNeXt101_32x8d_wsl
ResNeXt101_32x16d_wsl
ResNeXt101_32x32d_wsl
ResNeXt101_32x48d_wsl
Fix_ResNeXt101_32x48d_wsl
AlexNet
SqueezeNet1_0
SqueezeNet1_1
VGG11
VGG13
VGG16
VGG19
DarkNet53
ResNet50_ACNet_deploy
......@@ -6,7 +6,7 @@
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = build
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
......
distillation
================================
.. toctree::
:maxdepth: 3
distillation.md
image_augmentation
================================
.. toctree::
:maxdepth: 3
ImageAugment.md
advanced_tutorials
================================
.. toctree::
:maxdepth: 1
image_augmentation/index
distillation/index
application
================================
.. toctree::
:maxdepth: 2
transfer_learning.md
object_detection.md
# Release Notes
* 2020.04.14: first commit
......@@ -11,12 +11,9 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
import recommonmark
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))
exclude_patterns = ['tmp', 'build', 'tools', 'README.md']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Project information -----------------------------------------------------
......@@ -56,7 +53,7 @@ master_doc = 'index'
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'zh'
language = 'en'
# -- Options for HTML output -------------------------------------------------
......@@ -79,5 +76,4 @@ if not on_rtd: # only import and set the theme if we're building docs locally
html_static_path = ['_static']
#html_logo = './images/logo.png'
html_logo = '../images/logo.png'
Welcome to PaddleClas!
================================
.. toctree::
:maxdepth: 1
:numbered:
:caption: Contents:
tutorials/index
models/index
advanced_tutorials/index
application/index
extension/index
competition_support.md
model_zoo.md
change_log.md
faq.md
:math:`PaddlePaddle2020`
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd
models
================================
.. toctree::
:maxdepth: 1
models_intro.md
Tricks.md
ResNet_and_vd.md
Mobile.md
SEResNext_and_Res2Net.md
Inception.md
HRNet.md
DPN_DenseNet.md
EfficientNet_and_ResNeXt101_wsl.md
Others.md
tutorials
================================
.. toctree::
:maxdepth: 1
install.md
getting_started.md
config.md
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# 更新日志
* 2020.04.10: 第一次提交
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import recommonmark
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Project information -----------------------------------------------------
project = 'PaddleClas'
copyright = '2020, paddlepaddle'
author = 'paddlepaddle'
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.mathjax',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
'recommonmark',
'sphinx_markdown_tables',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# md file can also be parased
source_suffix = ['.rst', '.md']
# The master toctree document.
master_doc = 'index'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'zh_CN'
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# otherwise, readthedocs.org uses their theme by default, so no need to specify it
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_logo = '../images/logo.png'
......@@ -4,7 +4,6 @@
.. toctree::
:maxdepth: 1
code_overview.md
paddle_inference.md
paddle_mobile_inference.md
paddle_quantization.md
......
# 模型量化
模型量化是 [PaddleSlim](https://github.com/PaddlePaddle/PaddleSlim) 的特色功能之一,支持动态和静态两种量化训练方式,对权重全局量化和 Channel-Wise 量化,同时以兼容 Paddle Mobile 的格式保存模型。
模型量化是 [PaddleSlim](https://github.com/PaddlePaddle/PaddleSlim) 的特色功能之一,支持动态和静态两种量化训练方式,对权重全局量化和 Channel-Wise 量化,同时以兼容 Paddle-Lite 的格式保存模型。
[PaddleClas](https://github.com/PaddlePaddle/PaddleClas) 使用该量化工具,量化了78.9%的mobilenet_v3_large_x1_0的蒸馏模型, 量化后SD855上预测速度从19.308ms加速到14.395ms,存储大小从21M减小到10M, top1识别准确率75.9%。
具体的训练方法可以参见 [PaddleSlim 量化训练](https://paddlepaddle.github.io/PaddleSlim/quick_start/quant_aware_tutorial.html)
# FAQ
## 评估
\ No newline at end of file
......@@ -4,14 +4,14 @@
.. toctree::
:maxdepth: 1
zh_cn/tutorials/index
zh_cn/models/index
zh_cn/advanced_tutorials/index
zh_cn/application/index
zh_cn/extension/index
zh_cn/competition_support.md
zh_cn/model_zoo.md
zh_cn/change_log.md
zh_cn/faq.md
tutorials/index
models/index
advanced_tutorials/index
application/index
extension/index
competition_support.md
model_zoo.md
change_log.md
faq.md
:math:`PaddlePaddle2020`
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd
......@@ -17,4 +17,4 @@ from . import loss
from .architectures import *
from .loss import *
from .utils import similar_architectures
from .utils import *
......@@ -12,8 +12,8 @@
#See the License for the specific language governing permissions and
#limitations under the License.
import types
import architectures
import types
from difflib import SequenceMatcher
......@@ -28,12 +28,11 @@ def get_architectures():
return names
def similar_architectures(name='', thresh=0.1, topk=10):
def similar_architectures(name='', names=[], thresh=0.1, topk=10):
"""
inferred similar architectures
"""
scores = []
names = get_architectures()
for idx, n in enumerate(names):
if n[:2] == '__': continue
score = SequenceMatcher(None, n.lower(), name.lower()).quick_ratio()
......
......@@ -20,6 +20,7 @@ import sys
import paddle.fluid as fluid
from ppcls.modeling import get_architectures
from ppcls.modeling import similar_architectures
from ppcls.utils import logger
......@@ -60,7 +61,7 @@ def check_architecture(architecture):
"""
assert isinstance(architecture, str), \
("the type of architecture({}) should be str". format(architecture))
similar_names = similar_architectures(architecture)
similar_names = similar_architectures(architecture, get_architectures())
model_list = ', '.join(similar_names)
err = "{} is not exist! Maybe you want: [{}]" \
"".format(architecture, model_list)
......
......@@ -17,12 +17,13 @@ from __future__ import division
from __future__ import print_function
import os
import shutil
import requests
import tqdm
import shutil
import tarfile
import tqdm
import zipfile
from ppcls.modeling import similar_architectures
from ppcls.utils.check import check_architecture
from ppcls.utils import logger
......@@ -44,11 +45,7 @@ class ModelNameError(Exception):
""" ModelNameError
"""
def __init__(self, message='', architecture=''):
similar_names = similar_architectures(architecture)
model_list = ', '.join(similar_names)
message += '\n{} is not exist. \nMaybe you want: [{}]'.format(
architecture, model_list)
def __init__(self, message=''):
super(ModelNameError, self).__init__(message)
......@@ -171,8 +168,24 @@ def _decompress(fname):
os.remove(fname)
def _check_pretrained_name(architecture):
assert isinstance(architecture, str), \
("the type of architecture({}) should be str". format(architecture))
with open('./configs/pretrained.list') as flist:
pretrained = [line.strip() for line in flist]
similar_names = similar_architectures(architecture, pretrained)
model_list = ', '.join(similar_names)
err = "{} is not exist! Maybe you want: [{}]" \
"".format(architecture, model_list)
if architecture not in similar_names:
raise ModelNameError(err)
def get(architecture, path, decompress=True):
check_architecture(architecture)
"""
Get the pretrained model.
"""
_check_pretrained_name(architecture)
url = _get_url(architecture)
fname = _download(url, path)
if decompress: _decompress(fname)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册