Skip to content

Commit

Permalink
Check docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jbwang1997 committed Feb 28, 2022
1 parent 4e39a45 commit 7cd6ebc
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
Binary file added demo/dota_demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion demo/huge_image_demo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Copyright (c) OpenMMLab. All rights reserved.
"""Inference on huge images.
Example:
```
python demo/huge_image_demo.py \
demo/dota_demo.jpg \
configs/oriented_rcnn/oriented_rcnn_r50_fpn_1x_dota_v3.py \
work_dirs/oriented_rcnn_r50_fpn_1x_dota_v3/epoch_12.pth \
```
""" # nowq

from argparse import ArgumentParser

from mmdet.apis import init_detector, show_result_pyplot
Expand Down Expand Up @@ -45,7 +56,7 @@ def parse_args():
def main(args):
# build the model from a config file and a checkpoint file
model = init_detector(args.config, args.checkpoint, device=args.device)
# test a single image
# test a huge image by patches
result = inference_detector_by_patches(model, args.img, args.patch_sizes,
args.patch_steps, args.img_ratios,
args.merge_iou_thr)
Expand Down
8 changes: 5 additions & 3 deletions demo/image_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"""Inference on single image.
Example:
```
python demo/image_demo.py \
demo/demo.jpg \
configs/oriented_rcnn/oriented_rcnn_r50_fpn_1x_dota_v3.py \
work_dirs/oriented_rcnn_r50_fpn_1x_dota_v3/epoch_12.pth \
demo/vis.jpg
configs/oriented_rcnn/oriented_rcnn_r50_fpn_1x_dota_v3.py \
work_dirs/oriented_rcnn_r50_fpn_1x_dota_v3/epoch_12.pth \
demo/vis.jpg
```
""" # nowq

from argparse import ArgumentParser
Expand Down
3 changes: 1 addition & 2 deletions mmrotate/apis/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def inference_detector_by_patches(model,
bs (int): Batch size, must greater than or equal to 1.
Returns:
If imgs is a list or tuple, the same length list type results
will be returned, otherwise return the detection results directly.
list[np.ndarray]: Detection results.
"""
assert bs >= 1, 'The batch size must greater than or equal to 1'
cfg = model.cfg
Expand Down
5 changes: 2 additions & 3 deletions mmrotate/datasets/pipelines/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ def __call__(self, results):
"""Call functions to add image meta information.
Args:
results (dict): Result dict with Webcam read image in
``results['img']``.
results (dict): Result dict with image in ``results['img']``.
Returns:
dict: The dict contains loaded image and meta information.
dict: The dict contains the loaded patch and meta information.
"""

img = results['img']
Expand Down

0 comments on commit 7cd6ebc

Please sign in to comment.