summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-15 02:42:33 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-15 02:42:33 +0200
commit743c7ee58013ab6095ee545e723fa06704350f14 (patch)
tree2be98257cbe16ba67478441e5b8a48c3ea6c5855
parent86a8bc3914d455a16027d35e7a056bcc5ce189c1 (diff)
test
-rw-r--r--data/recursive_dataset.py2
-rw-r--r--test-mogrify.py19
2 files changed, 13 insertions, 8 deletions
diff --git a/data/recursive_dataset.py b/data/recursive_dataset.py
index 156f161..762e391 100644
--- a/data/recursive_dataset.py
+++ b/data/recursive_dataset.py
@@ -20,7 +20,7 @@ class RecursiveDataset(BaseDataset):
self.transform = get_transform(opt)
def __getitem__(self, index):
- A_path = self.opt.results_dir + self.opt.name + "/exp:" + self.opt.experiment + "/frame_{:05d}.png".format(index)
+ A_path = self.opt.results_dir + self.opt.tag + "/frame_{:05d}.png".format(index)
while not os.path.exists(A_path):
time.sleep(0.01)
A_img = Image.open(A_path).convert('RGB')
diff --git a/test-mogrify.py b/test-mogrify.py
index 7c3c84a..98a4e15 100644
--- a/test-mogrify.py
+++ b/test-mogrify.py
@@ -21,11 +21,21 @@ from time import sleep
if __name__ == '__main__':
opt = TestOptions().parse()
data_opt = DatasetOptions().parse(opt.unknown)
+
+ d = datetime.now()
+ tag = "{}_{}_{}_{}".format(
+ opt.name, opt.experiment, data_opt.experiment,
+ # opt.how_many, frac_a,
+ # blur, sigma, canny_lo, canny_hi,
+ d.strftime('%Y%m%d%H%M'))
+
+ opt.tag = tag
+
opt.nThreads = 1 # test code only supports nThreads = 1
opt.batchSize = 1 # test code only supports batchSize = 1
opt.serial_batches = True # no shuffle
opt.no_flip = True # no flip
- opt.experiment = opt.start_img.split("/")[-1].split(".")[0]
+ opt.experiment = data_opt.experiment # opt.start_img.split("/")[-1].split(".")[0]
render_dir = opt.results_dir + opt.name + "/" + data_opt.experiment + "/"
@@ -120,12 +130,7 @@ if __name__ == '__main__':
os.remove(render_dir + "frame_00000.png")
- d = datetime.now()
- video_fn = "{}_{}_{}_{}_mogrify.mp4".format(
- opt.name, opt.experiment, data_opt.experiment,
- # opt.how_many, frac_a,
- # blur, sigma, canny_lo, canny_hi,
- d.strftime('%Y%m%d%H%M'))
+ video_fn = tag + "_mogrify.mp4"
cmd = ("ffmpeg", "-i", render_dir + "ren_%05d.png", "-y", "-c:v", "libx264", "-vf", "fps=30", "-pix_fmt", "yuv420p", "-s", "455x256", render_dir + video_fn)
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)