langchain_community.document_loaders.image_captions
加载图像标题。
默认情况下,加载器使用预训练的 Salesforce BLIP 图像标题模型。 https://huggingface.co/Salesforce/blip-image-captioning-base
用图像数据(字节)或文件路径列表初始化
images:单个图像或图像列表。接受图像数据(字节)或图像文件路径。 blip_processor:预训练的BLIP处理器的名称。 blip_model:预训练的BLIP模型的名称。
Methods
__init__(images[, blip_processor, blip_model])
__init__
alazy_load()
alazy_load
一个用于文档的惰性加载器。
aload()
aload
将数据加载到文档对象中。
lazy_load()
lazy_load
load()
load
从图像数据或文件路径列表中加载数据
load_and_split([text_splitter])
load_and_split
加载文档并分割成块。块作为文档返回。
images (Union[str, Path, bytes, List[Union[str, bytes, Path]]]) –
blip_processor (str) –
blip_model (str) –
AsyncIterator[Document]
List[Document]
Iterator[Document]
不要覆盖此方法。应该被视为已弃用!
默认为RecursiveCharacterTextSplitter。
文档列表。
text_splitter (Optional[TextSplitter]) –
image_captions.md