(self, image_size: int, list_path: str)
| 24 | class Dataset(torch.utils.data.Dataset): |
| 25 | |
| 26 | def __init__(self, image_size: int, list_path: str) -> None: |
| 27 | if list_path.endswith(".csv"): |
| 28 | df = pd.read_csv(list_path, sep="\t") |
| 29 | elif list_path.endswith(".parquet"): |
| 30 | df = pd.read_parquet(list_path) |
| 31 | else: |
| 32 | raise NotImplementedError("List path has unknown extension: " + list_path) |
| 33 | |
| 34 | self.urls = df["url"].tolist() |
| 35 | self.transform = get_transform("padded_resize", image_size) |
| 36 | self.tokenizer = None |
| 37 | |
| 38 | def __len__(self) -> int: |
| 39 | return len(self.urls) |
nothing calls this directly
no test coverage detected