kingsdigitallab / kdl-vqa

Python tool for batch visual question answering (BVQA).
MIT License
1 stars 0 forks source link

Filter param (--filter) must be lowercase to find match #12

Closed mchesterkadwell closed 1 week ago

mchesterkadwell commented 2 weeks ago

If the filepath includes any uppercase letters these are converted to lowercase in the filter check, so you have to provide the --filter param in lowercase. This is confusing to the user that may be expecting to specify the path fragment (file name, directory name) as they see it.

e.g. 'data/b102Pt2/ABC123456.jpg'

if you want to filter for files in this directory you have to pass 'b102pt2' (with lowercase 'p'). If you pass 'b102Pt2' you end up with no files processed, which causes user confusion.

Code: https://github.com/kingsdigitallab/kdl-vqa/blob/bff122cb155710b0d93263052cd00a948650f141/utils/helpers.py#L36

Fix: filter.lower() in str(path).lower()

geoffroy-noel-ddh commented 2 weeks ago

Yes, please. Thanks for spotting that and the fix!

geoffroy-noel-ddh commented 1 week ago

I've fixed this as part of the refactoring needed for gh-1 (filtering by test cases when -t is supplied).