From f98901c288ae1d701173c941d1a1e0ccc4257973 Mon Sep 17 00:00:00 2001 From: Sidharth Hulyalkar Date: Fri, 12 Jan 2024 17:13:47 -0800 Subject: [PATCH] move symplink creation into trigger portion, to fix codespaces bug --- element_facemap/facemap_inference.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/element_facemap/facemap_inference.py b/element_facemap/facemap_inference.py index f10574e..cf7a2fb 100644 --- a/element_facemap/facemap_inference.py +++ b/element_facemap/facemap_inference.py @@ -347,15 +347,6 @@ def make(self, key): facemap_result_path = output_dir / f"{vid_name}_FacemapPose.h5" full_metadata_path = output_dir / f"{vid_name}_FacemapPose_metadata.pkl" - # Create Symbolic Links to raw video data files from outbox directory - video_symlinks = [] - for video_file in video_files: - video_symlink = output_dir / video_file.name - if video_symlink.exists(): - video_symlink.unlink() - video_symlink.symlink_to(video_file) - video_symlinks.append(video_symlink.as_posix()) - # Trigger Facemap Pose Estimation Inference if ( facemap_result_path.exists() & full_metadata_path.exists() @@ -393,6 +384,15 @@ def make(self, key): facemap_model_path = Path.cwd() / facemap_model_name models_root_dir = model_loader.get_models_dir() + # Create Symbolic Links to raw video data files from outbox directory + video_symlinks = [] + for video_file in video_files: + video_symlink = output_dir / video_file.name + if video_symlink.exists(): + video_symlink.unlink() + video_symlink.symlink_to(video_file) + video_symlinks.append(video_symlink.as_posix()) + # copy this model file to the facemap model root directory (~/.facemap/models/) shutil.copy(facemap_model_path, models_root_dir)