pysot icon indicating copy to clipboard operation
pysot copied to clipboard

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

Open fzh0917 opened this issue 5 years ago • 9 comments

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.

fzh0917 avatar Feb 16 '20 16:02 fzh0917

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

ZhiyuanChen avatar Feb 22 '20 02:02 ZhiyuanChen

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

VishiNehra avatar Oct 19 '20 04:10 VishiNehra

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?

ZhiyuanChen avatar Oct 20 '20 02:10 ZhiyuanChen

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

VishiNehra avatar Oct 22 '20 03:10 VishiNehra

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

ZhiyuanChen avatar Oct 22 '20 12:10 ZhiyuanChen

Oops, totally forgot about forking the repo, thanks!

VishiNehra avatar Oct 22 '20 12:10 VishiNehra

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

arungrace88 avatar Sep 14 '21 13:09 arungrace88

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".

zhaojinjian0000 avatar Nov 10 '21 07:11 zhaojinjian0000

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

ArjunMenon-bit avatar Nov 18 '23 05:11 ArjunMenon-bit