parser.py 1.7 KB

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