diff --git a/image_prediction/image_extractor/extractors/parsable.py b/image_prediction/image_extractor/extractors/parsable.py index 0277a5a..d960eeb 100644 --- a/image_prediction/image_extractor/extractors/parsable.py +++ b/image_prediction/image_extractor/extractors/parsable.py @@ -1,11 +1,10 @@ import io from itertools import chain, starmap -from operator import itemgetter, __and__, truth +from operator import itemgetter, truth import fitz from PIL import Image from funcy import rcompose, compose, curry -from iteration_utilities import starfilter from tqdm import tqdm from image_prediction.image_extractor.extractor import ImageExtractor, ImageMetadataPair @@ -49,7 +48,7 @@ class ParsablePDFImageExtractor(ImageExtractor): images = map(load_image_from_xref, xrefs) metadata = map(format_metadata, image_infos) - return starmap(ImageMetadataPair, filter(compose(all, curry(map)(truth)), zip(images, metadata))) + return starmap(ImageMetadataPair, filter(compose(all, curry(map)(truth)), zip(images, metadata))) def extract(self, pdf: bytes): self.doc = fitz.Document(stream=pdf)