Skip to content

Generation mode with format json files

Hye Min edited this page Sep 28, 2018 · 4 revisions

Generation mode with format json files

Mode 10

Mode 10 generates custom A-B|C-D interpolation with A,B,C,D as defined in the input json file. Use option interp_json. For example: --interp_json=interp.json

Example json file:

{ "base_dir" : "samples/garden-256x256-rotate",
  "data" : [["RandGen_20180925-162932_00151", "RandGen_20180925-162932_00365", 12],
	    ["RandGen_20180925-162932_00290", "RandGen_20180925-162932_00400", 24],
	    ["RandGen_20180925-162932_00390", "RandGen_20180925-162932_00440", 39], 
	    ["RandGen_20180925-162932_00294", "RandGen_20180925-162932_00295", 73]]}

base_dir

base_dir is the base directory where files RandGen_20180925-162932_00151.json, etc lies.

data

Data defines the structure of the interpolation. For example [[<A>, <B>, 12], [<C>, <D>, 24]] will interpolate from A to B in 12 frames inclusive of both A and B, then interpolate between C and D in 24 frames.

Notes

There is a bug in the code that is causing the first and last frame of interpolation to be not perfectly the same as the image defined through the json file. Image on the left below is the original image, and on the right is the slightly different image generated by mode 10.
Original Result
We tried a few things:
Eliminating the spherical lerp slerp function.
Appending the python array of seedA, seedB into an empty array and then converting it to numpy array (which is the way it's done in other modes with json input) instead of converting seedA, seedB into numpy array and then concatenating them.
We also tried using the same seed json file with other modes with json seed input and found out that the other modes are reading and generating the image correctly. When the same image was inputted into mode 10, the image was slightly different. From this test, we know the problem doesn't lie in reading/writing the seed json file.

Clone this wiki locally