From 569a9d39badf958968b330bb143af5b4de918d2e Mon Sep 17 00:00:00 2001 From: wuzewu Date: Thu, 30 Apr 2020 17:10:42 +0800 Subject: [PATCH] Update image classification module --- .../classification/efficientnetb0_small_imagenet/module.py | 4 ++-- .../efficientnetb0_small_imagenet/processor.py | 2 +- .../fix_resnext101_32x48d_wsl_imagenet/module.py | 6 +++--- .../fix_resnext101_32x48d_wsl_imagenet/processor.py | 2 +- .../classification/res2net101_vd_26w_4s_imagenet/module.py | 4 ++-- .../res2net101_vd_26w_4s_imagenet/processor.py | 2 +- .../image/classification/resnet18_vd_imagenet/module.py | 4 ++-- .../image/classification/resnet18_vd_imagenet/processor.py | 2 +- .../image/classification/se_resnet18_vd_imagenet/module.py | 4 ++-- .../classification/se_resnet18_vd_imagenet/processor.py | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hub_module/modules/image/classification/efficientnetb0_small_imagenet/module.py b/hub_module/modules/image/classification/efficientnetb0_small_imagenet/module.py index e95b8c45..22e98bb9 100644 --- a/hub_module/modules/image/classification/efficientnetb0_small_imagenet/module.py +++ b/hub_module/modules/image/classification/efficientnetb0_small_imagenet/module.py @@ -21,8 +21,8 @@ from efficientnetb0_small_imagenet.efficientnet import EfficientNetB0_small @moduleinfo( name="efficientnetb0_small_imagenet", type="CV/image_classification", - author="baidu-vis", - author_email="", + author="paddlepaddle", + author_email="paddle-dev@baidu.com", summary= "ResNet18vd is a image classfication model, this module is trained with imagenet datasets.", version="1.0.0") diff --git a/hub_module/modules/image/classification/efficientnetb0_small_imagenet/processor.py b/hub_module/modules/image/classification/efficientnetb0_small_imagenet/processor.py index 6dc49772..fa8cbb50 100644 --- a/hub_module/modules/image/classification/efficientnetb0_small_imagenet/processor.py +++ b/hub_module/modules/image/classification/efficientnetb0_small_imagenet/processor.py @@ -49,7 +49,7 @@ def postprocess(data_out, label_list, top_k): output_i = {} indexs = np.argsort(result_i)[::-1][0:top_k] for index in indexs: - label = label_list[index] + label = label_list[index].split(',')[0] output_i[label] = float(result_i[index]) output.append(output_i) return output diff --git a/hub_module/modules/image/classification/fix_resnext101_32x48d_wsl_imagenet/module.py b/hub_module/modules/image/classification/fix_resnext101_32x48d_wsl_imagenet/module.py index f424a5f1..3e02f465 100644 --- a/hub_module/modules/image/classification/fix_resnext101_32x48d_wsl_imagenet/module.py +++ b/hub_module/modules/image/classification/fix_resnext101_32x48d_wsl_imagenet/module.py @@ -21,15 +21,15 @@ from fix_resnext101_32x48d_wsl_imagenet.resnext101_wsl import Fix_ResNeXt101_32x @moduleinfo( name="fix_resnext101_32x48d_wsl_imagenet", type="CV/image_classification", - author="baidu-vis", - author_email="", + author="paddlepaddle", + author_email="paddle-dev@baidu.com", summary= "fix_resnext101_32x48d_wsl is a image classfication model, this module is trained with imagenet datasets.", version="1.0.0") class FixResnext10132x48dwslImagenet(hub.Module): def _initialize(self): self.default_pretrained_model_path = os.path.join( - self.directory, "fix_resnext101_32x48d_wsl_imagenet_model") + self.directory, "model") label_file = os.path.join(self.directory, "label_list.txt") with open(label_file, 'r', encoding='utf-8') as file: self.label_list = file.read().split("\n")[:-1] diff --git a/hub_module/modules/image/classification/fix_resnext101_32x48d_wsl_imagenet/processor.py b/hub_module/modules/image/classification/fix_resnext101_32x48d_wsl_imagenet/processor.py index 6dc49772..fa8cbb50 100644 --- a/hub_module/modules/image/classification/fix_resnext101_32x48d_wsl_imagenet/processor.py +++ b/hub_module/modules/image/classification/fix_resnext101_32x48d_wsl_imagenet/processor.py @@ -49,7 +49,7 @@ def postprocess(data_out, label_list, top_k): output_i = {} indexs = np.argsort(result_i)[::-1][0:top_k] for index in indexs: - label = label_list[index] + label = label_list[index].split(',')[0] output_i[label] = float(result_i[index]) output.append(output_i) return output diff --git a/hub_module/modules/image/classification/res2net101_vd_26w_4s_imagenet/module.py b/hub_module/modules/image/classification/res2net101_vd_26w_4s_imagenet/module.py index cf027872..3fc92236 100644 --- a/hub_module/modules/image/classification/res2net101_vd_26w_4s_imagenet/module.py +++ b/hub_module/modules/image/classification/res2net101_vd_26w_4s_imagenet/module.py @@ -21,8 +21,8 @@ from res2net101_vd_26w_4s_imagenet.res2net_vd import Res2Net101_vd_26w_4s @moduleinfo( name="res2net101_vd_26w_4s_imagenet", type="CV/image_classification", - author="baidu-vis", - author_email="", + author="paddlepaddle", + author_email="paddle-dev@baidu.com", summary= "res2net101_vd_26w_4s is a image classfication model, this module is trained with imagenet datasets.", version="1.0.0") diff --git a/hub_module/modules/image/classification/res2net101_vd_26w_4s_imagenet/processor.py b/hub_module/modules/image/classification/res2net101_vd_26w_4s_imagenet/processor.py index 6dc49772..fa8cbb50 100644 --- a/hub_module/modules/image/classification/res2net101_vd_26w_4s_imagenet/processor.py +++ b/hub_module/modules/image/classification/res2net101_vd_26w_4s_imagenet/processor.py @@ -49,7 +49,7 @@ def postprocess(data_out, label_list, top_k): output_i = {} indexs = np.argsort(result_i)[::-1][0:top_k] for index in indexs: - label = label_list[index] + label = label_list[index].split(',')[0] output_i[label] = float(result_i[index]) output.append(output_i) return output diff --git a/hub_module/modules/image/classification/resnet18_vd_imagenet/module.py b/hub_module/modules/image/classification/resnet18_vd_imagenet/module.py index 7fd4c960..e17ba59d 100644 --- a/hub_module/modules/image/classification/resnet18_vd_imagenet/module.py +++ b/hub_module/modules/image/classification/resnet18_vd_imagenet/module.py @@ -21,8 +21,8 @@ from resnet18_vd_imagenet.resnet_vd import ResNet18_vd @moduleinfo( name="resnet18_vd_imagenet", type="CV/image_classification", - author="baidu-vis", - author_email="", + author="paddlepaddle", + author_email="paddle-dev@baidu.com", summary= "ResNet18vd is a image classfication model, this module is trained with imagenet datasets.", version="1.0.0") diff --git a/hub_module/modules/image/classification/resnet18_vd_imagenet/processor.py b/hub_module/modules/image/classification/resnet18_vd_imagenet/processor.py index 6dc49772..fa8cbb50 100644 --- a/hub_module/modules/image/classification/resnet18_vd_imagenet/processor.py +++ b/hub_module/modules/image/classification/resnet18_vd_imagenet/processor.py @@ -49,7 +49,7 @@ def postprocess(data_out, label_list, top_k): output_i = {} indexs = np.argsort(result_i)[::-1][0:top_k] for index in indexs: - label = label_list[index] + label = label_list[index].split(',')[0] output_i[label] = float(result_i[index]) output.append(output_i) return output diff --git a/hub_module/modules/image/classification/se_resnet18_vd_imagenet/module.py b/hub_module/modules/image/classification/se_resnet18_vd_imagenet/module.py index 8fff1444..21162c4d 100644 --- a/hub_module/modules/image/classification/se_resnet18_vd_imagenet/module.py +++ b/hub_module/modules/image/classification/se_resnet18_vd_imagenet/module.py @@ -21,8 +21,8 @@ from se_resnet18_vd_imagenet.se_resnet import SE_ResNet18_vd @moduleinfo( name="se_resnet18_vd_imagenet", type="CV/image_classification", - author="baidu-vis", - author_email="", + author="paddlepaddle", + author_email="paddle-dev@baidu.com", summary= "SE_ResNet18_vd is a image classfication model, this module is trained with imagenet datasets.", version="1.0.0") diff --git a/hub_module/modules/image/classification/se_resnet18_vd_imagenet/processor.py b/hub_module/modules/image/classification/se_resnet18_vd_imagenet/processor.py index 6dc49772..fa8cbb50 100644 --- a/hub_module/modules/image/classification/se_resnet18_vd_imagenet/processor.py +++ b/hub_module/modules/image/classification/se_resnet18_vd_imagenet/processor.py @@ -49,7 +49,7 @@ def postprocess(data_out, label_list, top_k): output_i = {} indexs = np.argsort(result_i)[::-1][0:top_k] for index in indexs: - label = label_list[index] + label = label_list[index].split(',')[0] output_i[label] = float(result_i[index]) output.append(output_i) return output -- GitLab