当前位置:网站首页>Mmdetection custom fetch detection result script and image_ demo. Py parsing

Mmdetection custom fetch detection result script and image_ demo. Py parsing

2022-06-11 23:40:00 @Flying caterpillar

The reason to say image_demo.py, Because its sum video_demo.py、webcam_demo.py These three are big differences and small differences , And provide ideas for us to take out the test results for other interfaces .image_demo.py stay mmd\demo Under the folder . First , We give image_demo.py Parameter parser and main() Method comments , The whole process is relatively simple , Then the method by method analysis .

import asyncio
from argparse import ArgumentParser

from mmdet.apis import (async_inference_detector, inference_detector,init_detector, show_result_pyplot)

def parse_args():
    parser = ArgumentParser() #  Create a parameter parser 
    parser.add_argument('img', help='Image file') #  Images to test 
    parser.add_argument('config', help='Config file') #  The configuration file 
    parser.add_argument('checkpoint', help='Checkpoint file') #  Weight file for model 
    parser.add_argument('--device', default='cuda:0', help='Device used for inference') #  The equipment used 
    parser.add_argument('--score-thr', type=float, de
原网站

版权声明
本文为[@Flying caterpillar]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203011605455934.html