model (BaseModel | str | Config) – A model name or a path to the config
file, or a BaseModel object. The model name can be found
by ImageCaptionInferencer.list_models() and you can also
query it in 模型库统计.
pretrained (str, optional) – Path to the checkpoint. If None, it will
try to find a pre-defined weight from the model you specified
(only work if the model is a model name). Defaults to None.
device (str, optional) – Device to run inference. If None, the available
device will be automatically used. Defaults to None.
**kwargs – Other keyword arguments to initialize the model (only work if
the model is a model name).
Example
>>> frommmpretrainimportImageCaptionInferencer>>> inferencer=ImageCaptionInferencer('blip-base_3rdparty_caption')>>> inferencer('demo/cat-dog.png')[0]{'pred_caption': 'a puppy and a cat sitting on a blanket'}