Skip to content

Conversation

@gbeane
Copy link
Collaborator

@gbeane gbeane commented Nov 6, 2025

adds a new command called "prune" to the jabs-cli script,
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)

@gbeane gbeane self-assigned this Nov 6, 2025
@gbeane gbeane requested a review from ptuan5 November 10, 2025 15:21
@gbeane gbeane requested a review from bergsalex November 10, 2025 15:56
@gbeane gbeane merged commit 5781566 into main Nov 10, 2025
2 checks passed
@gbeane gbeane deleted the add-purge-cli branch November 10, 2025 17:11
Copy link

@ptuan5 ptuan5 left a 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
Copy link

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)

Copy link

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:
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants