forked from TakedaLab/mmdetection3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Support 3D semantic segmentation demo (open-mmlab#532)
* compress kitti unit test imgs * add unit test for inference_multi_modality_detector * fix typos * rename init_detector to init_model * show_result_meshlab support seg task * add unit test for seg show_result_meshlab * support inference_segmentor * support pc seg demo * add docs * minor fix * change function name * compress demo data size * update docs
- Loading branch information
Showing
13 changed files
with
325 additions
and
61 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from argparse import ArgumentParser | ||
|
||
from mmdet3d.apis import inference_segmentor, init_model, show_result_meshlab | ||
|
||
|
||
def main(): | ||
parser = ArgumentParser() | ||
parser.add_argument('pcd', help='Point cloud file') | ||
parser.add_argument('config', help='Config file') | ||
parser.add_argument('checkpoint', help='Checkpoint file') | ||
parser.add_argument( | ||
'--device', default='cuda:0', help='Device used for inference') | ||
parser.add_argument( | ||
'--out-dir', type=str, default='demo', help='dir to save results') | ||
parser.add_argument( | ||
'--show', action='store_true', help='show online visuliaztion results') | ||
parser.add_argument( | ||
'--snapshot', | ||
action='store_true', | ||
help='whether to save online visuliaztion results') | ||
args = parser.parse_args() | ||
|
||
# build the model from a config file and a checkpoint file | ||
model = init_model(args.config, args.checkpoint, device=args.device) | ||
# test a single image | ||
result, data = inference_segmentor(model, args.pcd) | ||
# show the results | ||
show_result_meshlab( | ||
data, | ||
result, | ||
args.out_dir, | ||
show=args.show, | ||
snapshot=args.snapshot, | ||
task='seg', | ||
palette=model.PALETTE) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
from .inference import (convert_SyncBN, inference_detector, | ||
inference_multi_modality_detector, init_detector, | ||
show_result_meshlab) | ||
inference_multi_modality_detector, inference_segmentor, | ||
init_model, show_result_meshlab) | ||
from .test import single_gpu_test | ||
from .train import train_model | ||
|
||
__all__ = [ | ||
'inference_detector', 'init_detector', 'single_gpu_test', | ||
'inference_detector', 'init_model', 'single_gpu_test', | ||
'show_result_meshlab', 'convert_SyncBN', 'train_model', | ||
'inference_multi_modality_detector' | ||
'inference_multi_modality_detector', 'inference_segmentor' | ||
] |
Oops, something went wrong.