parser.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import os
  2. from cvargparse import GPUParser, Arg
  3. from chainer_addons.links import PoolingType
  4. from cvfinetune.parser import default_factory
  5. from cvfinetune import parser as parser_module
  6. def parse_args():
  7. parser = parser_module.FineTuneParser(default_factory([
  8. Arg("--pretrained_on", choices=["inat", "imagenet"],
  9. help="network pretraining"),
  10. # Arg("--normalize", action="store_true",
  11. # help="normalize features after cbil- or alpha-poolings"),
  12. # Arg("--subset", "-s", type=int, nargs="*", default=[-1], help="select specific classes"),
  13. # Arg("--no_sacred", action="store_true", help="do save outputs to sacred"),
  14. # Arg("--use_parts", action="store_true",
  15. # help="use parts, if present"),
  16. # Arg("--simple_parts", action="store_true",
  17. # help="use simple parts classifier, that only concatenates the features"),
  18. # Arg("--no_global", action="store_true",
  19. # help="use parts only, no global feature"),
  20. # Arg("--parts_in_bb", action="store_true", help="take only uniform regions where the centers are inside the bounding box"),
  21. # Arg("--rnd_select", action="store_true", help="hide random uniform regions of the image"),
  22. # Arg("--recurrent", action="store_true", help="observe all parts in recurrent manner instead of the whole image at once"),
  23. # ## AlphaPooling options
  24. # Arg("--init_alpha", type=int, default=1, help="initial parameter for alpha pooling"),
  25. # Arg("--kappa", type=float, default=1., help="Learning rate factor for alpha pooling"),
  26. # Arg("--switch_epochs", type=int, default=0, help="train alpha pooling layer and the rest of the network alternating")
  27. ])
  28. )
  29. return parser.parse_args()