Skip to content

Commit

Permalink
DTrOCR-5 - Issue with the error :
Browse files Browse the repository at this point in the history
* DTrOCR-5 - Issue with the error :

* DTrOCR-5 - Issue with the error : - Minor optimisation
  • Loading branch information
arvindrajan92 authored Jul 29, 2024
1 parent 45b7dcf commit 610feaf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dtrocr/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,18 @@ def __call__(
images: Union[Image.Image, List[Image.Image]] = None,
texts: Union[str, List[str]] = None,
return_labels: bool = False,
input_data_format: str = 'channels_last',
padding: Union[bool, str] = False,
*args,
**kwargs
) -> DTrOCRProcessorOutput:
text_inputs = self.tokeniser(texts, *args, **kwargs) if texts is not None else None
image_inputs = self.vit_processor(images, *args, **kwargs) if images is not None else None
text_inputs = self.tokeniser(
texts, padding=padding, *args, **kwargs
) if texts is not None else None

image_inputs = self.vit_processor(
images, input_data_format=input_data_format, *args, **kwargs
) if images is not None else None

return DTrOCRProcessorOutput(
pixel_values=image_inputs["pixel_values"] if images is not None else None,
Expand Down

0 comments on commit 610feaf

Please sign in to comment.