Skip to content

Commit 474c20d

Browse files
committed
scripts: test: add option to use reference images from Git repository
1 parent e050ac8 commit 474c20d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/test.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,14 @@
4242
cfg.data_dir = os.path.join(training_dir, 'data')
4343
if cfg.results_dir is None:
4444
cfg.results_dir = os.path.join(training_dir, 'results')
45+
4546
if cfg.baseline_dir is None:
46-
cfg.baseline_dir = os.path.join(training_dir, 'baseline_' + BASELINE_VERSION)
47+
baseline_img_repo = os.environ.get('OIDN_VALIDATION_REPO')
48+
if baseline_img_repo is not None:
49+
run(f'git clone --branch {BASELINE_VERSION} --single-branch --depth 1 "{baseline_img_repo}" baseline_images_repo')
50+
cfg.baseline_dir = os.path.join('baseline_images_repo', 'images')
51+
else:
52+
cfg.baseline_dir = os.path.join(training_dir, 'baseline_' + BASELINE_VERSION)
4753

4854
if cfg.command == 'run':
4955
# Detect the OIDN binary directory

0 commit comments

Comments
 (0)