Example #1
0
def MnistDataset(dataframe):
    return (Dataset.from_dataframe(dataframe).map(lambda row: (
        Path(row["image_path"]),
        row["class_name"],
    )).starmap(lambda image_path, class_name: problem.Example(
        image=Image.open("prepare" / image_path).resize((32, 32)),
        class_name=class_name,
    )))
Example #2
0
def MnistDataset(dataframe):
    return (
        Dataset.from_dataframe(dataframe)
        .map(lambda row: (
            Path(row['image_path']),
            row['class_name'],
        ))
        .starmap(lambda image_path, class_name: problem.Example(
            image=Image.open('prepare' / image_path),
            class_name=class_name,
        ))
    )
Example #3
0
def CifarDataset(dataframe):
    return (
        Dataset.from_dataframe(dataframe)
        .map(
            lambda row: (
                Path(row["image_path"]),
                row["class_name"],
            )
        )
        .starmap(
            lambda image_path, class_name: problem.Example(
                image=np.array(Image.open("prepare" / image_path)),
                class_name=class_name,
            )
        )
    )