File tree 1 file changed +22
-2
lines changed
1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 3
3
from PIL import Image , ImageFilter , ImageOps , ImageEnhance # type: ignore
4
4
import random
5
5
from typing import Tuple
6
+ import argparse
6
7
7
8
8
9
@hub .compute
@@ -304,8 +305,27 @@ def cvt_padding(
304
305
305
306
if __name__ == "__main__" :
306
307
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 )
309
329
pipeline = hub .compose (
310
330
[
311
331
cvt_horizontal_flip (probability = 0.4 ),
You can’t perform that action at this time.
0 commit comments