-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathfull_size_with_crops.py
More file actions
52 lines (45 loc) · 1.79 KB
/
Copy pathfull_size_with_crops.py
File metadata and controls
52 lines (45 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import simpleimageio as sio
import figuregen
from figuregen.util.templates import FullSizeWithCrops
from figuregen.util.image import Cropbox
figure = FullSizeWithCrops(
reference_image=sio.read("images/pool/pool.exr"),
method_images=[
sio.read("images/pool/pool-60s-path.exr"),
sio.read("images/pool/pool-60s-upsmcmc.exr"),
sio.read("images/pool/pool-60s-radiance.exr"),
sio.read("images/pool/pool-60s-full.exr"),
],
crops=[
Cropbox(top=100, left=200, height=96, width=128, scale=5),
Cropbox(top=100, left=450, height=96, width=128, scale=5),
],
method_names=["Reference", "Path Tracer", "UPS+MCMC", "Radiance-based", "Ours"]
).figure
figuregen.figure(figure, width_cm=17.7, filename="full_size_with_crops.pdf")
try:
from figuregen.util import jupyter
jupyter.convert('full_size_with_crops.pdf', 300)
except:
print('Warning: pdf could not be converted to png')
# Create the same figure again, but this time with the crops on the right hand side of each image
figure = FullSizeWithCrops(
reference_image=sio.read("images/pool/pool.exr"),
method_images=[
sio.read("images/pool/pool-60s-path.exr"),
sio.read("images/pool/pool-60s-radiance.exr"),
sio.read("images/pool/pool-60s-full.exr"),
],
crops=[
Cropbox(top=100, left=200, height=96, width=128, scale=5),
Cropbox(top=100, left=450, height=96, width=128, scale=5),
],
method_names=["Reference", "Path Tracer", "UPS+MCMC", "Radiance-based", "Ours"],
crops_below=False
).figure
figuregen.figure(figure, width_cm=17.7, filename="full_size_with_crops_side.pdf")
try:
from figuregen.util import jupyter
jupyter.convert('full_size_with_crops_side.pdf', 300)
except:
print('Warning: pdf could not be converted to png')