diff --git a/ppdet/data/tools/x2coco.py b/ppdet/data/tools/x2coco.py index 7a3fd03177913aa467bbafaca2f3d666c9596919..1fd840bd46db5d1402a5623a925c86ca903770b3 100644 --- a/ppdet/data/tools/x2coco.py +++ b/ppdet/data/tools/x2coco.py @@ -132,7 +132,7 @@ def deal_json(ds_type, img_path, json_path): image_num = -1 object_num = -1 for img_file in os.listdir(img_path): - img_label = img_file.split('.')[0] + img_label = os.path.splitext(img_file)[0] if img_file.split('.')[ -1] not in ['bmp', 'jpg', 'jpeg', 'png', 'JPEG', 'JPG', 'PNG']: continue