Skip to content

Commit

Permalink
Change absolute path to relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
ronensc committed Apr 26, 2022
1 parent ac4fbc5 commit 690a58a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions scripts/reshuffle.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
import os
from pathlib import Path
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

import distribution_metrics
Expand All @@ -23,6 +24,7 @@ def reshuffle(dataset_dir, out_dir, n_reps=1):

if __name__ == '__main__':
out_dir = "outputs/reshuffle"
reshuffle('/home/ariel/university/GPDM/images/SIGD16', out_dir)
reshuffle('/home/ariel/university/GPDM/images/Places50', out_dir)
reshuffle('/home/ariel/university/GPDM/images/reshuffle', out_dir)
base_dir = Path(__file__).parent.parent
reshuffle(base_dir / 'images/SIGD16', out_dir)
reshuffle(base_dir / 'images/Places50', out_dir)
reshuffle(base_dir / 'images/reshuffle', out_dir)
4 changes: 3 additions & 1 deletion scripts/reshuffle_HD_image.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
import os
from pathlib import Path
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

import distribution_metrics
Expand Down Expand Up @@ -27,7 +28,8 @@ def reshuffle_hq(image_paths, out_dir, n_reps=1):
if __name__ == '__main__':

image_paths = []
dataset_dir = '/home/ariel/university/GPDM/images/HQ_16'
base_dir = Path(__file__).parent.parent
dataset_dir = base_dir / 'images/HQ_16'
image_paths += [os.path.join(dataset_dir, x) for x in os.listdir(dataset_dir)]
image_paths = [x for x in image_paths if ('rio' in x or 'lambs' in x or 'safari' in x)]

Expand Down

0 comments on commit 690a58a

Please sign in to comment.