瀏覽代碼

./paddlex/tools/x2coco.py

sunyanfang01 5 年之前
父節點
當前提交
f28504f66f
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      paddlex/tools/x2coco.py

+ 1 - 1
paddlex/tools/x2coco.py

@@ -100,7 +100,7 @@ class LabelMe2COCO(X2COCO):
         image["height"] = json_info["imageHeight"]
         image["width"] = json_info["imageWidth"]
         image["id"] = image_id + 1
-        image["file_name"] = json_info["imagePath"].split("/")[-1]
+        image["file_name"] = osp.split(json_info["imagePath"])[-1]
         return image
     
     def generate_polygon_anns_field(self, height, width,