From a073c74360512e24a9b2d1e76fd38cb3aa5e88d2 Mon Sep 17 00:00:00 2001 From: "jules@lens" Date: Thu, 19 Apr 2018 00:13:32 +0200 Subject: training!! --- .gitignore | 1 + data/recursive_dataset.py | 4 ++++ recursive.sh | 2 +- test.py | 4 +++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4fdef3e..7290625 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ test/.coverage test/data/legacy_serialized.pt *~ .idea +recursive/ diff --git a/data/recursive_dataset.py b/data/recursive_dataset.py index b51777f..1b79255 100644 --- a/data/recursive_dataset.py +++ b/data/recursive_dataset.py @@ -1,3 +1,5 @@ +import os +import time import os.path from data.base_dataset import BaseDataset, get_transform from data.image_folder import make_dataset @@ -37,6 +39,8 @@ class RecursiveDataset(BaseDataset): def __getitem__(self, index): A_path = "/home/lens/code/pytorch-CycleGAN-and-pix2pix/recursive/frame_{:04d}.png".format(index) print('next image: ' + A_path) + while not os.path.exists(A_path): + time.sleep(0.1) A_img = Image.open(A_path).convert('RGB') A = self.transform(A_img) if self.opt.which_direction == 'BtoA': diff --git a/recursive.sh b/recursive.sh index 3cff152..a3856ab 100755 --- a/recursive.sh +++ b/recursive.sh @@ -1,7 +1,7 @@ python test.py \ --dataroot /home/lens/Desktop/thumbs/woodscaled_4/A/train/ \ --name woodscaled_4_pix2pix \ - --how_many 2 \ + --how_many 2000 \ --model test \ --which_model_netG unet_256 \ --which_direction AtoB \ diff --git a/test.py b/test.py index 066c6c1..2c37e90 100644 --- a/test.py +++ b/test.py @@ -7,6 +7,7 @@ from util import html import subprocess +from time import sleep if __name__ == '__main__': opt = TestOptions().parse() @@ -37,9 +38,10 @@ if __name__ == '__main__': if dataset.name() == 'RecursiveDatasetDataLoader': last_image = "results/woodscaled_4_pix2pix/test_latest/images/" + ims[1] next_image = "recursive/frame_{:04d}.png".format(i+1) + print(last_image) + print(next_image) cmd = ("/bin/cp", last_image, next_image) process = subprocess.Popen(cmd, stdout=subprocess.PIPE) output, error = process.communicate() - dataset.append(next_image) webpage.save() -- cgit v1.2.3-70-g09d2