Skip to content

Commit

Permalink
Regex filename search
Browse files Browse the repository at this point in the history
(cherry picked from commit 0fc75bd)
  • Loading branch information
Michael Litvin authored and wkentaro committed Dec 31, 2023
1 parent 3c8c457 commit 785b218
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion labelme/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2071,7 +2071,11 @@ def importDirImages(self, dirpath, pattern=None, load=True):
self.fileListWidget.clear()
for filename in self.scanAllImages(dirpath):
if pattern and pattern not in filename:
continue
try:
if not re.search(pattern, filename):
continue
except re.error:
pass
label_file = osp.splitext(filename)[0] + ".json"
if self.output_dir:
label_file_without_path = osp.basename(label_file)
Expand Down

0 comments on commit 785b218

Please sign in to comment.