in community-efforts/image_preferences/01_synthetic_data_generation_images.py [0:0]
def load_images(batch):
for column in [
"image_quality_dev",
"image_simplified_dev",
"image_quality_sd",
"image_simplified_sd",
]:
batch[f"{column}_loaded"] = []
for i in range(len(batch[column])):
if batch[column][i]:
batch[f"{column}_loaded"].append(
Image.open(
artifacts_path
/ batch[column][i]["path"].replace("artifacts/", "")
)
)
else:
batch[f"{column}_loaded"].append(None)
return batch