1. X-AnyLabeling

1. 下载

X-AnyLabeling

2. 安装环境

  1. 激活环境:conda activate py
  2. 到文件目录下:…\X-AnyLabeling-main
  3. 安装环境:
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

3. 打开软件

  1. 运行app.py文件
    请添加图片描述

4. 加入自己模型及yaml文件

  1. 导出.onnx模型
  2. 创建.yaml文件,存放内容:
type: yolov5
name: yolov5-test-det
display_name: test detection
model_path: best.onnx
input_width: 640
input_height: 640
stride: 32
nms_threshold: 0.2
confidence_threshold: 0.2
classes:
  - a
  - b
  - c
  - d
  - e
  - f
...
  1. 存放位置:将.onnx模型及yaml文件存放同一位置。
  2. 应用:1)加载图片文件夹;2)点击左下角AI标识;
    请添加图片描述3)点击2后,左上角会出现列表,点击…Load Custom Model,加载自己的yaml文件即可。4)自动标注全部;5)单张标注。
    请添加图片描述

5. 同labelme化

  1. X-AnyLabeling标注生成的json文件不能用labelme加载,X-AnyLabeling也加载不了labelme生成的文件。
  2. 修改如下代码就可以了:
# label_file.py
# 1. def load:
with io_open(filename, "r") as f:
     data = json.load(f)

      # add point dealing 20250815
      i=0
      for d in data['shapes']:
          shape=d['points']
          new_shapes=[]
          new_shapes.append(shape[0])
          new1=[shape[1][0],shape[0][1]]
          new_shapes.append(new1)
          new_shapes.append(shape[1])
          new3=[shape[0][0],shape[1][1]]
          new_shapes.append(new3)
          data['shapes'][i]['points']=new_shapes
          i+=1
     ### 20250815

   version = data.get("version")
# 2. def save:
  with io_open(filename, "w") as f:
       # add point dealing 20250815
       i=0
       for d in data['shapes']:
           shape=d['points']
           new_shapes=[]
           new_shapes.append(shape[0])
           new_shapes.append(shape[2])
           data['shapes'][i]['points']=new_shapes
           i+=1
       ### 20250815
       json.dump(data, f, ensure_ascii=False, indent=2)         
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐