Fix missing background_image argument

This commit is contained in:
oeway
2020-09-28 21:51:26 +02:00
parent 1691d48e27
commit 5b65ad38b1
16 changed files with 65 additions and 5 deletions

View File

@@ -13,7 +13,6 @@ points = torch.tensor([[120.0, 30.0], # base
[ 60.0, 218.0]]) # base
path = pydiffvg.Path(num_control_points = num_control_points,
points = points,
thickness = None,
is_closed = False,
stroke_width = torch.tensor(5.0))
shapes = [path]
@@ -30,6 +29,7 @@ img = render(256, # width
2, # num_samples_x
2, # num_samples_y
0, # seed
None, # background_image
*scene_args)
# The output image is in linear RGB space. Do Gamma correction before saving the image.
pydiffvg.imwrite(img.cpu(), 'results/single_open_curve/target.png', gamma=2.2)
@@ -54,6 +54,7 @@ img = render(256, # width
2, # num_samples_x
2, # num_samples_y
1, # seed
None, # background_image
*scene_args)
pydiffvg.imwrite(img.cpu(), 'results/single_open_curve/init.png', gamma=2.2)
@@ -74,6 +75,7 @@ for t in range(200):
2, # num_samples_x
2, # num_samples_y
t+1, # seed
None, # background_image
*scene_args)
# Save the intermediate render.
pydiffvg.imwrite(img.cpu(), 'results/single_open_curve/iter_{}.png'.format(t), gamma=2.2)
@@ -106,6 +108,7 @@ img = render(256, # width
2, # num_samples_x
2, # num_samples_y
202, # seed
None, # background_image
*scene_args)
# Save the images and differences.
pydiffvg.imwrite(img.cpu(), 'results/single_open_curve/final.png')