Skip to content

Commit 5ea2030

Browse files
committed
Added default dataset arguments
1 parent c9ac24a commit 5ea2030

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

transforming/augment.py

+22-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from PIL import Image, ImageFilter, ImageOps, ImageEnhance # type: ignore
44
import random
55
from typing import Tuple
6+
import argparse
67

78

89
@hub.compute
@@ -304,8 +305,27 @@ def cvt_padding(
304305

305306
if __name__ == "__main__":
306307

307-
ds_input = hub.load("/input/path")
308-
ds_output = hub.like("/output/path", ds_input)
308+
parser = argparse.ArgumentParser(
309+
description="Augments the input dataset with various operations and saves it to the output dataset"
310+
)
311+
parser.add_argument(
312+
"--input_path",
313+
type=str,
314+
default="hub://activeloop/cifar10-train",
315+
metavar="I",
316+
help="path to input dataset (default: hub://activeloop/cifar10-train)",
317+
)
318+
parser.add_argument(
319+
"--output_path",
320+
type=str,
321+
default="./augmented_dataset",
322+
metavar="O",
323+
help="path to output dataset (default: ./augmented_dataset)",
324+
)
325+
args = parser.parse_args()
326+
327+
ds_input = hub.load(args.input_path)
328+
ds_output = hub.like(args.output_path, ds_input)
309329
pipeline = hub.compose(
310330
[
311331
cvt_horizontal_flip(probability=0.4),

0 commit comments

Comments
 (0)