thanard / causal-infogan

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Precomputed image pairs reference wrong image paths

mveres01 opened this issue · comments

The precomputed image pairs in imgs_skipped_1.pkl reference /home/thanard/Downloads/rope_full, and not the paths specified under the data_dir flag in main. So when running, I'm getting a lot of path doesn't exist errors.

This seems to be fine as a workaround, but I'm not sure if there's an easier way to provide the precomputed pairs:

path_to_data_dir = 'XXXXXXX'

filename = 'imgs_skipped_%d.pkl' % k
if os.path.exists(filename):
    with open(filename, 'rb') as f:
        data = pkl.load(f)
    pairs = []
    for d in data:
        idx = d[0][0].index('rope_full')
        path = os.path.join(path_to_data_dir , d[0][0][idx:])
        pair1 = (path, d[0][1])

        idx = d[1][0].index('rope_full')
        path = os.path.join(path_to_data_dir , d[1][0][idx:])
        pair2 = (path, d[1][1])

        pairs.append((pair1, pair2))
    return pairs

edit: Seems this is a similar issue to #2, but is still present in the code