From 7800e13fc26a4691da213e8f0427eb79c90eef0d Mon Sep 17 00:00:00 2001 From: rpb Date: Mon, 4 Jul 2022 11:39:58 +0800 Subject: [PATCH] [Fix] Flexible ways of getting file name (#1107) * Flexible ways of getting file name Address issue https://github.com/open-mmlab/mmocr/issues/1078 * fix lint Co-authored-by: gaotongxiao --- tools/data/textdet/lv_converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/data/textdet/lv_converter.py b/tools/data/textdet/lv_converter.py index 1d5dfa75f..2abef0e45 100644 --- a/tools/data/textdet/lv_converter.py +++ b/tools/data/textdet/lv_converter.py @@ -83,7 +83,7 @@ def load_img_info(files): '.')[0] # read imgs while ignoring orientations img = mmcv.imread(img_file, 'unchanged') - img_file = img_file.split('data/lv/')[1] + img_file = os.path.split(img_file)[-1] img_info = dict( file_name=img_file,