|
|
@ -1007,6 +1007,7 @@ |
|
|
|
" return (input - input.clamp(-1, 1)).pow(2).mean([1, 2, 3])\n", |
|
|
|
" return (input - input.clamp(-1, 1)).pow(2).mean([1, 2, 3])\n", |
|
|
|
"\n", |
|
|
|
"\n", |
|
|
|
"stop_on_next_loop = False # Make sure GPU memory doesn't get corrupted from cancelling the run mid-way through, allow a full frame to complete\n", |
|
|
|
"stop_on_next_loop = False # Make sure GPU memory doesn't get corrupted from cancelling the run mid-way through, allow a full frame to complete\n", |
|
|
|
|
|
|
|
"TRANSLATION_SCALE = 1.0/200.0\n", |
|
|
|
"\n", |
|
|
|
"\n", |
|
|
|
"def do_3d_step(img_filepath, frame_num, midas_model, midas_transform):\n", |
|
|
|
"def do_3d_step(img_filepath, frame_num, midas_model, midas_transform):\n", |
|
|
|
" if args.key_frames:\n", |
|
|
|
" if args.key_frames:\n", |
|
|
@ -1025,8 +1026,7 @@ |
|
|
|
" f'rotation_3d_z: {rotation_3d_z}',\n", |
|
|
|
" f'rotation_3d_z: {rotation_3d_z}',\n", |
|
|
|
" )\n", |
|
|
|
" )\n", |
|
|
|
"\n", |
|
|
|
"\n", |
|
|
|
" trans_scale = 1.0/200.0\n", |
|
|
|
" translate_xyz = [-translation_x*TRANSLATION_SCALE, translation_y*TRANSLATION_SCALE, -translation_z*TRANSLATION_SCALE]\n", |
|
|
|
" translate_xyz = [-translation_x*trans_scale, translation_y*trans_scale, -translation_z*trans_scale]\n", |
|
|
|
|
|
|
|
" rotate_xyz_degrees = [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('translation:',translate_xyz)\n", |
|
|
|
" print('rotation:',rotate_xyz_degrees)\n", |
|
|
|
" print('rotation:',rotate_xyz_degrees)\n", |
|
|
@ -1423,10 +1423,8 @@ |
|
|
|
" else:\n", |
|
|
|
" else:\n", |
|
|
|
" image.save(f'{batchFolder}/{filename}')\n", |
|
|
|
" image.save(f'{batchFolder}/{filename}')\n", |
|
|
|
"\n", |
|
|
|
"\n", |
|
|
|
" # TODO(VR): trans_scale wasn't set in the PR. This needs to be set to a reasonable value!\n", |
|
|
|
|
|
|
|
" trans_scale = 1.0\n", |
|
|
|
|
|
|
|
" if vr_mode:\n", |
|
|
|
" if vr_mode:\n", |
|
|
|
" generate_eye_views(trans_scale, batchFolder, filename, frame_num, midas_model, midas_transform)\n", |
|
|
|
" generate_eye_views(TRANSLATION_SCALE, batchFolder, filename, frame_num, midas_model, midas_transform)\n", |
|
|
|
"\n", |
|
|
|
"\n", |
|
|
|
" # if frame_num != args.max_frames-1:\n", |
|
|
|
" # if frame_num != args.max_frames-1:\n", |
|
|
|
" # display.clear_output()\n", |
|
|
|
" # display.clear_output()\n", |
|
|
@ -2030,7 +2028,6 @@ |
|
|
|
"#======= VR MODE\n", |
|
|
|
"#======= VR MODE\n", |
|
|
|
"#@markdown ---\n", |
|
|
|
"#@markdown ---\n", |
|
|
|
"#@markdown ####**VR Mode (3D anim only):**\n", |
|
|
|
"#@markdown ####**VR Mode (3D anim only):**\n", |
|
|
|
"#@markdown EXPERIMENTAL ALPHA: Need to look into trans_scale value\n", |
|
|
|
|
|
|
|
"#@markdown Enables stereo rendering of left/right eye views (supporting Turbo) which use a different (fish-eye) camera projection matrix. \n", |
|
|
|
"#@markdown Enables stereo rendering of left/right eye views (supporting Turbo) which use a different (fish-eye) camera projection matrix. \n", |
|
|
|
"#@markdown Note the images you're prompting will work better if they have some inherent wide-angle aspect\n", |
|
|
|
"#@markdown Note the images you're prompting will work better if they have some inherent wide-angle aspect\n", |
|
|
|
"#@markdown The generated images will need to be combined into left/right videos. These can then be stitched into the VR180 format.\n", |
|
|
|
"#@markdown The generated images will need to be combined into left/right videos. These can then be stitched into the VR180 format.\n", |
|
|
|