STVIR / pysot

SenseTime Research platform for single object tracking, implementing algorithms like SiamRPN and SiamMask.
Apache License 2.0
4.41k stars 1.1k forks source link

Weakness: duplicated path concatenation in the toolkit/dataset/vot.py #294

Open fzh0917 opened 4 years ago

fzh0917 commented 4 years ago

As the title describes, there exists two times path concatenations for the member variable named img_names belonged to the VOTVideo class. One of them occurs at line 18 in toolkit/dataset/video.py , and the other one is at line 53 in toolkit/dataset/vot.py if the variable load_img is set to False. Here are some examples.

absolute path

>>> a = '/home/username/test_dir'
>>> b = '/home/username/test_dir/test.py'
>>> c = os.path.join(a, b)
>>> print(c)
/home/username/test_dir/test.py # valid path

relative path

>>> a = './test_dir'
>>> b = './test_dir/test.py'
>>> c = os.path.join(a, b)
>>> print(c)
./test_dir/./test_dir/test.py # invalid path

Consequently, if users pass a relative path to the toolkit.datasets.DatasetFactory.create_dataset method, their programs will crash. So, please fix this weakness timely.

ZhiyuanChen commented 4 years ago

Thanks for pointing out You are more than welcome to fix it and submit a pull request

VishiNehra commented 3 years ago

Hi, I have a fix for this, but somehow don't have permission to open a PR. Are you guys still accepting contributions?

ZhiyuanChen commented 3 years ago

Hi, I have a fix for this, but somehow don't have permission to open a PR. Are you guys still accepting contributions?

Of course we are accepting contributions, could you please share the error message?

VishiNehra commented 3 years ago

Yup, when I push my PR I get the following message: "remote: Permission to STVIR/pysot.git denied to VishiNehra. fatal: unable to access 'https://github.com/STVIR/pysot/': The requested URL returned error: 403" Also, when I tried to make manually make a PR on github as a workaround, the "Create Pull Request" button was greyed out for me

ZhiyuanChen commented 3 years ago

Yup, when I push my PR I get the following message: "remote: Permission to STVIR/pysot.git denied to VishiNehra. fatal: unable to access 'https://github.com/STVIR/pysot/': The requested URL returned error: 403" Also, when I tried to make manually make a PR on github as a workaround, the "Create Pull Request" button was greyed out for me

You should fork this repo first, which should appear as https://github.com/VishiNehra/pysot/, then, you should push your changes to that repo, and finally submit a pull request from your forked repo

VishiNehra commented 3 years ago

Oops, totally forgot about forking the repo, thanks!

arungrace88 commented 2 years ago

Hi, Is this issue closed or rather it is open?. If open, shall I take it up?. Thanks

zhaojinjian0000 commented 2 years ago

When I test on UAV123 after "cd experiments/siamrpn_r50_l234_dwxcorr",

x == "group1/001333.jpg"
os.path.abspath(x) == "~/pysot/experiments/siamrpn_r50_l234_dwxcorr/group1/001333.jpg"

However, the converted x should be

"~/pysot/testing_dataset/UAV123/group1/001333.jpg"

In this situation, the code should be

self.img_names = [os.path.join(root, x) for x in img_names]

The "img_names" should be relative path starting from "root".

ArjunMenon-bit commented 10 months ago

@ZhiyuanChen There is a PR merged for this issue. Is this issue closed? If not, I would like to contribute