File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -260,9 +260,20 @@ def make_predict_cli_call(
260260
261261 # Build filename with video name and timestamp
262262 timestamp = datetime .now ().strftime ("%y%m%d_%H%M%S" )
263+ video_name_prefix = ""
264+ if "--video_index" in item_for_inference .cli_args :
265+ video_index = int (
266+ item_for_inference .cli_args [
267+ item_for_inference .cli_args .index ("--video_index" ) + 1
268+ ]
269+ )
270+ video_name_prefix = Path (self .labels .videos [video_index ].filename ).name
271+ video_name_prefix = (
272+ video_name_prefix + "_" if video_name_prefix != "" else ""
273+ )
263274 output_path = os .path .join (
264275 predictions_dir ,
265- f"{ os .path .basename (item_for_inference .path )} .{ timestamp } ."
276+ f"{ video_name_prefix } { os .path .basename (item_for_inference .path )} .{ timestamp } ."
266277 "predictions.slp" ,
267278 )
268279
You can’t perform that action at this time.
0 commit comments