Пример #1
0
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time object detection with TensorRT optimized '
            'YOLO model on Jetson')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('-n',
                        '--num_points',
                        type=int,
                        default=50,
                        help='Number of interpolated points.')
    parser.add_argument('-c',
                        '--category_num',
                        type=int,
                        default=1,
                        help='number of object categories [80]')
    parser.add_argument('-d',
                        '--display_mode',
                        type=bool,
                        default=False,
                        help=('to turn display_mode on: --display_mode True'))
    parser.add_argument('-lat',
                        '--latitude',
                        type=float,
                        required=True,
                        help=('Please provide latitude in decimal degrees'))
    parser.add_argument('-lon',
                        '--longitude',
                        type=float,
                        required=True,
                        help=('Please provide longitude in decimal degrees'))
    args = parser.parse_args()

    return args
Пример #2
0
def parse_args():
    """Parse input arguments."""
    desc = ('capture Video input file and save BBoxed Video'
            'object detection with TensorRT optimized '
            'YOLO model on Jetson')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('-v',
                        '--video_name',
                        type=str,
                        required=True,
                        help='You need to put input video')
    parser.add_argument('-o',
                        '--result_video',
                        type=str,
                        required=True,
                        help='You need to put output video name')
    parser.add_argument('-c',
                        '--category_num',
                        type=int,
                        default=15,
                        help='number of object categories [15]')
    parser.add_argument(
        '-m',
        '--model',
        type=str,
        required=True,
        help=('[yolov3|yolov3-tiny|yolov3-spp|yolov4|yolov4-tiny]-'
              '[{dimension}], where dimension could be a single '
              'number (e.g. 288, 416, 608) or WxH (e.g. 416x256)'))
    args = parser.parse_args()
    return args
Пример #3
0
def parse_args():
    """Parse input arguments."""
    desc = ('This script captures and displays live camera video, '
            'and does real-time object detection with TF-TRT model '
            'on Jetson TX2/TX1/Nano')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('--model', dest='model',
                        help='tf-trt object detecion model '
                        '[{}]'.format(DEFAULT_MODEL),
                        default=DEFAULT_MODEL, type=str)
    parser.add_argument('--build', dest='do_build',
                        help='re-build TRT pb file (instead of using'
                        'the previously built version)',
                        action='store_true')
    parser.add_argument('--tensorboard', dest='do_tensorboard',
                        help='write optimized graph summary to TensorBoard',
                        action='store_true')
    parser.add_argument('--labelmap', dest='labelmap_file',
                        help='[{}]'.format(DEFAULT_LABELMAP),
                        default=DEFAULT_LABELMAP, type=str)
    parser.add_argument('--num-classes', dest='num_classes',
                        help='(deprecated and not used) number of object '
                        'classes', type=int)
    parser.add_argument('--confidence', dest='conf_th',
                        help='confidence threshold [0.3]',
                        default=0.3, type=float)
    args = parser.parse_args()
    return args
Пример #4
0
def parse_args():
    """Parse input arguments."""
    desc = 'MJPEG version of trt_yolo'
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('-c',
                        '--category_num',
                        type=int,
                        default=80,
                        help='number of object categories [80]')
    parser.add_argument(
        '-m',
        '--model',
        type=str,
        required=True,
        help=('[yolov3|yolov3-tiny|yolov3-spp|yolov4|yolov4-tiny]-'
              '[{dimension}], where dimension could be a single '
              'number (e.g. 288, 416, 608) or WxH (e.g. 416x256)'))
    parser.add_argument('-p',
                        '--mjpeg_port',
                        type=int,
                        default=8080,
                        help='MJPEG server port [8080]')
    args = parser.parse_args()
    return args
def parse_args():
    """Parse input arguments."""
    desc = 'MJPEG version of trt_yolo'
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('-c',
                        '--category_num',
                        type=int,
                        default=80,
                        help='number of object categories [80]')
    parser.add_argument(
        '-m',
        '--model',
        type=str,
        required=True,
        help=('[yolov3-tiny|yolov3|yolov3-spp|yolov4-tiny|yolov4|'
              'yolov4-csp|yolov4x-mish]-[{dimension}], where '
              '{dimension} could be either a single number (e.g. '
              '288, 416, 608) or 2 numbers, WxH (e.g. 416x256)'))
    parser.add_argument('-l',
                        '--letter_box',
                        action='store_true',
                        help='inference with letterboxed image [False]')
    parser.add_argument('-p',
                        '--mjpeg_port',
                        type=int,
                        default=8080,
                        help='MJPEG server port [8080]')
    args = parser.parse_args()
    return args
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time object detection with TensorRT optimized '
            'YOLO model on Jetson')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('-c',
                        '--category_num',
                        type=int,
                        default=80,
                        help='number of object categories [80]')
    parser.add_argument(
        '-m',
        '--model',
        type=str,
        required=True,
        help=('[yolov3|yolov3-tiny|yolov3-spp|yolov4|yolov4-tiny]-'
              '[{dimension}], where dimension could be a single '
              'number (e.g. 288, 416, 608) or WxH (e.g. 416x256)'))
    parser.add_argument('-l',
                        '--letter_box',
                        action='store_true',
                        help='inference with letterboxed image [False]')
    parser.add_argument('--host', \
        type=str, default='localhost', metavar='MQTT_HOST', \
        help='MQTT remote broker IP address')
    parser.add_argument('--topic', \
        type=str, default='yolo', metavar='MQTT_TOPIC', \
        help='MQTT topic to be published on')
    parser.add_argument('--port', \
        type=int, default=1883, metavar='MQTT_PORT', \
        help='MQTT port number')
    args = parser.parse_args()
    return args
Пример #7
0
def parse_args():
    desc = 'Capture and display live camera video'
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('--minsize', type=int, default=40, help='minsize (in pixels) for detection [40]')
    args = parser.parse_args()
    return args
Пример #8
0
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time object detection with TensorRT optimized '
            'YOLO model on Jetson')
    '''description = python3 trt_yolo.py --usb 0 -m yolov4-tiny-288'''
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('-c',
                        '--category_num',
                        type=int,
                        default=80,
                        help='number of object categories [80]')
    parser.add_argument(
        '-m',
        '--model',
        type=str,
        required=True,
        help=('[yolov3|yolov3-tiny|yolov3-spp|yolov4|yolov4-tiny]-'
              '[{dimension}], where dimension could be a single '
              'number (e.g. 288, 416, 608) or WxH (e.g. 416x256)'))
    parser.add_argument('-l',
                        '--letter_box',
                        action='store_true',
                        help='inference with letterboxed image [False]')
    args = parser.parse_args()
    return args
Пример #9
0
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time face detection with TrtMtcnn on Jetson '
            'Nano')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    args = parser.parse_args()
    return args
Пример #10
0
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time object detection with TensorRT optimized '
            'YOLOv3 model on Jetson Nano')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('--model', type=str, default='yolov3-416')
    args = parser.parse_args()
    return args
Пример #11
0
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time face detection with TrtMtcnn on Jetson '
            'Nano')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('--minsize', type=int, default=40,
                        help='minsize (in pixels) for detection [40]')
    args = parser.parse_args()
    return args
Пример #12
0
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time object detection with TensorRT optimized '
            'SSD model on Jetson Nano')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('--model', type=str, default='ssd_mobilenet_v2_coco',
                        choices=SUPPORTED_MODELS)
    args = parser.parse_args()
    return args
Пример #13
0
def parse_args():
    """Parse input arguments."""
    desc = 'Follow cats with SSD model on Jetson Nano'
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('--model',
                        type=str,
                        default='ssd_mobilenet_v1_coco',
                        choices=SUPPORTED_MODELS)
    args = parser.parse_args()
    return args
Пример #14
0
def parse_args():
    '''parse args'''
    parser = argparse.ArgumentParser()

    parser = add_camera_args(parser)
    parser.add_argument('--model', type=str, default='ssd_mobilenet_v1_digger')
    parser.add_argument('--image_resize', default=300, type=int)
    parser.add_argument('--det_conf_thresh', default=0.8, type=float)
    parser.add_argument('--seq_dir', default="sequence/")
    parser.add_argument('--sort_max_age', default=5, type=int)
    parser.add_argument('--sort_min_hit', default=3, type=int)
    return parser.parse_args()
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time image classification with TrtGooglenet '
            'on Jetson Nano')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('--crop', dest='crop_center',
                        help='crop center square of image for '
                             'inferencing [False]',
                        action='store_true')
    args = parser.parse_args()
    return args
Пример #16
0
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time object detection with TensorRT optimized '
            'YOLOv3 model on Jetson Family')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('--model', type=str, default='yolov3-416',
                        choices=['yolov3-288', 'yolov3-416', 'yolov3-608',
                                 'yolov3-tiny-288', 'yolov3-tiny-416'])
    parser.add_argument('--runtime', action='store_true',
                        help='display detailed runtime')
    args = parser.parse_args()
    return args
Пример #17
0
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time face detection with TensorRT optimized '
            'retinaface model on Jetson')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument(
        '-m', '--model', type=str, required=True,
        help=('[retinaface]-'
              '[{dimension}], where dimension could be a single '
              'number (e.g. 320, 640)'))
    args = parser.parse_args()
    return args
Пример #18
0
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time object detection with TensorRT optimized '
            'YOLOv3 model on Jetson Nano')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('--model', type=str, default='yolov3-416',
                        choices=['yolov3-288', 'yolov3-416', 'yolov3-608',
                                 'yolov3-tiny-288', 'yolov3-tiny-416'])
    parser.add_argument('--category_num', type=int, default=80,
                        help='number of object categories [80]')
    args = parser.parse_args()
    return args
Пример #19
0
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time object detection with TensorRT optimized '
            'YOLO model on Jetson')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('-c',
                        '--category_num',
                        type=int,
                        default=80,
                        help='number of object categories [80]')
    parser.add_argument(
        '-m',
        '--model',
        type=str,
        required=True,
        help=('[yolov3|yolov3-tiny|yolov3-spp|yolov4|yolov4-tiny]-'
              '[{dimension}], where dimension could be a single '
              'number (e.g. 288, 416, 608) or WxH (e.g. 416x256)'))
    parser.add_argument('-v',
                        '--valid_coco',
                        type=str,
                        help='Path to the valid coco json file')
    parser.add_argument(
        '--write_images',
        action="store_true",
        help='Write images with detected bounding boxes to output directory')
    parser.add_argument("--image_output",
                        type=str,
                        default="/home/out/images",
                        help="Output directory for images with bounding boxes")
    parser.add_argument("--result_json",
                        type=str,
                        default="/home/out/result.json",
                        help="Output file for annotations")
    parser.add_argument("--confidence_threshold",
                        type=float,
                        default=0.3,
                        help="Output file for annotations")
    parser.add_argument("--activate_display",
                        action="store_true",
                        help="Output file for annotations")
    args = parser.parse_args()
    return args
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time face detection with TrtMtcnn on Jetson '
            'Nano')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('--minsize',
                        type=int,
                        default=40,
                        help='minsize (in pixels) for detection [40]')
    parser.add_argument('-m',
                        '--model',
                        type=str,
                        default='ssd_mobilenet_v1_coco',
                        choices=SUPPORTED_MODELS)
    args = parser.parse_args()
    return args
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time object detection with TensorRT optimized '
            'YOLO model on Jetson')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument(
        '--model',
        type=str,
        required=True,
        help=('[yolov3|yolov3-tiny|yolov3-spp|yolov4|yolov4-tiny]-'
              '[{dimension}], where dimension could be a single '
              'number (e.g. 288, 416, 608) or WxH (e.g. 416x256)'))
    parser.add_argument('--category_num',
                        type=int,
                        default=80,
                        help='number of object categories [80]')
    args = parser.parse_args()
    return args
Пример #22
0
def parse_args():
    """Parse input arguments."""
    desc = ('Capture and display live camera video, while doing '
            'real-time object detection with TensorRT optimized '
            'SSD model on Jetson Nano')
    parser = argparse.ArgumentParser(description=desc)
    parser = add_camera_args(parser)
    parser.add_argument('--model',
                        type=str,
                        default='ssd_mobilenet_v2_coco',
                        choices=SUPPORTED_MODELS)
    parser.add_argument('--console',
                        dest='use_console',
                        help='write output to console',
                        action='store_true')
    parser.add_argument('--once',
                        dest='loop',
                        help='Run model once',
                        default=True,
                        action='store_false')
    args = parser.parse_args()
    return args