From 23575238efb29550a28fecd2caf75dce3876610d Mon Sep 17 00:00:00 2001 From: wuzewu Date: Wed, 29 Apr 2020 14:27:02 +0800 Subject: [PATCH] Fix docs --- .../faster_rcnn_resnet50_coco2017/README.md | 10 +++------- .../faster_rcnn_resnet50_fpn_coco2017/README.md | 10 +++------- .../retinanet_resnet50_fpn_coco2017/README.md | 10 +++------- .../ssd_mobilenet_v1_pascal/README.md | 10 +++------- .../ssd_vgg16_300_coco2017/README.md | 10 +++------- .../ssd_vgg16_512_coco2017/README.md | 10 +++------- .../yolov3_darknet53_coco2017/README.md | 12 ++++-------- .../yolov3_darknet53_coco2017/module.py | 6 ++++-- .../yolov3_darknet53_coco2017/yolo_head.py | 2 +- .../yolov3_darknet53_pedestrian/README.md | 12 ++++-------- .../yolov3_darknet53_pedestrian/module.py | 6 ++++-- .../yolov3_darknet53_pedestrian/yolo_head.py | 2 +- .../yolov3_darknet53_vehicles/README.md | 12 ++++-------- .../yolov3_darknet53_vehicles/module.py | 6 ++++-- .../yolov3_darknet53_vehicles/yolo_head.py | 2 +- .../yolov3_mobilenet_v1_coco2017/README.md | 12 ++++-------- .../yolov3_mobilenet_v1_coco2017/module.py | 6 ++++-- .../yolov3_mobilenet_v1_coco2017/yolo_head.py | 2 +- .../yolov3_resnet34_coco2017/README.md | 12 ++++-------- .../yolov3_resnet34_coco2017/module.py | 6 ++++-- .../yolov3_resnet34_coco2017/yolo_head.py | 2 +- 21 files changed, 63 insertions(+), 97 deletions(-) diff --git a/hub_module/modules/image/object_detection/faster_rcnn_resnet50_coco2017/README.md b/hub_module/modules/image/object_detection/faster_rcnn_resnet50_coco2017/README.md index c23e28db..c58b12d8 100644 --- a/hub_module/modules/image/object_detection/faster_rcnn_resnet50_coco2017/README.md +++ b/hub_module/modules/image/object_detection/faster_rcnn_resnet50_coco2017/README.md @@ -1,11 +1,7 @@ -```shell -$ hub install faster_rcnn_resnet50_coco2017==1.1.0 -``` - ## 命令行预测 ``` -hub run faster_rcnn_resnet50_coco2017 --input_path "/PATH/TO/IMAGE" +$ hub run faster_rcnn_resnet50_coco2017 --input_path "/PATH/TO/IMAGE" ``` ## API @@ -22,7 +18,7 @@ def context(num_classes=81, **参数** * num\_classes (int): 类别数; -* trainable(bool): 将参数的trainable 属性设为trainable; +* trainable(bool): 参数是否可训练; * pretrained (bool): 是否加载预训练模型; * phase (str): 可选值为 'train'/'predict','trian' 用于训练,'predict' 用于预测。 @@ -35,7 +31,7 @@ def context(num_classes=81, * im\_info (Variable): 图像缩放信息 * gt\_class (Variable): 检测框类别 * gt\_box (Variable): 检测框坐标 - * is\_crowd (Variable): + * is\_crowd (Variable): 单个框内是否包含多个物体 当 phase 为 'predict'时,包含: * image (Variable): 图像变量 * im\_size (Variable): 图像的尺寸 diff --git a/hub_module/modules/image/object_detection/faster_rcnn_resnet50_fpn_coco2017/README.md b/hub_module/modules/image/object_detection/faster_rcnn_resnet50_fpn_coco2017/README.md index c7864ae9..b9c23220 100644 --- a/hub_module/modules/image/object_detection/faster_rcnn_resnet50_fpn_coco2017/README.md +++ b/hub_module/modules/image/object_detection/faster_rcnn_resnet50_fpn_coco2017/README.md @@ -1,11 +1,7 @@ -```shell -$ hub install faster_rcnn_resnet50_fpn_coco2017==1.0.0 -``` - ## 命令行预测 ``` -hub run faster_rcnn_resnet50_fpn_coco2017 --input_path "/PATH/TO/IMAGE" +$ hub run faster_rcnn_resnet50_fpn_coco2017 --input_path "/PATH/TO/IMAGE" ``` ## API @@ -22,7 +18,7 @@ def context(num_classes=81, **参数** * num\_classes (int): 类别数; -* trainable(bool): 将参数的trainable 属性设为trainable; +* trainable(bool): 参数是否可训练; * pretrained (bool): 是否加载预训练模型; * phase (str): 可选值为 'train'/'predict','trian' 用于训练,'predict' 用于预测。 @@ -35,7 +31,7 @@ def context(num_classes=81, * im\_info (Variable): 图像缩放信息 * gt\_class (Variable): 检测框类别 * gt\_box (Variable): 检测框坐标 - * is\_crowd (Variable): + * is\_crowd (Variable): 单个框内是否包含多个物体 当 phase 为 'predict'时,包含: * image (Variable): 图像变量 * im\_size (Variable): 图像的尺寸 diff --git a/hub_module/modules/image/object_detection/retinanet_resnet50_fpn_coco2017/README.md b/hub_module/modules/image/object_detection/retinanet_resnet50_fpn_coco2017/README.md index e5d35d0f..95b9a1dd 100644 --- a/hub_module/modules/image/object_detection/retinanet_resnet50_fpn_coco2017/README.md +++ b/hub_module/modules/image/object_detection/retinanet_resnet50_fpn_coco2017/README.md @@ -1,11 +1,7 @@ -```shell -$ hub install retinanet_resnet50_fpn_coco2017==1.0.0 -``` - ## 命令行预测 ``` -hub run retinanet_resnet50_fpn_coco2017 --input_path "/PATH/TO/IMAGE" +$ hub run retinanet_resnet50_fpn_coco2017 --input_path "/PATH/TO/IMAGE" ``` ## API @@ -16,11 +12,11 @@ def context(trainable=True, get_prediction=False) ``` -特征提取,用于迁移学习。 +提取特征,用于迁移学习。 **参数** -* trainable(bool): 将参数的trainable属性设为trainable; +* trainable(bool): 参数是否可训练; * pretrained (bool): 是否加载预训练模型; * get\_prediction (bool): 是否执行预测。 diff --git a/hub_module/modules/image/object_detection/ssd_mobilenet_v1_pascal/README.md b/hub_module/modules/image/object_detection/ssd_mobilenet_v1_pascal/README.md index af28e38f..87c1651a 100644 --- a/hub_module/modules/image/object_detection/ssd_mobilenet_v1_pascal/README.md +++ b/hub_module/modules/image/object_detection/ssd_mobilenet_v1_pascal/README.md @@ -1,11 +1,7 @@ -```shell -$ hub install ssd_mobilenet_v1_pascal==1.1.0 -``` - ## 命令行预测 ``` -hub run ssd_mobilenet_v1_pascal --input_path "/PATH/TO/IMAGE" +$ hub run ssd_mobilenet_v1_pascal --input_path "/PATH/TO/IMAGE" ``` ## API @@ -16,11 +12,11 @@ def context(trainable=True, get_prediction=False) ``` -特征提取,用于迁移学习。 +提取特征,用于迁移学习。 **参数** -* trainable(bool): 设置参数的 trainable 属性; +* trainable(bool): 参数是否可训练; * pretrained (bool): 是否加载预训练模型; * get\_prediction (bool): 是否执行预测。 diff --git a/hub_module/modules/image/object_detection/ssd_vgg16_300_coco2017/README.md b/hub_module/modules/image/object_detection/ssd_vgg16_300_coco2017/README.md index dcc1582c..56b9492b 100644 --- a/hub_module/modules/image/object_detection/ssd_vgg16_300_coco2017/README.md +++ b/hub_module/modules/image/object_detection/ssd_vgg16_300_coco2017/README.md @@ -1,11 +1,7 @@ -```shell -$ hub install ssd_vgg16_300_coco2017==1.0.0 -``` - ## 命令行预测 ``` -hub run ssd_vgg16_300_coco2017 --input_path "/PATH/TO/IMAGE" +$ hub run ssd_vgg16_300_coco2017 --input_path "/PATH/TO/IMAGE" ``` ## API @@ -16,11 +12,11 @@ def context(trainable=True, get_prediction=False) ``` -特征提取,用于迁移学习。 +提取特征,用于迁移学习。 **参数** -* trainable(bool): 设置参数的 trainable 属性; +* trainable(bool): 参数是否可训练; * pretrained (bool): 是否加载预训练模型; * get\_prediction (bool): 是否执行预测。 diff --git a/hub_module/modules/image/object_detection/ssd_vgg16_512_coco2017/README.md b/hub_module/modules/image/object_detection/ssd_vgg16_512_coco2017/README.md index 0fe85604..f7fc4bdf 100644 --- a/hub_module/modules/image/object_detection/ssd_vgg16_512_coco2017/README.md +++ b/hub_module/modules/image/object_detection/ssd_vgg16_512_coco2017/README.md @@ -1,11 +1,7 @@ -```shell -$ hub install ssd_vgg16_512_coco2017==1.0.0 -``` - ## 命令行预测 ``` -hub run ssd_vgg16_512_coco2017 --input_path "/PATH/TO/IMAGE" +$ hub run ssd_vgg16_512_coco2017 --input_path "/PATH/TO/IMAGE" ``` ## API @@ -16,11 +12,11 @@ def context(trainable=True, get_prediction=False) ``` -特征提取,用于迁移学习。 +提取特征,用于迁移学习。 **参数** -* trainable(bool): 设置参数的 trainable 属性; +* trainable(bool): 参数是否可训练; * pretrained (bool): 是否加载预训练模型; * get\_prediction (bool): 是否执行预测。 diff --git a/hub_module/modules/image/object_detection/yolov3_darknet53_coco2017/README.md b/hub_module/modules/image/object_detection/yolov3_darknet53_coco2017/README.md index 06a1c6ee..b47b4400 100644 --- a/hub_module/modules/image/object_detection/yolov3_darknet53_coco2017/README.md +++ b/hub_module/modules/image/object_detection/yolov3_darknet53_coco2017/README.md @@ -1,11 +1,7 @@ -```shell -$ hub install yolov3_darknet53_coco2017==1.1.0 -``` - ## 命令行预测 ``` -hub run yolov3_darknet53_coco2017 --input_path "/PATH/TO/IMAGE" +$ hub run yolov3_darknet53_coco2017 --input_path "/PATH/TO/IMAGE" ``` ## API @@ -16,11 +12,11 @@ def context(trainable=True, get_prediction=False) ``` -特征提取,用于迁移学习。 +提取特征,用于迁移学习。 **参数** -* trainable(bool): 将参数的trainable属性设为trainable; +* trainable(bool): 参数是否可训练; * pretrained (bool): 是否加载预训练模型; * get\_prediction (bool): 是否执行预测。 @@ -29,7 +25,7 @@ def context(trainable=True, * inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为: * image (Variable): 图像变量 * im\_size (Variable): 图片的尺寸 -* outputs (dict): 模型的输出。如果 get\_prediction 为 False,输出 'head\_fatures',否则输出 'bbox\_out'。 +* outputs (dict): 模型的输出。如果 get\_prediction 为 False,输出 'head\_features'、'body\_features',否则输出 'bbox\_out'。 * context\_prog (Program): 用于迁移学习的 Program. ```python diff --git a/hub_module/modules/image/object_detection/yolov3_darknet53_coco2017/module.py b/hub_module/modules/image/object_detection/yolov3_darknet53_coco2017/module.py index 030f8a76..d8f620f8 100644 --- a/hub_module/modules/image/object_detection/yolov3_darknet53_coco2017/module.py +++ b/hub_module/modules/image/object_detection/yolov3_darknet53_coco2017/module.py @@ -88,7 +88,7 @@ class YOLOv3DarkNet53Coco2017(hub.Module): # yolo_head yolo_head = YOLOv3Head(num_classes=80) # head_features - head_features = yolo_head._get_outputs( + head_features, body_features = yolo_head._get_outputs( body_feats, is_train=trainable) place = fluid.CPUPlace() @@ -109,7 +109,9 @@ class YOLOv3DarkNet53Coco2017(hub.Module): else: outputs = { 'head_features': - [var_prefix + var.name for var in head_features] + [var_prefix + var.name for var in head_features], + 'body_features': + [var_prefix + var.name for var in body_features] } # add_vars_prefix add_vars_prefix(context_prog, var_prefix) diff --git a/hub_module/modules/image/object_detection/yolov3_darknet53_coco2017/yolo_head.py b/hub_module/modules/image/object_detection/yolov3_darknet53_coco2017/yolo_head.py index da2b3e1c..7428fb4c 100644 --- a/hub_module/modules/image/object_detection/yolov3_darknet53_coco2017/yolo_head.py +++ b/hub_module/modules/image/object_detection/yolov3_darknet53_coco2017/yolo_head.py @@ -227,7 +227,7 @@ class YOLOv3Head(object): # upsample route = self._upsample(route) - return outputs + return outputs, blocks def get_prediction(self, outputs, im_size): """ diff --git a/hub_module/modules/image/object_detection/yolov3_darknet53_pedestrian/README.md b/hub_module/modules/image/object_detection/yolov3_darknet53_pedestrian/README.md index 5a0afbba..e484af5d 100644 --- a/hub_module/modules/image/object_detection/yolov3_darknet53_pedestrian/README.md +++ b/hub_module/modules/image/object_detection/yolov3_darknet53_pedestrian/README.md @@ -1,11 +1,7 @@ -```shell -$ hub install yolov3_darknet53_pedestrian==1.0.0 -``` - ## 命令行预测 ``` -hub run yolov3_darknet53_pedestrian --input_path "/PATH/TO/IMAGE" +$ hub run yolov3_darknet53_pedestrian --input_path "/PATH/TO/IMAGE" ``` ## API @@ -16,11 +12,11 @@ def context(trainable=True, get_prediction=False) ``` -特征提取,用于迁移学习。 +提取特征,用于迁移学习。 **参数** -* trainable(bool): 将参数的trainable属性设为trainable; +* trainable(bool): 参数是否可训练; * pretrained (bool): 是否加载预训练模型; * get\_prediction (bool): 是否执行预测。 @@ -29,7 +25,7 @@ def context(trainable=True, * inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为: * image (Variable): 图像变量 * im\_size (Variable): 图片的尺寸 -* outputs (dict): 模型的输出。如果 get\_prediction 为 False,输出 'head\_fatures',否则输出 'bbox\_out'。 +* outputs (dict): 模型的输出。如果 get\_prediction 为 False,输出 'head\_features'、'body\_features',否则输出 'bbox\_out'。 * context\_prog (Program): 用于迁移学习的 Program. ```python diff --git a/hub_module/modules/image/object_detection/yolov3_darknet53_pedestrian/module.py b/hub_module/modules/image/object_detection/yolov3_darknet53_pedestrian/module.py index 417dadeb..170debee 100644 --- a/hub_module/modules/image/object_detection/yolov3_darknet53_pedestrian/module.py +++ b/hub_module/modules/image/object_detection/yolov3_darknet53_pedestrian/module.py @@ -102,7 +102,7 @@ class YOLOv3DarkNet53Pedestrian(hub.Module): normalized=False, score_threshold=0.01)) # head_features - head_features = yolo_head._get_outputs( + head_features, body_features = yolo_head._get_outputs( body_feats, is_train=trainable) place = fluid.CPUPlace() @@ -123,7 +123,9 @@ class YOLOv3DarkNet53Pedestrian(hub.Module): else: outputs = { 'head_features': - [var_prefix + var.name for var in head_features] + [var_prefix + var.name for var in head_features], + 'body_features': + [var_prefix + var.name for var in body_features] } # add_vars_prefix add_vars_prefix(context_prog, var_prefix) diff --git a/hub_module/modules/image/object_detection/yolov3_darknet53_pedestrian/yolo_head.py b/hub_module/modules/image/object_detection/yolov3_darknet53_pedestrian/yolo_head.py index da2b3e1c..7428fb4c 100644 --- a/hub_module/modules/image/object_detection/yolov3_darknet53_pedestrian/yolo_head.py +++ b/hub_module/modules/image/object_detection/yolov3_darknet53_pedestrian/yolo_head.py @@ -227,7 +227,7 @@ class YOLOv3Head(object): # upsample route = self._upsample(route) - return outputs + return outputs, blocks def get_prediction(self, outputs, im_size): """ diff --git a/hub_module/modules/image/object_detection/yolov3_darknet53_vehicles/README.md b/hub_module/modules/image/object_detection/yolov3_darknet53_vehicles/README.md index 42dee4c1..adc1dff0 100644 --- a/hub_module/modules/image/object_detection/yolov3_darknet53_vehicles/README.md +++ b/hub_module/modules/image/object_detection/yolov3_darknet53_vehicles/README.md @@ -1,11 +1,7 @@ -```shell -$ hub install yolov3_darknet53_vehicles==1.0.0 -``` - ## 命令行预测 ``` -hub run yolov3_darknet53_vehicles --input_path "/PATH/TO/IMAGE" +$ hub run yolov3_darknet53_vehicles --input_path "/PATH/TO/IMAGE" ``` ## API @@ -16,11 +12,11 @@ def context(trainable=True, get_prediction=False) ``` -特征提取,用于迁移学习。 +提取特征,用于迁移学习。 **参数** -* trainable(bool): 将参数的trainable属性设为trainable; +* trainable(bool): 参数是否可训练; * pretrained (bool): 是否加载预训练模型; * get\_prediction (bool): 是否执行预测。 @@ -29,7 +25,7 @@ def context(trainable=True, * inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为: * image (Variable): 图像变量 * im\_size (Variable): 图片的尺寸 -* outputs (dict): 模型的输出。如果 get\_prediction 为 False,输出 'head\_fatures',否则输出 'bbox\_out'。 +* outputs (dict): 模型的输出。如果 get\_prediction 为 False,输出 'head\_features'、'body\_features',否则输出 'bbox\_out'。 * context\_prog (Program): 用于迁移学习的 Program. ```python diff --git a/hub_module/modules/image/object_detection/yolov3_darknet53_vehicles/module.py b/hub_module/modules/image/object_detection/yolov3_darknet53_vehicles/module.py index 7b2b0405..92a85535 100644 --- a/hub_module/modules/image/object_detection/yolov3_darknet53_vehicles/module.py +++ b/hub_module/modules/image/object_detection/yolov3_darknet53_vehicles/module.py @@ -102,7 +102,7 @@ class YOLOv3DarkNet53Vehicles(hub.Module): normalized=False, score_threshold=0.005)) # head_features - head_features = yolo_head._get_outputs( + head_features, body_features = yolo_head._get_outputs( body_feats, is_train=trainable) place = fluid.CPUPlace() @@ -123,7 +123,9 @@ class YOLOv3DarkNet53Vehicles(hub.Module): else: outputs = { 'head_features': - [var_prefix + var.name for var in head_features] + [var_prefix + var.name for var in head_features], + 'body_features': + [var_prefix + var.name for var in body_features] } # add_vars_prefix add_vars_prefix(context_prog, var_prefix) diff --git a/hub_module/modules/image/object_detection/yolov3_darknet53_vehicles/yolo_head.py b/hub_module/modules/image/object_detection/yolov3_darknet53_vehicles/yolo_head.py index da2b3e1c..7428fb4c 100644 --- a/hub_module/modules/image/object_detection/yolov3_darknet53_vehicles/yolo_head.py +++ b/hub_module/modules/image/object_detection/yolov3_darknet53_vehicles/yolo_head.py @@ -227,7 +227,7 @@ class YOLOv3Head(object): # upsample route = self._upsample(route) - return outputs + return outputs, blocks def get_prediction(self, outputs, im_size): """ diff --git a/hub_module/modules/image/object_detection/yolov3_mobilenet_v1_coco2017/README.md b/hub_module/modules/image/object_detection/yolov3_mobilenet_v1_coco2017/README.md index 550e7a05..9aa677fd 100644 --- a/hub_module/modules/image/object_detection/yolov3_mobilenet_v1_coco2017/README.md +++ b/hub_module/modules/image/object_detection/yolov3_mobilenet_v1_coco2017/README.md @@ -1,11 +1,7 @@ -```shell -hub install yolov3_mobilenet_v1_coco2017==1.1.0 -``` - ## 命令行预测 ``` -hub run yolov3_mobilenet_v1_coco2017 --input_path "/PATH/TO/IMAGE" +$ hub run yolov3_mobilenet_v1_coco2017 --input_path "/PATH/TO/IMAGE" ``` ## API @@ -16,11 +12,11 @@ def context(trainable=True, get_prediction=False) ``` -特征提取,用于迁移学习。 +提取特征,用于迁移学习。 **参数** -* trainable(bool): 将参数的 trainable 属性设为 trainable; +* trainable(bool): 参数是否可训练; * pretrained (bool): 是否加载预训练模型; * get\_prediction (bool): 是否执行预测。 @@ -29,7 +25,7 @@ def context(trainable=True, * inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为: * image (Variable): 图像变量; * im\_size (Variable): 图片的尺寸 -* outputs (dict): 模型的输出。如果 get\_prediction 为 False,输出 'head\_fatures',否则输出 'bbox\_out'。 +* outputs (dict): 模型的输出。如果 get\_prediction 为 False,输出 'head\_features'、'body\_features',否则输出 'bbox\_out'。 * context\_prog (Program): 用于迁移学习的 Program. ```python diff --git a/hub_module/modules/image/object_detection/yolov3_mobilenet_v1_coco2017/module.py b/hub_module/modules/image/object_detection/yolov3_mobilenet_v1_coco2017/module.py index 6860ad6a..bf096f8c 100644 --- a/hub_module/modules/image/object_detection/yolov3_mobilenet_v1_coco2017/module.py +++ b/hub_module/modules/image/object_detection/yolov3_mobilenet_v1_coco2017/module.py @@ -92,7 +92,7 @@ class YOLOv3MobileNetV1Coco2017(hub.Module): # yolo_head yolo_head = YOLOv3Head(num_classes=80) # head_features - head_features = yolo_head._get_outputs( + head_features, body_features = yolo_head._get_outputs( body_feats, is_train=trainable) place = fluid.CPUPlace() @@ -113,7 +113,9 @@ class YOLOv3MobileNetV1Coco2017(hub.Module): else: outputs = { 'head_features': - [var_prefix + var.name for var in head_features] + [var_prefix + var.name for var in head_features], + 'body_features': + [var_prefix + var.name for var in body_features] } # add_vars_prefix add_vars_prefix(context_prog, var_prefix) diff --git a/hub_module/modules/image/object_detection/yolov3_mobilenet_v1_coco2017/yolo_head.py b/hub_module/modules/image/object_detection/yolov3_mobilenet_v1_coco2017/yolo_head.py index da2b3e1c..7428fb4c 100644 --- a/hub_module/modules/image/object_detection/yolov3_mobilenet_v1_coco2017/yolo_head.py +++ b/hub_module/modules/image/object_detection/yolov3_mobilenet_v1_coco2017/yolo_head.py @@ -227,7 +227,7 @@ class YOLOv3Head(object): # upsample route = self._upsample(route) - return outputs + return outputs, blocks def get_prediction(self, outputs, im_size): """ diff --git a/hub_module/modules/image/object_detection/yolov3_resnet34_coco2017/README.md b/hub_module/modules/image/object_detection/yolov3_resnet34_coco2017/README.md index 0b181ead..e4b99170 100644 --- a/hub_module/modules/image/object_detection/yolov3_resnet34_coco2017/README.md +++ b/hub_module/modules/image/object_detection/yolov3_resnet34_coco2017/README.md @@ -1,11 +1,7 @@ -```shell -$ hub install yolov3_resnet34_coco2017==1.1.0 -``` - ## 命令行预测 ``` -hub run yolov3_resnet34_coco2017 --input_path "/PATH/TO/IMAGE" +$ hub run yolov3_resnet34_coco2017 --input_path "/PATH/TO/IMAGE" ``` ## API @@ -16,11 +12,11 @@ def context(trainable=True, get_prediction=False) ``` -提取头部特征,用于迁移学习。 +提取特征,用于迁移学习。 **参数** -* trainable(bool): 将参数的trainable属性设为trainable; +* trainable(bool): 参数是否可训练; * pretrained (bool): 是否加载预训练模型; * get\_prediction (bool): 是否执行预测。 @@ -29,7 +25,7 @@ def context(trainable=True, * inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为: * image (Variable): 图像变量 * im\_size (Variable): 图片的尺寸 -* outputs (dict): 模型的输出。如果 get\_prediction 为 False,输出 'head\_fatures',否则输出 'bbox\_out'。 +* outputs (dict): 模型的输出。如果 get\_prediction 为 False,输出 'head\_features'、'body\_features',否则输出 'bbox\_out'。 * context\_prog (Program): 用于迁移学习的 Program. ```python diff --git a/hub_module/modules/image/object_detection/yolov3_resnet34_coco2017/module.py b/hub_module/modules/image/object_detection/yolov3_resnet34_coco2017/module.py index fd70b918..48dc5b2a 100644 --- a/hub_module/modules/image/object_detection/yolov3_resnet34_coco2017/module.py +++ b/hub_module/modules/image/object_detection/yolov3_resnet34_coco2017/module.py @@ -94,7 +94,7 @@ class YOLOv3DarkNet53Coco2017(hub.Module): # yolo_head yolo_head = YOLOv3Head(num_classes=80) # head_features - head_features = yolo_head._get_outputs( + head_features, body_features = yolo_head._get_outputs( body_feats, is_train=trainable) place = fluid.CPUPlace() @@ -115,7 +115,9 @@ class YOLOv3DarkNet53Coco2017(hub.Module): else: outputs = { 'head_features': - [var_prefix + var.name for var in head_features] + [var_prefix + var.name for var in head_features], + 'body_features': + [var_prefix + var.name for var in body_features] } # add_vars_prefix add_vars_prefix(context_prog, var_prefix) diff --git a/hub_module/modules/image/object_detection/yolov3_resnet34_coco2017/yolo_head.py b/hub_module/modules/image/object_detection/yolov3_resnet34_coco2017/yolo_head.py index da2b3e1c..7428fb4c 100644 --- a/hub_module/modules/image/object_detection/yolov3_resnet34_coco2017/yolo_head.py +++ b/hub_module/modules/image/object_detection/yolov3_resnet34_coco2017/yolo_head.py @@ -227,7 +227,7 @@ class YOLOv3Head(object): # upsample route = self._upsample(route) - return outputs + return outputs, blocks def get_prediction(self, outputs, im_size): """ -- GitLab