(model, imgs)
Inference image(s) with the detector.

    Args:
        model (nn.Module): The loaded detector.
        imgs (str/ndarray or list[str/ndarray]): Either image files or loaded
            images.

    Returns:
        If imgs is a str, a generator will be returned, otherwise return the
        detection results directly.
Inference image(s) with the detector.
Inference image ( s ) with the detector .
def inference_detector(model, imgs):
    """Inference image(s) with the detector.

    Args:
        model (nn.Module): The loaded detector.
        imgs (str/ndarray or list[str/ndarray]): Either image files or loaded
            images.

    Returns:
        If imgs is a str, a generator will be returned, otherwise return the
        detection results directly.
    """
    cfg = model.cfg
    img_transform = ImageTransform(
        size_divisor=cfg.data.test.size_divisor, **cfg.img_norm_cfg)

    device = next(model.parameters()).device  # model device
    if not isinstance(imgs, list):
        return _inference_single(model, imgs, img_transform, device)
    else:
        return _inference_generator(model, imgs, img_transform, device)
def inference_detector ( model , imgs ) : cfg = model . cfg img_transform = ImageTransform ( size_divisor = cfg . data . test . size_divisor , * * cfg . img_norm_cfg ) device = next ( model . parameters ( ) ) . device # model device if not isinstance ( imgs , list ) : return _inference_single ( model , imgs , img_transform , device ) else : return _inference_generator ( model , imgs , img_transform , device )