-
Notifications
You must be signed in to change notification settings - Fork 4
add jabs-cli prune command; implement project metadata merging for jabs-init command #237
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
Conversation
…ng all pruned videos instead of after each video removed
ptuan5
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's good to merge. Made some minor suggestions for brevity, but does not functionality.
| List of pathlib.Path objects for all related files. | ||
| """ | ||
| paths: list[Path] = [] | ||
| base = Path(video_name).with_suffix("").name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it any different than Path(video_name).stem?
| self._project_info.pop("metadata", None) | ||
| for video_entry in video_files.values(): | ||
| video_entry.pop("metadata", None) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not wrong, line 143-138 is redundant, because you reassign these values later on anyway?
| click.echo("Pruning cancelled.") | ||
| return | ||
|
|
||
| for video_paths in videos_to_prune: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change this to video_path or video
adds a new command called "prune" to the
jabs-cliscript,provides a cli-based way for pruning unlabeled videos from a JABS project (functionality already exists in the GUI).
cli command is more complete in that it also removes derived files (GUI pruning tries to move videos, poses, and annotations to recycle bin, but does not remove cache files, features, predictions). GUI should be updated in a future PR to add missing functionality using new helper functions now available as part of this PR.
Also updates behavior of importing metadata with
jabs-init. Add option to merge or replace when importing new metadata file (previous behavior only allowed complete replacement, there was no way to merge)