diff --git a/Disco_Diffusion.ipynb b/Disco_Diffusion.ipynb index 8054174..707838e 100644 --- a/Disco_Diffusion.ipynb +++ b/Disco_Diffusion.ipynb @@ -241,11 +241,14 @@ "\n", " IPython magic commands replaced by Python code\n", "\n", - " v5.1 Update: March 30th 2022 - zippy / Chris Allen - c/o gandamu / Adam Letts\n", + " v5.1 Update: March 30th 2022 - zippy / Chris Allen and gandamu / Adam Letts\n", "\n", " Integrated Turbo+Smooth features from Disco Diffusion Turbo -- just the implementation, without its defaults.\n", + "\n", " Implemented resume of turbo animations in such a way that it's now possible to resume from different batch folders and batch numbers.\n", "\n", + " 3D rotation parameter units are now degrees (rather than radians)\n", + "\n", " '''\n", " )\n" ], @@ -1030,9 +1033,10 @@ " img_filepath = '/content/prevFrame.png' if is_colab else 'prevFrame.png'\n", " trans_scale = 1.0/200.0\n", " translate_xyz = [-translation_x*trans_scale, translation_y*trans_scale, -translation_z*trans_scale]\n", - " rotate_xyz = [rotation_3d_x, rotation_3d_y, rotation_3d_z]\n", + " rotate_xyz_degrees = [rotation_3d_x, rotation_3d_y, rotation_3d_z]\n", " print('translation:',translate_xyz)\n", - " print('rotation:',rotate_xyz)\n", + " print('rotation:',rotate_xyz_degrees)\n", + " rotate_xyz = [math.radians(rotate_xyz_degrees[0]), math.radians(rotate_xyz_degrees[1]), math.radians(rotate_xyz_degrees[2])]\n", " rot_mat = p3dT.euler_angles_to_matrix(torch.tensor(rotate_xyz, device=device), \"XYZ\").unsqueeze(0)\n", " print(\"rot_mat: \" + str(rot_mat))\n", " next_step_pil = dxf.transform_image_3d(img_filepath, midas_model, midas_transform, DEVICE,\n", @@ -2537,6 +2541,7 @@ "\n", "#@markdown ####**2D Animation Settings:**\n", "#@markdown `zoom` is a multiplier of dimensions, 1 is no zoom.\n", + "#@markdown All rotations are provided in degrees.\n", "\n", "key_frames = True #@param {type:\"boolean\"}\n", "max_frames = 10000#@param {type:\"number\"}\n", diff --git a/disco.py b/disco.py index 231bbfe..f3903f2 100644 --- a/disco.py +++ b/disco.py @@ -938,9 +938,10 @@ def do_3d_step(img_filepath, frame_num, midas_model, midas_transform): img_filepath = '/content/prevFrame.png' if is_colab else 'prevFrame.png' trans_scale = 1.0/200.0 translate_xyz = [-translation_x*trans_scale, translation_y*trans_scale, -translation_z*trans_scale] - rotate_xyz = [rotation_3d_x, rotation_3d_y, rotation_3d_z] + rotate_xyz_degrees = [rotation_3d_x, rotation_3d_y, rotation_3d_z] print('translation:',translate_xyz) - print('rotation:',rotate_xyz) + print('rotation:',rotate_xyz_degrees) + rotate_xyz = [math.radians(rotate_xyz_degrees[0]), math.radians(rotate_xyz_degrees[1]), math.radians(rotate_xyz_degrees[2])] rot_mat = p3dT.euler_angles_to_matrix(torch.tensor(rotate_xyz, device=device), "XYZ").unsqueeze(0) print("rot_mat: " + str(rot_mat)) next_step_pil = dxf.transform_image_3d(img_filepath, midas_model, midas_transform, DEVICE, @@ -2394,6 +2395,7 @@ if animation_mode == "Video Input": #@markdown ####**2D Animation Settings:** #@markdown `zoom` is a multiplier of dimensions, 1 is no zoom. +#@markdown All rotations are provided in degrees. key_frames = True #@param {type:"boolean"} max_frames = 10000#@param {type:"number"}