File size: 4,375 Bytes
e6565e5 dcc4583 e6565e5 dcc4583 e6565e5 dcc4583 e6565e5 dcc4583 e6565e5 dcc4583 e6565e5 dcc4583 e6565e5 dcc4583 e6565e5 |
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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
import os
import sys
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("--check-environment", action="store_true", help="Whether to do the environment checking")
parser.add_argument("--download-checkpoints", action="store_true", help="Whether to download the checkpoints")
parser.add_argument("--rgb", type=str, default=None, help="RGB video input")
parser.add_argument("--hdmap", type=str, required=True, help="HD Map video input")
parser.add_argument("--lidar", type=str, required=True, help="Lidar video input")
parser.add_argument(
"--prompt",
type=str,
default="The video is captured from a camera mounted on a car. The camera is facing forward. The video showcases a scenic golden-hour drive through a suburban area, bathed in the warm, golden hues of the setting sun. The dashboard camera captures the play of light and shadow as the sun’s rays filter through the trees, casting elongated patterns onto the road. The streetlights remain off, as the golden glow of the late afternoon sun provides ample illumination. The two-lane road appears to shimmer under the soft light, while the concrete barrier on the left side of the road reflects subtle warm tones. The stone wall on the right, adorned with lush greenery, stands out vibrantly under the golden light, with the palm trees swaying gently in the evening breeze. Several parked vehicles, including white sedans and vans, are seen on the left side of the road, their surfaces reflecting the amber hues of the sunset. The trees, now highlighted in a golden halo, cast intricate shadows onto the pavement. Further ahead, houses with red-tiled roofs glow warmly in the fading light, standing out against the sky, which transitions from deep orange to soft pastel blue. As the vehicle continues, a white sedan is seen driving in the same lane, while a black sedan and a white van move further ahead. The road markings are crisp, and the entire setting radiates a peaceful, almost cinematic beauty. The golden light, combined with the quiet suburban landscape, creates an atmosphere of tranquility and warmth, making for a mesmerizing and soothing drive.", # noqa: E501
help="prompt which the sampled video condition on",
)
parser.add_argument(
"--negative-prompt",
type=str,
default="The video captures a game playing, with bad crappy graphics and cartoonish frames. It represents a recording of old outdated games. The lighting looks very fake. The textures are very raw and basic. The geometries are very primitive. The images are very pixelated and of poor CG quality. There are many subtitles in the footage. Overall, the video is unrealistic at all.", # noqa: E501
help="negative prompt which the sampled video condition on",
)
parser.add_argument("--seed", type=int, default=1, help="Random seed")
parser.add_argument("--randomize-seed", action="store_true", help="Randomize seed")
parser.add_argument("--chunking-size", type=int, default=0, help="Chunking size (0 for no chunking)")
args = parser.parse_args()
# setup env
os.environ["CUDA_HOME"] = "/usr/local/cuda"
os.environ["LD_LIBRARY_PATH"] = "$CUDA_HOME/lib:$CUDA_HOME/lib64:$LD_LIBRARY_PATH"
os.environ["PATH"] = "$CUDA_HOME/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:$PATH"
if args.check_environment:
from test_environment import main as check_environment
if not check_environment():
sys.exit(1)
else:
print("Skipping the environment checking")
from helper import PWD
CHECKPOINTS_PATH = os.path.join(PWD, "checkpoints")
# download checkpoints
if args.download_checkpoints:
from download_checkpoints import main as download_checkpoints
os.makedirs(CHECKPOINTS_PATH, exist_ok=True)
download_checkpoints(hf_token="", output_dir=CHECKPOINTS_PATH, model="7b_av")
from helper import generate_video_fun
generate_video_fun(CHECKPOINTS_PATH)(
rgb_video_path=args.rgb,
hdmap_video_input=args.hdmap,
lidar_video_input=args.lidar,
prompt=args.prompt,
negative_prompt=args.negative_prompt,
seed=args.seed,
randomize_seed=args.randomize_seed,
chunking=args.chunking_size,
)
|