1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- from cvargparse import BaseParser, Arg
- from cvdatasets.annotations import AnnotationType
- from cvdatasets.utils import read_info_file
- DEFAULT_INFO_FILE="/home/korsch/Data/info.yml"
- info_file = read_info_file(DEFAULT_INFO_FILE)
- def parse_args():
- parser = BaseParser([
- Arg("data", default=DEFAULT_INFO_FILE),
- Arg("dataset", choices=info_file.DATASETS.keys()),
- Arg("parts", default="GLOBAL", choices=info_file.PARTS.keys()),
- Arg("--feature_model", "-fm",
- choices=["inception", "inception_tf", "resnet"]),
- Arg("--subset", "-sub",
- help="Possible subsets: train, test",
- choices=["train", "test"],
- default="train", type=str),
- Arg("--start", "-s",
- help="Image id to start with",
- type=int, default=0),
- Arg("--n_images", "-n",
- help="Number of images to display",
- type=int, default=10),
- Arg("--only_class",
- help="display only the given class",
- type=int, default=-1),
- Arg("--rnd",
- help="select random subset of present parts",
- action="store_true"),
- Arg("--no_bboxes",
- help="Do not display bounding boxes",
- action="store_true"),
- Arg("--no_parts",
- help="Do not display parts",
- action="store_true"),
- Arg("--crop_to_bb",
- help="Crop image to the bounding box",
- action="store_true"),
- Arg("--no_center_crop", action="store_true"),
- Arg("--crop_uniform",
- help="Try to extend the bounding box to same height and width",
- action="store_true"),
- Arg("--parts_in_bb",
- help="Only display parts, that are inside the bounding box",
- action="store_true"),
- Arg("--features",
- help="pre-extracted train and test features",
- default=[None, None],
- nargs=2, type=str),
- Arg("--ratio",
- help="Part extraction ratio",
- type=float, default=.2),
- Arg("--rescale_size",
- help="rescales the part positions from this size to original image size",
- type=int, default=-1),
- Arg("--uniform_parts", "-u",
- help="Do not use GT parts, but sample parts uniformly from the image",
- action="store_true"),
- Arg('--seed', type=int, default=12311123,
- help='random seed'),
- ])
- parser.init_logger()
- return parser.parse_args()
|