-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4eebf2c
commit aee606f
Showing
18 changed files
with
341 additions
and
84 deletions.
There are no files selected for viewing
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
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,106 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"metadata": { | ||
"pycharm": { | ||
"is_executing": false | ||
} | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"from mmdet3d.apis import init_detector, inference_detector, show_result_meshlab" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"metadata": { | ||
"pycharm": { | ||
"is_executing": false | ||
} | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"config_file = '../configs/second/hv_second_secfpn_6x8_80e_kitti-3d-car.py'\n", | ||
"# download the checkpoint from model zoo and put it in `checkpoints/`\n", | ||
"checkpoint_file = '../work_dirs/second/epoch_40.pth'" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 9, | ||
"metadata": { | ||
"pycharm": { | ||
"is_executing": false | ||
} | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# build the model from a config file and a checkpoint file\n", | ||
"model = init_detector(config_file, checkpoint_file, device='cuda:0')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"metadata": { | ||
"pycharm": { | ||
"is_executing": false | ||
} | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# test a single sample\n", | ||
"pcd = 'kitti_000008.bin'\n", | ||
"result, data = inference_detector(model, pcd)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 11, | ||
"metadata": { | ||
"pycharm": { | ||
"is_executing": false | ||
} | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# show the results\n", | ||
"out_dir = './'\n", | ||
"show_result_meshlab(data, result, out_dir)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.7.7" | ||
}, | ||
"pycharm": { | ||
"stem_cell": { | ||
"cell_type": "raw", | ||
"source": [], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from argparse import ArgumentParser | ||
|
||
from mmdet3d.apis import inference_detector, init_detector, 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( | ||
'--score-thr', type=float, default=0.6, help='bbox score threshold') | ||
parser.add_argument( | ||
'--out-dir', type=str, default='demo', help='dir to save results') | ||
args = parser.parse_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 | ||
result, data = inference_detector(model, args.pcd) | ||
# show the results | ||
show_result_meshlab(data, result, args.out_dir) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
from .inference import inference_detector, init_detector, show_result_meshlab | ||
from .test import single_gpu_test | ||
|
||
__all__ = ['single_gpu_test'] | ||
__all__ = [ | ||
'inference_detector', 'init_detector', 'single_gpu_test', | ||
'show_result_meshlab' | ||
] |
Oops, something went wrong.