Coder Social home page Coder Social logo

labelme2yolo's Introduction

labelme2yolo

labelme标签转换为yolo标签

python labelme2yolo(...)

参数:

labelme2yolo(labelme_image_path='labelme 图像文件夹目录',
                 labelme_json_path='labelme json文件夹目录',
                 save_data_path='转换yolo格式保存目录',
                 obj_name='提取的类别名称, labelme 里的 labels.txt',
                 dataset_type='train', # train/val/test
                 image_type='.jpg', # 图像格式后缀
                 )

labelme2yolo's People

Contributors

kolomomo avatar

Stargazers

 avatar Zhaoqi_Huang avatar  avatar  avatar

labelme2yolo's Issues

labelme2yolo

labelme标注的是分割 json文件里面是一个个封闭的多边形及其类别?对吗?
下面的函数就是 打开一个图片的标注?一个个读取多边形,把多边形换成矩形方框用于检测?

with open(path_txt, 'w+') as ftxt:
data = json.load(fp)
self.height = data['imageHeight']
self.width = data['imageWidth']
for shape in data['shapes']:
label = shape['label']
shape_type = shape['shape_type']

                if shape_type != "rectangle":
                    print('只支持retangle标注')
                    break

                if label in self.labels:
                    idx = self.labels.index(label)
                    points = shape['points']
                    x_center, y_center, w, h = self.point_to_box(points)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.