mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
This commit is contained in:
parent
f6c540db72
commit
52f2dbe9ef
@ -16,7 +16,6 @@
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
from datasets import load_dataset
|
||||
from huggingface_hub import hf_hub_download
|
||||
|
||||
from transformers.testing_utils import require_torch, require_vision
|
||||
@ -87,8 +86,15 @@ class NougatImageProcessingTester:
|
||||
return self.num_channels, self.size["height"], self.size["width"]
|
||||
|
||||
def prepare_dummy_image(self):
|
||||
ds = load_dataset("hf-internal-testing/fixtures_docvqa", split="test")
|
||||
return ds[0]["image"].convert("RGB")
|
||||
revision = "ec57bf8c8b1653a209c13f6e9ee66b12df0fc2db"
|
||||
filepath = hf_hub_download(
|
||||
repo_id="hf-internal-testing/fixtures_docvqa",
|
||||
filename="nougat_pdf.png",
|
||||
repo_type="dataset",
|
||||
revision=revision,
|
||||
)
|
||||
image = Image.open(filepath).convert("RGB")
|
||||
return image
|
||||
|
||||
def prepare_image_inputs(self, equal_resolution=False, numpify=False, torchify=False):
|
||||
return prepare_image_inputs(
|
||||
|
Loading…
Reference in New Issue
Block a user