Commit b81476b
Append video name to output path when video_index is specified
When running inference with video_index parameter to predict on a specific
video from a multi-video .slp file, the output path now includes the video
name to prevent overwrites. This allows users to run predictions on multiple
videos from the same .slp file without manually specifying output paths.
Changes:
- Modified run_inference() to append video filename stem to output path
when video_index is provided and output_path is None
- Format: <labels_file>.<video_name>.predictions.slp
- Falls back to video_{index} if filename is not a simple string
- Added test_video_index_output_path() to verify behavior
Example:
- Before: labels.slp + video_index=0 → labels.predictions.slp
- After: labels.slp + video_index=0 (video1.mp4) → labels.video1.predictions.slp
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 558e0a9 commit b81476b
2 files changed
+47
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | | - | |
508 | | - | |
509 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
510 | 518 | | |
511 | 519 | | |
512 | 520 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1423 | 1423 | | |
1424 | 1424 | | |
1425 | 1425 | | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
0 commit comments