Skip to content

Commit

Permalink
Fix docstring format (#495)
Browse files Browse the repository at this point in the history
* Fix doc common

* Fix bugs
  • Loading branch information
triple-Mu authored May 23, 2022
1 parent 57baf21 commit de3f18f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
14 changes: 7 additions & 7 deletions mmdeploy/apis/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ def create_calib_table(calib_file: str,
Examples:
>>> from mmdeploy.apis import create_calib_table
>>> from mmdeploy.utils import get_calib_filename, load_config
>>> deploy_cfg = 'configs/mmdet/detection/' \
'detection_tensorrt-int8_dynamic-320x320-1344x1344.py'
>>> deploy_cfg = ('configs/mmdet/detection/'
'detection_tensorrt-int8_dynamic-320x320-1344x1344.py')
>>> deploy_cfg = load_config(deploy_cfg)[0]
>>> calib_file = get_calib_filename(deploy_cfg)
>>> model_cfg = 'mmdetection/configs/fcos/' \
'fcos_r50_caffe_fpn_gn-head_1x_coco.py'
>>> model_checkpoint = 'checkpoints/' \
'fcos_r50_caffe_fpn_gn-head_1x_coco-821213aa.pth'
>>> create_calib_table(calib_file, deploy_cfg, \
>>> model_cfg = ('mmdetection/configs/fcos/'
'fcos_r50_caffe_fpn_gn-head_1x_coco.py')
>>> model_checkpoint = ('checkpoints/'
'fcos_r50_caffe_fpn_gn-head_1x_coco-821213aa.pth')
>>> create_calib_table(calib_file, deploy_cfg,
model_cfg, model_checkpoint, device='cuda:0')
Args:
Expand Down
12 changes: 6 additions & 6 deletions mmdeploy/apis/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ def inference_model(model_cfg: Union[str, mmcv.Config],
Examples:
>>> from mmdeploy.apis import inference_model
>>> model_cfg = 'mmdetection/configs/fcos/' \
'fcos_r50_caffe_fpn_gn-head_1x_coco.py'
>>> deploy_cfg = 'configs/mmdet/detection/' \
'detection_onnxruntime_dynamic.py'
>>> model_cfg = ('mmdetection/configs/fcos/'
'fcos_r50_caffe_fpn_gn-head_1x_coco.py')
>>> deploy_cfg = ('configs/mmdet/detection/'
'detection_onnxruntime_dynamic.py')
>>> backend_files = ['work_dir/fcos.onnx']
>>> img = 'demo.jpg'
>>> device = 'cpu'
>>> model_output = inference_model(model_cfg, deploy_cfg, \
backend_files, img, device)
>>> model_output = inference_model(model_cfg, deploy_cfg,
backend_files, img, device)
Args:
model_cfg (str | mmcv.Config): Model config file or Config object.
Expand Down
12 changes: 6 additions & 6 deletions mmdeploy/apis/pytorch2onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ def torch2onnx(img: Any,
>>> img = 'demo.jpg'
>>> work_dir = 'work_dir'
>>> save_file = 'fcos.onnx'
>>> deploy_cfg = 'configs/mmdet/detection/' \
'detection_onnxruntime_dynamic.py'
>>> model_cfg = 'mmdetection/configs/fcos/' \
'fcos_r50_caffe_fpn_gn-head_1x_coco.py'
>>> model_checkpoint = 'checkpoints/' \
'fcos_r50_caffe_fpn_gn-head_1x_coco-821213aa.pth'
>>> deploy_cfg = ('configs/mmdet/detection/'
'detection_onnxruntime_dynamic.py')
>>> model_cfg = ('mmdetection/configs/fcos/'
'fcos_r50_caffe_fpn_gn-head_1x_coco.py')
>>> model_checkpoint = ('checkpoints/'
'fcos_r50_caffe_fpn_gn-head_1x_coco-821213aa.pth')
>>> device = 'cpu'
>>> torch2onnx(img, work_dir, save_file, deploy_cfg, \
model_cfg, model_checkpoint, device)
Expand Down
8 changes: 4 additions & 4 deletions mmdeploy/apis/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def visualize_model(model_cfg: Union[str, mmcv.Config],
Examples:
>>> from mmdeploy.apis import visualize_model
>>> model_cfg = 'mmdetection/configs/fcos/' \
'fcos_r50_caffe_fpn_gn-head_1x_coco.py'
>>> deploy_cfg = 'configs/mmdet/detection/' \
'detection_onnxruntime_dynamic.py'
>>> model_cfg = ('mmdetection/configs/fcos/'
'fcos_r50_caffe_fpn_gn-head_1x_coco.py')
>>> deploy_cfg = ('configs/mmdet/detection/'
'detection_onnxruntime_dynamic.py')
>>> model = 'work_dir/fcos.onnx'
>>> img = 'demo.jpg'
>>> device = 'cpu'
Expand Down
6 changes: 3 additions & 3 deletions mmdeploy/backend/tensorrt/onnx2tensorrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ def onnx2tensorrt(work_dir: str,
>>> work_dir = 'work_dir'
>>> save_file = 'end2end.engine'
>>> model_id = 0
>>> deploy_cfg = 'configs/mmdet/detection/' \
'detection_tensorrt_dynamic-320x320-1344x1344.py'
>>> deploy_cfg = ('configs/mmdet/detection/'
'detection_tensorrt_dynamic-320x320-1344x1344.py')
>>> onnx_model = 'work_dir/end2end.onnx'
>>> onnx2tensorrt(work_dir, save_file, model_id, deploy_cfg, \
>>> onnx2tensorrt(work_dir, save_file, model_id, deploy_cfg,
onnx_model, 'cuda:0')
Args:
Expand Down

0 comments on commit de3f18f

Please sign in to comment.