debug = False

    D = AggregatedMultiPersonDataset(
        {'spatial_size': 256},
        root='/export/scratch/jhaux/Data/trickyoga',
        ext='mp4',
        force=True,  # See if new videos are ready!
        debug=debug)
    D2 = AggregatedMultiPersonDataset(
        {'spatial_size': 256},
        root='/export/scratch/jhaux/Data/olympic_sports_new',
        ext='seq',
        force=False,  # See if new videos are ready!
        debug=debug)

    d = D[10]
    tab = pp2mkdtable(d)
    plot_datum(d, 'ty_10.png')
    print(tab)

    d = D2[10]
    tab = pp2mkdtable(d)
    plot_datum(d, 'oly_10.png')
    print(tab)

    print("D1: {}\nD2: {}".format(len(D), len(D2)))

    with open('multiperson.md', 'w+') as df:
        df.write(tab)
Example #2
0
    }

    def fn(val):
        print(val)
        return -val

    new = walk(nested, fn)

    print(nested)
    print(new)

    pprint(nested)

    print(pp2mkdtable(nested))

    plot_datum(nested)

    dol = {"a": [1, 2], "b": {"c": {"d": 1}, "e": 2}}

    print(dol)
    print("set_value(dol, 'a/0', 3)")
    set_value(dol, "a/0", 3)

    print(dol)
    print({"a": [3, 2], "b": {"c": {"d": 1}, "e": 2}})
    # {'a': [3, 2], 'b': {'c': {'d': 1}, 'e': 2}}}
    print("-" * 10)

    print(dol)
    print("set_value(dol, 'b/e', 3)")
    set_value(dol, "b/e", 3)
Example #3
0
    d['im_crop'] = im_crop

    plot_kps(d, idx)


if __name__ == '__main__':
    from multiperson_dataset import MultiPersonDataset

    # MP = MultiPersonDataset('/export/scratch/jhaux/Data/olympic sports/')
    MP = MultiPersonDataset('/export/scratch/jhaux/Data/olympic_test/')
    CMP = CropDataset(MP)

    from edflow.util import pprint, pp2mkdtable
    from edflow.data.util import plot_datum

    idx = 10

    for idx in range(25):
        d = CMP[idx]
        print(pp2mkdtable(d))
        plot_datum(d, 'crop_{}.png'.format(idx))

        test_new_crop(d, idx)

    for idx in np.random.randint(len(CMP), size=10):
        d = CMP[idx]
        print(pp2mkdtable(d))
        plot_datum(d, 'crop_{}.png'.format(idx))

        test_new_crop(d, idx)