Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labels-level path fixing #85

Closed
talmo opened this issue Apr 14, 2024 · 0 comments · Fixed by #96
Closed

Labels-level path fixing #85

talmo opened this issue Apr 14, 2024 · 0 comments · Fixed by #96
Labels
enhancement New feature or request

Comments

@talmo
Copy link
Contributor

talmo commented Apr 14, 2024

It would be great to support fixing paths to videos at the level of a Labels object.

With #82, we now have Video.replace_filename to gracefully handle updating the filename with special logic for dealing with different backend states.

It would be great to have a couple of higher level utils that support at least two different paths for fixing paths:

  1. Given a list of video paths, replace them directly and restart the backends.
  2. Given a mapping (dict) of old to new paths, replace them without being sensitive to the ordering. This is necessary if we want to do it before loading the labels since we won't know the ordering ahead of time.
  3. Given an old and new path prefix, replace them all and restart backends. This is the most convenient and covers the common case where the directory structure hasn't changed, but the root of the path did (e.g., /home/user/videos/0.mp4 -> D:/videos/0.mp4).

Once we have the basic functionality to do that, then it'd be good to integrate that in the high level sio.load_file API through a video_filenames kwarg so we can load and fix the paths in one go.

A nice to have second PR would try some of these strategies and other heuristics to automatically fix paths at load time.

@talmo talmo added the enhancement New feature or request label Apr 14, 2024
@talmo talmo linked a pull request Jun 5, 2024 that will close this issue
@talmo talmo closed this as completed in #96 Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant