-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Hi !
Would it be possible to add an argument to the cli to specify an output folder for the predictions? I am running the same model in parallel on several datasets on a computing clusters, and all the predictions end up in the same folder.
Something along the lines of:
predict_parser.add_argument(
"--prediction_dir",
type=Path,
help="directory where predictions will be saved\n"
)
def handle(args):
"""Handle the predict command."""
# Delay this import because it's slow.
from lightning_pose.api.model import Model
model = Model.from_dir2(args.model_dir, hydra_overrides=args.overrides)
# monkey-patching model to store prediction in a specific folder
if args.prediction_dir is not None:
model.video_preds_dir = lambda: Path(args.prediction_dir)
model.labeled_videos_dir = lambda: Path(args.prediction_dir) / 'labeled_videos'
input_paths = [Path(p) for p in args.input_path]
if model.config.is_multi_view():
_predict_multi_type_multi_view(
model, input_paths, args.skip_viz, not args.overwrite, progress_file=args.progress_file
)
else:
for p in input_paths:
_predict_multi_type(
model, p, args.skip_viz, not args.overwrite, progress_file=args.progress_file
)
Thanks a lot for this great piece of software!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request