def create_generator(args):
    transform_generator = random_transform_generator(flip_x_chance=0.5)
    if (args.dataset_type == 'coco'):
        from ..preprocessing.coco import CocoGenerator
        generator = CocoGenerator(args.coco_path, args.coco_set, transform_generator=transform_generator)
    elif (args.dataset_type == 'csv'):
        from ..preprocessing.csv_generator import CSVGenerator
        generator = CSVGenerator(args.annotations, args.classes, transform_generator=transform_generator)
    else:
        raise ValueError('Invalid data type received: {}'.format(args.dataset_type))
    return generator
def create_generator(args):
    transform_generator = random_transform_generator(flip_x_chance=0.5)
    if (args.dataset_type == 'coco'):
        from ..preprocessing.coco import CocoGenerator
        generator = CocoGenerator(args.coco_path, args.coco_set, transform_generator=transform_generator)
    elif (args.dataset_type == 'csv'):
        from ..preprocessing.csv_generator import CSVGenerator
        generator = CSVGenerator(args.annotations, args.classes, transform_generator=transform_generator)
    else:
        raise ValueError('Invalid data type received: {}'.format(args.dataset_type))
    return generator