-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrun_interpolation.py
More file actions
31 lines (25 loc) · 908 Bytes
/
run_interpolation.py
File metadata and controls
31 lines (25 loc) · 908 Bytes
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
from deep_sdf import plotting
import matplotlib
import json
import numpy as np
from random import choice
import os
with open("examples/splits/sv2_planes_lamps_train.json") as f:
splits = json.load(f)
shape_id_choices = splits["ShapeNetV2"]["02691156"]
i = 0
while True:
i += 1
shape_id_1 = choice(shape_id_choices)
shape_id_2 = choice(shape_id_choices)
os.makedirs(f"interpolation/{i}_{shape_id_1}_{shape_id_2}", exist_ok=True)
# single image takes approx. 20sec -x30-> 600sec=10min
for j, w in enumerate(np.linspace(0.0, 1.0, 30)):
fig = plotting.plot_lat_interpolation(
exp_dir = "examples/planes_lamps",
shape_id_1 = shape_id_1,
shape_id_2 = shape_id_2,
interpolation_weight = w,
checkpoint = 3000,
)
fig.savefig(f"interpolation/{i}_{shape_id_1}_{shape_id_2}/{j:06}.jpg")