Skip to content

Commit

Permalink
move symplink creation into trigger portion, to fix codespaces bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sidhulyalkar committed Jan 13, 2024
1 parent 8f6cf8b commit f98901c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions element_facemap/facemap_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit f98901c

Please sign in to comment.