Skip to content

Commit e4062f4

Browse files
authored
Merge branch 'main' into add-vit-swag-huge
2 parents dd21912 + 3130b45 commit e4062f4

File tree

9 files changed

+452
-86
lines changed

9 files changed

+452
-86
lines changed

.circleci/config.yml

Lines changed: 68 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.circleci/regenerate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def build_workflows(prefix="", filter_branch=None, upload=False, indentation=6,
3232
for os_type in ["linux", "macos", "win"]:
3333
python_versions = PYTHON_VERSIONS
3434
cu_versions_dict = {
35-
"linux": ["cpu", "cu102", "cu113", "cu115", "rocm4.3.1", "rocm4.5.2"],
35+
"linux": ["cpu", "cu102", "cu113", "cu115", "rocm4.5.2", "rocm5.0"],
3636
"win": ["cpu", "cu113", "cu115"],
3737
"macos": ["cpu"],
3838
}

test/builtin_dataset_mocks.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,44 @@ def country211(info, root, config):
911911
return num_examples * len(classes)
912912

913913

914+
@register_mock
915+
def food101(info, root, config):
916+
data_folder = root / "food-101"
917+
918+
num_images_per_class = 3
919+
image_folder = data_folder / "images"
920+
categories = ["apple_pie", "baby_back_ribs", "waffles"]
921+
image_ids = []
922+
for category in categories:
923+
image_files = create_image_folder(
924+
image_folder,
925+
category,
926+
file_name_fn=lambda idx: f"{idx:04d}.jpg",
927+
num_examples=num_images_per_class,
928+
)
929+
image_ids.extend(path.relative_to(path.parents[1]).with_suffix("").as_posix() for path in image_files)
930+
931+
meta_folder = data_folder / "meta"
932+
meta_folder.mkdir()
933+
934+
with open(meta_folder / "classes.txt", "w") as file:
935+
for category in categories:
936+
file.write(f"{category}\n")
937+
938+
splits = ["train", "test"]
939+
num_samples_map = {}
940+
for offset, split in enumerate(splits):
941+
image_ids_in_split = image_ids[offset :: len(splits)]
942+
num_samples_map[split] = len(image_ids_in_split)
943+
with open(meta_folder / f"{split}.txt", "w") as file:
944+
for image_id in image_ids_in_split:
945+
file.write(f"{image_id}\n")
946+
947+
make_tar(root, f"{data_folder.name}.tar.gz", compression="gz")
948+
949+
return num_samples_map[config.split]
950+
951+
914952
@register_mock
915953
def dtd(info, root, config):
916954
data_folder = root / "dtd"

0 commit comments

Comments
 (0)