Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

gandlf_preprocess 2.2 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
  1. #!usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import argparse
  4. from GANDLF.cli import preprocess_and_save, copyrightMessage
  5. # main function
  6. if __name__ == "__main__":
  7. parser = argparse.ArgumentParser(
  8. prog="GANDLF_Preprocess",
  9. formatter_class=argparse.RawTextHelpFormatter,
  10. description="Generate training/inference data which are preprocessed to reduce resource footprint during computation.\n\n"
  11. + copyrightMessage,
  12. )
  13. parser.add_argument(
  14. "-c",
  15. "--config",
  16. metavar="",
  17. type=str,
  18. help="The configuration file (contains all the information related to the training/inference session), this is read from 'output' during inference",
  19. required=True,
  20. )
  21. parser.add_argument(
  22. "-i",
  23. "--inputdata",
  24. metavar="",
  25. type=str,
  26. help="Data csv file that is used for training/inference",
  27. required=True,
  28. )
  29. parser.add_argument(
  30. "-o",
  31. "--output",
  32. metavar="",
  33. type=str,
  34. help="Output directory to save intermediate files and model weights",
  35. required=True,
  36. )
  37. parser.add_argument(
  38. "-l",
  39. "--labelPad",
  40. metavar="",
  41. type=str,
  42. default="constant",
  43. help="This specifies the padding strategy for the label when 'patch_sampler' is 'label'. Defaults to 'constant' [full list: https://numpy.org/doc/stable/reference/generated/numpy.pad.html]",
  44. required=False,
  45. )
  46. parser.add_argument(
  47. "-a",
  48. "--applyaugs",
  49. metavar="",
  50. type=bool,
  51. default=False,
  52. help="This specifies the whether to apply data augmentation during output creation. Defaults to False",
  53. required=False,
  54. )
  55. parser.add_argument(
  56. "-a",
  57. "--cropzero",
  58. metavar="",
  59. type=bool,
  60. default=False,
  61. help="This specifies the whether to apply zero cropping during output creation. Defaults to False",
  62. required=False,
  63. )
  64. args = parser.parse_args()
  65. preprocess_and_save(
  66. args.inputdata,
  67. args.config,
  68. args.output,
  69. args.labelPad,
  70. args.applyaugs,
  71. args.cropzero,
  72. )
  73. print("Finished.")
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...