From 682c5922d3ebe36d3ed18f096f0ec51465de9af9 Mon Sep 17 00:00:00 2001 From: Siladittya Manna Date: Sun, 14 Aug 2022 18:15:46 +0530 Subject: [PATCH 1/3] Add files via upload --- common/preprocess.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/preprocess.py b/common/preprocess.py index 11483a4..8e428ba 100644 --- a/common/preprocess.py +++ b/common/preprocess.py @@ -246,11 +246,16 @@ def save_cifar(args): LABELS.append('/'.join(j)) LABELS_LIST = CIFAR100_LABELS_LIST COARSE_LABELS_LIST = CIFAR100_SUPERCLASS_LABELS_LIST - + + if not os.path.exists(output): + os.mkdir("{}".format(output)) + for mode in ['train', 'test']: + dirpath = os.path.join(output, mode) + os.mkdir("{}".format(dirpath)) for label in LABELS: dirpath = os.path.join(output, mode, label) - os.system("mkdir -p {}".format(dirpath)) + os.mkdir("{}".format(dirpath)) features, labels , coarse_labels, batch_names = parse_cifar(dataset, mode) @@ -273,4 +278,5 @@ def save_cifar(args): filepath = os.path.join(output, mode, LABELS_LIST[label], filename) image = Image.fromarray(feature) image = image.convert('RGB') + #with open(filepath, 'w+b') as f: image.save(filepath) From 00d2f63518537536ea3036a83c01c1f1bc34b248 Mon Sep 17 00:00:00 2001 From: Siladittya Manna Date: Mon, 15 Apr 2024 13:42:13 +0530 Subject: [PATCH 2/3] Rename cifar2png to cifar2png.py --- cifar2png => cifar2png.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cifar2png => cifar2png.py (100%) diff --git a/cifar2png b/cifar2png.py similarity index 100% rename from cifar2png rename to cifar2png.py From 8388be829a9186ac144223a2f13dbbffbea00d64 Mon Sep 17 00:00:00 2001 From: Siladittya Manna Date: Mon, 15 Apr 2024 13:42:57 +0530 Subject: [PATCH 3/3] Rename cifar2png.py to cifar2png --- cifar2png.py => cifar2png | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cifar2png.py => cifar2png (100%) diff --git a/cifar2png.py b/cifar2png similarity index 100% rename from cifar2png.py rename to cifar2png