trtutils.models.classifiers package

Module contents

Classifier model implementations.

class trtutils.models.classifiers.VGG(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for VGG.

class trtutils.models.classifiers.AlexNet(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for AlexNet.

class trtutils.models.classifiers.ConvNeXt(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for ConvNeXt.

class trtutils.models.classifiers.DenseNet(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for DenseNet.

class trtutils.models.classifiers.EfficientNet(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for EfficientNet.

class trtutils.models.classifiers.EfficientNetV2(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for EfficientNet V2.

class trtutils.models.classifiers.GoogLeNet(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for GoogLeNet.

class trtutils.models.classifiers.Inception(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for Inception V3.

class trtutils.models.classifiers.MNASNet(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for MNASNet.

class trtutils.models.classifiers.MaxViT(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for MaxViT.

class trtutils.models.classifiers.MobileNetV2(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for MobileNet V2.

class trtutils.models.classifiers.MobileNetV3(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for MobileNet V3.

class trtutils.models.classifiers.RegNet(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for RegNet.

class trtutils.models.classifiers.ResNeXt(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for ResNeXt.

class trtutils.models.classifiers.ResNet(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for ResNet.

class trtutils.models.classifiers.ShuffleNetV2(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for ShuffleNet V2.

class trtutils.models.classifiers.SqueezeNet(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for SqueezeNet.

class trtutils.models.classifiers.SwinTransformer(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for Swin Transformer.

class trtutils.models.classifiers.SwinTransformerV2(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for Swin Transformer V2.

class trtutils.models.classifiers.ViT(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for ViT.

class trtutils.models.classifiers.WideResNet(engine_path: Path | str, warmup_iterations: int = 10, input_range: tuple[float, float] = (0, 1), preprocessor: str = 'trt', resize_method: str = 'linear', mean: tuple[float, float, float] | None = (0.485, 0.456, 0.406), std: tuple[float, float, float] | None = (0.229, 0.224, 0.225), dla_core: int | None = None, device: int | None = None, backend: str = 'auto', *, warmup: bool | None = None, pagelocked_mem: bool | None = None, unified_mem: bool | None = None, cuda_graph: bool | None = None, no_warn: bool | None = None, verbose: bool | None = None)[source]

Bases: Classifier, Model

Alias of Classifier with default args for Wide ResNet.