def main():
    from utils.debug import set_working_dir
    # set the working directory as appropriate
    set_working_dir()

    args = parse_args()

    print('Called with argument:', args)
    # update config
    update_config(args.cfg)
    check_config(config)
    train()
Пример #2
0
            if sample_target not in counts:
                counts[sample_target] = 1
            else:
                counts[sample_target] += 1

        return counts


if __name__ == "__main__":
    # use this for debugging and checks
    from utils.debug import set_working_dir
    from config.config import config
    import matplotlib.pyplot as plt

    # set the working directory as appropriate
    set_working_dir()

    # load the dataset
    dataset = StanfordDogsDataset(root_dir=config.dataset.root_dir, split='test')

    # print the stats
    print(dataset.stats())

    # lets plot some samples
    fig = plt.figure()

    for i in range(len(dataset)):
        sample = dataset[i]

        ax = plt.subplot(1, 4, i + 1)
        plt.tight_layout()