未验证 提交 24727034 编写于 作者: T Tingquan Gao 提交者: GitHub

Update whl (#871)

* Update whl

* Optimize usage of CLI args
上级 27849b7a
include LICENSE.txt
include README.md
include docs/en/whl_en.md
recursive-include deploy/python predict_cls.py preprocess.py postprocess.py det_preprocess.py
recursive-include deploy/utils get_image_list.py config.py logger.py predictor.py
recursive-include tools/infer utils.py predict.py
recursive-include ppcls/utils logger.py
recursive-include ppcls/utils imagenet1k_label_list.txt
include ppcls/arch/backbone/__init__.py
recursive-include ppcls/arch/backbone/ *.py
\ No newline at end of file
......@@ -128,6 +128,12 @@ class CropImage(object):
def __call__(self, img):
w, h = self.size
img_h, img_w = img.shape[:2]
if img_h < h or img_w < w:
raise Exception(
f"The size({h}, {w}) of CropImage must be greater than size({img_h}, {img_w}) of image. Please check image original size and size of ResizeImage if used."
)
w_start = (img_w - w) // 2
h_start = (img_h - h) // 2
......
......@@ -170,7 +170,7 @@ def get_config(fname, overrides=None, show=True):
return config
def parse_args():
def parser():
parser = argparse.ArgumentParser("generic-image-rec train script")
parser.add_argument(
'-c',
......@@ -184,5 +184,14 @@ def parse_args():
action='append',
default=[],
help='config options to be overridden')
args = parser.parse_args()
parser.add_argument(
'-v',
'--verbose',
action='store_true',
help='wheather print the config info')
return parser
def parse_args():
args = parser().parse_args()
return args
此差异已折叠。
......@@ -12,6 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import inspect
from ppcls.arch.backbone.legendary_models.mobilenet_v1 import MobileNetV1_x0_25, MobileNetV1_x0_5, MobileNetV1_x0_75, MobileNetV1
from ppcls.arch.backbone.legendary_models.mobilenet_v3 import MobileNetV3_small_x0_35, MobileNetV3_small_x0_5, MobileNetV3_small_x0_75, MobileNetV3_small_x1_0, MobileNetV3_small_x1_25, MobileNetV3_large_x0_35, MobileNetV3_large_x0_5, MobileNetV3_large_x0_75, MobileNetV3_large_x1_0, MobileNetV3_large_x1_25
from ppcls.arch.backbone.legendary_models.resnet import ResNet18, ResNet18_vd, ResNet34, ResNet34_vd, ResNet50, ResNet50_vd, ResNet101, ResNet101_vd, ResNet152, ResNet152_vd, ResNet200_vd
......@@ -51,7 +54,22 @@ from ppcls.arch.backbone.model_zoo.rexnet import ReXNet_1_0, ReXNet_1_3, ReXNet_
from ppcls.arch.backbone.model_zoo.gvt import pcpvt_small, pcpvt_base, pcpvt_large, alt_gvt_small, alt_gvt_base, alt_gvt_large
from ppcls.arch.backbone.model_zoo.levit import LeViT_128S, LeViT_128, LeViT_192, LeViT_256, LeViT_384
from ppcls.arch.backbone.model_zoo.dla import DLA34, DLA46_c, DLA46x_c, DLA60, DLA60x, DLA60x_c, DLA102, DLA102x, DLA102x2, DLA169
from ppcls.arch.backbone.model_zoo.rednet import RedNet26, RedNet38, RedNet50, RedNet101, RedNet152
from ppcls.arch.backbone.model_zoo.rednet import RedNet26, RedNet38, RedNet50, RedNet101, RedNet152
from ppcls.arch.backbone.model_zoo.tnt import TNT_small
from ppcls.arch.backbone.model_zoo.hardnet import HarDNet68, HarDNet85, HarDNet39_ds, HarDNet68_ds
from ppcls.arch.backbone.variant_models.resnet_variant import ResNet50_last_stage_stride1
def get_apis():
current_func = sys._getframe().f_code.co_name
current_module = sys.modules[__name__]
api = []
for _, obj in inspect.getmembers(current_module,
inspect.isclass) + inspect.getmembers(
current_module, inspect.isfunction):
api.append(obj.__name__)
api.remove(current_func)
return api
__all__ = get_apis()
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 2021 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.
......@@ -11,14 +11,14 @@
# 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 setuptools import setup
from io import open
from setuptools import setup
with open('requirements.txt', encoding="utf-8-sig") as f:
requirements = f.readlines()
def readme():
with open('docs/en/whl_en.md', encoding="utf-8-sig") as f:
README = f.read()
......@@ -30,7 +30,9 @@ setup(
packages=['paddleclas'],
package_dir={'paddleclas': ''},
include_package_data=True,
entry_points={"console_scripts": ["paddleclas= paddleclas.paddleclas:main"]},
entry_points={
"console_scripts": ["paddleclas= paddleclas.paddleclas:main"]
},
version='0.0.0',
install_requires=requirements,
license='Apache License 2.0',
......@@ -40,10 +42,11 @@ setup(
url='https://github.com/PaddlePaddle/PaddleClas',
download_url='https://github.com/PaddlePaddle/PaddleClas.git',
keywords=[
'A treasure chest for image classification powered by PaddlePaddle.'
'A treasure chest for image classification powered by PaddlePaddle.'
],
classifiers=[
'Intended Audience :: Developers', 'Operating System :: OS Independent',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Natural Language :: Chinese (Simplified)',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册