

We can use an image processor from either of the models, as in this case they return the same output with same resolution. We will use the map() method of dataset to apply the preprocessing to every split of the dataset. 
thon
from transformers import AutoImageProcessor
teacher_processor = AutoImageProcessor.from_pretrained("merve/beans-vit-224")
def process(examples):
    processed_inputs = teacher_processor(examples["image"])
    return processed_inputs
processed_datasets = dataset.map(process, batched=True)