提交 23575238 编写于 作者: W wuzewu

Fix docs

上级 c6553c45
```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 ## API
...@@ -22,7 +18,7 @@ def context(num_classes=81, ...@@ -22,7 +18,7 @@ def context(num_classes=81,
**参数** **参数**
* num\_classes (int): 类别数; * num\_classes (int): 类别数;
* trainable(bool): 将参数的trainable 属性设为trainable * trainable(bool): 参数是否可训练
* pretrained (bool): 是否加载预训练模型; * pretrained (bool): 是否加载预训练模型;
* phase (str): 可选值为 'train'/'predict','trian' 用于训练,'predict' 用于预测。 * phase (str): 可选值为 'train'/'predict','trian' 用于训练,'predict' 用于预测。
...@@ -35,7 +31,7 @@ def context(num_classes=81, ...@@ -35,7 +31,7 @@ def context(num_classes=81,
* im\_info (Variable): 图像缩放信息 * im\_info (Variable): 图像缩放信息
* gt\_class (Variable): 检测框类别 * gt\_class (Variable): 检测框类别
* gt\_box (Variable): 检测框坐标 * gt\_box (Variable): 检测框坐标
* is\_crowd (Variable): * is\_crowd (Variable): 单个框内是否包含多个物体
当 phase 为 'predict'时,包含: 当 phase 为 'predict'时,包含:
* image (Variable): 图像变量 * image (Variable): 图像变量
* im\_size (Variable): 图像的尺寸 * im\_size (Variable): 图像的尺寸
......
```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 ## API
...@@ -22,7 +18,7 @@ def context(num_classes=81, ...@@ -22,7 +18,7 @@ def context(num_classes=81,
**参数** **参数**
* num\_classes (int): 类别数; * num\_classes (int): 类别数;
* trainable(bool): 将参数的trainable 属性设为trainable * trainable(bool): 参数是否可训练
* pretrained (bool): 是否加载预训练模型; * pretrained (bool): 是否加载预训练模型;
* phase (str): 可选值为 'train'/'predict','trian' 用于训练,'predict' 用于预测。 * phase (str): 可选值为 'train'/'predict','trian' 用于训练,'predict' 用于预测。
...@@ -35,7 +31,7 @@ def context(num_classes=81, ...@@ -35,7 +31,7 @@ def context(num_classes=81,
* im\_info (Variable): 图像缩放信息 * im\_info (Variable): 图像缩放信息
* gt\_class (Variable): 检测框类别 * gt\_class (Variable): 检测框类别
* gt\_box (Variable): 检测框坐标 * gt\_box (Variable): 检测框坐标
* is\_crowd (Variable): * is\_crowd (Variable): 单个框内是否包含多个物体
当 phase 为 'predict'时,包含: 当 phase 为 'predict'时,包含:
* image (Variable): 图像变量 * image (Variable): 图像变量
* im\_size (Variable): 图像的尺寸 * im\_size (Variable): 图像的尺寸
......
```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 ## API
...@@ -16,11 +12,11 @@ def context(trainable=True, ...@@ -16,11 +12,11 @@ def context(trainable=True,
get_prediction=False) get_prediction=False)
``` ```
特征提取,用于迁移学习。 提取特征,用于迁移学习。
**参数** **参数**
* trainable(bool): 将参数的trainable属性设为trainable * trainable(bool): 参数是否可训练
* pretrained (bool): 是否加载预训练模型; * pretrained (bool): 是否加载预训练模型;
* get\_prediction (bool): 是否执行预测。 * get\_prediction (bool): 是否执行预测。
......
```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 ## API
...@@ -16,11 +12,11 @@ def context(trainable=True, ...@@ -16,11 +12,11 @@ def context(trainable=True,
get_prediction=False) get_prediction=False)
``` ```
特征提取,用于迁移学习。 提取特征,用于迁移学习。
**参数** **参数**
* trainable(bool): 设置参数的 trainable 属性 * trainable(bool): 参数是否可训练
* pretrained (bool): 是否加载预训练模型; * pretrained (bool): 是否加载预训练模型;
* get\_prediction (bool): 是否执行预测。 * get\_prediction (bool): 是否执行预测。
......
```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 ## API
...@@ -16,11 +12,11 @@ def context(trainable=True, ...@@ -16,11 +12,11 @@ def context(trainable=True,
get_prediction=False) get_prediction=False)
``` ```
特征提取,用于迁移学习。 提取特征,用于迁移学习。
**参数** **参数**
* trainable(bool): 设置参数的 trainable 属性 * trainable(bool): 参数是否可训练
* pretrained (bool): 是否加载预训练模型; * pretrained (bool): 是否加载预训练模型;
* get\_prediction (bool): 是否执行预测。 * get\_prediction (bool): 是否执行预测。
......
```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 ## API
...@@ -16,11 +12,11 @@ def context(trainable=True, ...@@ -16,11 +12,11 @@ def context(trainable=True,
get_prediction=False) get_prediction=False)
``` ```
特征提取,用于迁移学习。 提取特征,用于迁移学习。
**参数** **参数**
* trainable(bool): 设置参数的 trainable 属性 * trainable(bool): 参数是否可训练
* pretrained (bool): 是否加载预训练模型; * pretrained (bool): 是否加载预训练模型;
* get\_prediction (bool): 是否执行预测。 * get\_prediction (bool): 是否执行预测。
......
```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 ## API
...@@ -16,11 +12,11 @@ def context(trainable=True, ...@@ -16,11 +12,11 @@ def context(trainable=True,
get_prediction=False) get_prediction=False)
``` ```
特征提取,用于迁移学习。 提取特征,用于迁移学习。
**参数** **参数**
* trainable(bool): 将参数的trainable属性设为trainable * trainable(bool): 参数是否可训练
* pretrained (bool): 是否加载预训练模型; * pretrained (bool): 是否加载预训练模型;
* get\_prediction (bool): 是否执行预测。 * get\_prediction (bool): 是否执行预测。
...@@ -29,7 +25,7 @@ def context(trainable=True, ...@@ -29,7 +25,7 @@ def context(trainable=True,
* inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为: * inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为:
* image (Variable): 图像变量 * image (Variable): 图像变量
* im\_size (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. * context\_prog (Program): 用于迁移学习的 Program.
```python ```python
......
...@@ -88,7 +88,7 @@ class YOLOv3DarkNet53Coco2017(hub.Module): ...@@ -88,7 +88,7 @@ class YOLOv3DarkNet53Coco2017(hub.Module):
# yolo_head # yolo_head
yolo_head = YOLOv3Head(num_classes=80) yolo_head = YOLOv3Head(num_classes=80)
# head_features # head_features
head_features = yolo_head._get_outputs( head_features, body_features = yolo_head._get_outputs(
body_feats, is_train=trainable) body_feats, is_train=trainable)
place = fluid.CPUPlace() place = fluid.CPUPlace()
...@@ -109,7 +109,9 @@ class YOLOv3DarkNet53Coco2017(hub.Module): ...@@ -109,7 +109,9 @@ class YOLOv3DarkNet53Coco2017(hub.Module):
else: else:
outputs = { outputs = {
'head_features': '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
add_vars_prefix(context_prog, var_prefix) add_vars_prefix(context_prog, var_prefix)
......
...@@ -227,7 +227,7 @@ class YOLOv3Head(object): ...@@ -227,7 +227,7 @@ class YOLOv3Head(object):
# upsample # upsample
route = self._upsample(route) route = self._upsample(route)
return outputs return outputs, blocks
def get_prediction(self, outputs, im_size): def get_prediction(self, outputs, im_size):
""" """
......
```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 ## API
...@@ -16,11 +12,11 @@ def context(trainable=True, ...@@ -16,11 +12,11 @@ def context(trainable=True,
get_prediction=False) get_prediction=False)
``` ```
特征提取,用于迁移学习。 提取特征,用于迁移学习。
**参数** **参数**
* trainable(bool): 将参数的trainable属性设为trainable * trainable(bool): 参数是否可训练
* pretrained (bool): 是否加载预训练模型; * pretrained (bool): 是否加载预训练模型;
* get\_prediction (bool): 是否执行预测。 * get\_prediction (bool): 是否执行预测。
...@@ -29,7 +25,7 @@ def context(trainable=True, ...@@ -29,7 +25,7 @@ def context(trainable=True,
* inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为: * inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为:
* image (Variable): 图像变量 * image (Variable): 图像变量
* im\_size (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. * context\_prog (Program): 用于迁移学习的 Program.
```python ```python
......
...@@ -102,7 +102,7 @@ class YOLOv3DarkNet53Pedestrian(hub.Module): ...@@ -102,7 +102,7 @@ class YOLOv3DarkNet53Pedestrian(hub.Module):
normalized=False, normalized=False,
score_threshold=0.01)) score_threshold=0.01))
# head_features # head_features
head_features = yolo_head._get_outputs( head_features, body_features = yolo_head._get_outputs(
body_feats, is_train=trainable) body_feats, is_train=trainable)
place = fluid.CPUPlace() place = fluid.CPUPlace()
...@@ -123,7 +123,9 @@ class YOLOv3DarkNet53Pedestrian(hub.Module): ...@@ -123,7 +123,9 @@ class YOLOv3DarkNet53Pedestrian(hub.Module):
else: else:
outputs = { outputs = {
'head_features': '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
add_vars_prefix(context_prog, var_prefix) add_vars_prefix(context_prog, var_prefix)
......
...@@ -227,7 +227,7 @@ class YOLOv3Head(object): ...@@ -227,7 +227,7 @@ class YOLOv3Head(object):
# upsample # upsample
route = self._upsample(route) route = self._upsample(route)
return outputs return outputs, blocks
def get_prediction(self, outputs, im_size): def get_prediction(self, outputs, im_size):
""" """
......
```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 ## API
...@@ -16,11 +12,11 @@ def context(trainable=True, ...@@ -16,11 +12,11 @@ def context(trainable=True,
get_prediction=False) get_prediction=False)
``` ```
特征提取,用于迁移学习。 提取特征,用于迁移学习。
**参数** **参数**
* trainable(bool): 将参数的trainable属性设为trainable * trainable(bool): 参数是否可训练
* pretrained (bool): 是否加载预训练模型; * pretrained (bool): 是否加载预训练模型;
* get\_prediction (bool): 是否执行预测。 * get\_prediction (bool): 是否执行预测。
...@@ -29,7 +25,7 @@ def context(trainable=True, ...@@ -29,7 +25,7 @@ def context(trainable=True,
* inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为: * inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为:
* image (Variable): 图像变量 * image (Variable): 图像变量
* im\_size (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. * context\_prog (Program): 用于迁移学习的 Program.
```python ```python
......
...@@ -102,7 +102,7 @@ class YOLOv3DarkNet53Vehicles(hub.Module): ...@@ -102,7 +102,7 @@ class YOLOv3DarkNet53Vehicles(hub.Module):
normalized=False, normalized=False,
score_threshold=0.005)) score_threshold=0.005))
# head_features # head_features
head_features = yolo_head._get_outputs( head_features, body_features = yolo_head._get_outputs(
body_feats, is_train=trainable) body_feats, is_train=trainable)
place = fluid.CPUPlace() place = fluid.CPUPlace()
...@@ -123,7 +123,9 @@ class YOLOv3DarkNet53Vehicles(hub.Module): ...@@ -123,7 +123,9 @@ class YOLOv3DarkNet53Vehicles(hub.Module):
else: else:
outputs = { outputs = {
'head_features': '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
add_vars_prefix(context_prog, var_prefix) add_vars_prefix(context_prog, var_prefix)
......
...@@ -227,7 +227,7 @@ class YOLOv3Head(object): ...@@ -227,7 +227,7 @@ class YOLOv3Head(object):
# upsample # upsample
route = self._upsample(route) route = self._upsample(route)
return outputs return outputs, blocks
def get_prediction(self, outputs, im_size): def get_prediction(self, outputs, im_size):
""" """
......
```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 ## API
...@@ -16,11 +12,11 @@ def context(trainable=True, ...@@ -16,11 +12,11 @@ def context(trainable=True,
get_prediction=False) get_prediction=False)
``` ```
特征提取,用于迁移学习。 提取特征,用于迁移学习。
**参数** **参数**
* trainable(bool): 将参数的 trainable 属性设为 trainable * trainable(bool): 参数是否可训练
* pretrained (bool): 是否加载预训练模型; * pretrained (bool): 是否加载预训练模型;
* get\_prediction (bool): 是否执行预测。 * get\_prediction (bool): 是否执行预测。
...@@ -29,7 +25,7 @@ def context(trainable=True, ...@@ -29,7 +25,7 @@ def context(trainable=True,
* inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为: * inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为:
* image (Variable): 图像变量; * image (Variable): 图像变量;
* im\_size (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. * context\_prog (Program): 用于迁移学习的 Program.
```python ```python
......
...@@ -92,7 +92,7 @@ class YOLOv3MobileNetV1Coco2017(hub.Module): ...@@ -92,7 +92,7 @@ class YOLOv3MobileNetV1Coco2017(hub.Module):
# yolo_head # yolo_head
yolo_head = YOLOv3Head(num_classes=80) yolo_head = YOLOv3Head(num_classes=80)
# head_features # head_features
head_features = yolo_head._get_outputs( head_features, body_features = yolo_head._get_outputs(
body_feats, is_train=trainable) body_feats, is_train=trainable)
place = fluid.CPUPlace() place = fluid.CPUPlace()
...@@ -113,7 +113,9 @@ class YOLOv3MobileNetV1Coco2017(hub.Module): ...@@ -113,7 +113,9 @@ class YOLOv3MobileNetV1Coco2017(hub.Module):
else: else:
outputs = { outputs = {
'head_features': '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
add_vars_prefix(context_prog, var_prefix) add_vars_prefix(context_prog, var_prefix)
......
...@@ -227,7 +227,7 @@ class YOLOv3Head(object): ...@@ -227,7 +227,7 @@ class YOLOv3Head(object):
# upsample # upsample
route = self._upsample(route) route = self._upsample(route)
return outputs return outputs, blocks
def get_prediction(self, outputs, im_size): def get_prediction(self, outputs, im_size):
""" """
......
```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 ## API
...@@ -16,11 +12,11 @@ def context(trainable=True, ...@@ -16,11 +12,11 @@ def context(trainable=True,
get_prediction=False) get_prediction=False)
``` ```
提取头部特征,用于迁移学习。 提取特征,用于迁移学习。
**参数** **参数**
* trainable(bool): 将参数的trainable属性设为trainable * trainable(bool): 参数是否可训练
* pretrained (bool): 是否加载预训练模型; * pretrained (bool): 是否加载预训练模型;
* get\_prediction (bool): 是否执行预测。 * get\_prediction (bool): 是否执行预测。
...@@ -29,7 +25,7 @@ def context(trainable=True, ...@@ -29,7 +25,7 @@ def context(trainable=True,
* inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为: * inputs (dict): 模型的输入,keys 包括 'image', 'im\_size',相应的取值为:
* image (Variable): 图像变量 * image (Variable): 图像变量
* im\_size (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. * context\_prog (Program): 用于迁移学习的 Program.
```python ```python
......
...@@ -94,7 +94,7 @@ class YOLOv3DarkNet53Coco2017(hub.Module): ...@@ -94,7 +94,7 @@ class YOLOv3DarkNet53Coco2017(hub.Module):
# yolo_head # yolo_head
yolo_head = YOLOv3Head(num_classes=80) yolo_head = YOLOv3Head(num_classes=80)
# head_features # head_features
head_features = yolo_head._get_outputs( head_features, body_features = yolo_head._get_outputs(
body_feats, is_train=trainable) body_feats, is_train=trainable)
place = fluid.CPUPlace() place = fluid.CPUPlace()
...@@ -115,7 +115,9 @@ class YOLOv3DarkNet53Coco2017(hub.Module): ...@@ -115,7 +115,9 @@ class YOLOv3DarkNet53Coco2017(hub.Module):
else: else:
outputs = { outputs = {
'head_features': '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
add_vars_prefix(context_prog, var_prefix) add_vars_prefix(context_prog, var_prefix)
......
...@@ -227,7 +227,7 @@ class YOLOv3Head(object): ...@@ -227,7 +227,7 @@ class YOLOv3Head(object):
# upsample # upsample
route = self._upsample(route) route = self._upsample(route)
return outputs return outputs, blocks
def get_prediction(self, outputs, im_size): def get_prediction(self, outputs, im_size):
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册