Use os.path.basename for the smoothing output path - #1
Open
itzzdev09 wants to merge 1 commit into
Open
Conversation
tools/optional_smoothing.py takes a filename by splitting on a literal '/':
seq_name = seq_txt.split('/')[-1]
glob returns OS-native separators, so on Windows the whole path survives the
split. os.path.join discards its first argument when the second is absolute, so
save_path is dropped and the interpolated results are written back over the
tracking output they were read from.
The demo_track__no_reid.py and demo_track__with_reid.py files in this repo
already use osp.basename throughout; this one line was missed.
No behaviour change on POSIX: for '/data/res/MOT17-02.txt', 'res/MOT17-02.txt'
and 'MOT17-02.txt', split('/')[-1] and os.path.basename return identical
results. Only paths containing a backslash are affected.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi Tomasz — small companion to McByte#6, which covers the same pattern in the other repo.
tools/optional_smoothing.py:26takes a filename by splitting on a literal/:globreturns OS-native separators, so on Windows the whole path survives the split.os.path.joindiscards its first argument when the second is absolute, sosave_pathis dropped entirely:The interpolated results overwrite the tracking output they were just read from, so the original is lost.
Why this one line
demo_track__no_reid.pyanddemo_track__with_reid.pyin this repo already useosp.basenamethroughout — zero occurrences of thesplit('/')pattern between them. This single line looks like it was simply missed, so the change just brings it in line with the rest of the repo.No behaviour change on Linux
For
'/data/res/MOT17-02.txt','res/MOT17-02.txt'and'MOT17-02.txt',split('/')[-1]andos.path.basenamereturn identical results. Only paths containing a backslash are affected, which cannot occur on POSIX.🤖 Generated with Claude Code