@@ -39,6 +39,7 @@ def visualize_reconstruction(
3939 visdom_server : str = "http://127.0.0.1" ,
4040 visdom_port : int = 8097 ,
4141 visdom_env : Optional [str ] = None ,
42+ ** render_flyaround_kwargs ,
4243) -> None :
4344 """
4445 Given an `exp_dir` containing a trained Implicitron model, generates videos consisting
@@ -60,6 +61,8 @@ def visualize_reconstruction(
6061 visdom_server: The address of the visdom server.
6162 visdom_port: The port of the visdom server.
6263 visdom_env: If set, defines a custom name for the visdom environment.
64+ render_flyaround_kwargs: Keyword arguments passed to the invoked `render_flyaround`
65+ function (see `pytorch3d.implicitron.models.visualization.render_flyaround`).
6366 """
6467
6568 # In case an output directory is specified use it. If no output_directory
@@ -115,20 +118,22 @@ def visualize_reconstruction(
115118 # iterate over the sequences in the dataset
116119 for sequence_name in dataset .sequence_names ():
117120 with torch .no_grad ():
118- render_flyaround (
119- dataset = dataset ,
120- sequence_name = sequence_name ,
121- model = model ,
122- output_video_path = os .path .join (output_directory , "video" ),
123- n_source_views = n_source_views ,
124- visdom_show_preds = visdom_show_preds ,
125- n_flyaround_poses = n_eval_cameras ,
126- visdom_server = visdom_server ,
127- visdom_port = visdom_port ,
128- visdom_environment = visdom_env ,
129- video_resize = video_size ,
130- device = device ,
131- )
121+ render_kwargs = {
122+ "dataset" : dataset ,
123+ "sequence_name" : sequence_name ,
124+ "model" : model ,
125+ "output_video_path" : os .path .join (output_directory , "video" ),
126+ "n_source_views" : n_source_views ,
127+ "visdom_show_preds" : visdom_show_preds ,
128+ "n_flyaround_poses" : n_eval_cameras ,
129+ "visdom_server" : visdom_server ,
130+ "visdom_port" : visdom_port ,
131+ "visdom_environment" : visdom_env ,
132+ "video_resize" : video_size ,
133+ "device" : device ,
134+ ** render_flyaround_kwargs ,
135+ }
136+ render_flyaround (** render_kwargs )
132137
133138
134139enable_get_default_args (visualize_reconstruction )
0 commit comments