forked from Archives/langchain
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
438 B
Python
14 lines
438 B
Python
"""Loader that loads image files."""
|
|
from typing import List
|
|
|
|
from langchain.document_loaders.unstructured import UnstructuredFileLoader
|
|
|
|
|
|
class UnstructuredImageLoader(UnstructuredFileLoader):
|
|
"""Loader that uses unstructured to load image files, such as PNGs and JPGs."""
|
|
|
|
def _get_elements(self) -> List:
|
|
from unstructured.partition.image import partition_image
|
|
|
|
return partition_image(filename=self.file_path)
|