{"id":13712338,"url":"https://github.com/DLLXW/objectDetectionDatasets","last_synced_at":"2025-05-06T21:34:07.968Z","repository":{"id":43050124,"uuid":"296853500","full_name":"DLLXW/objectDetectionDatasets","owner":"DLLXW","description":"目标检测数据集制作:VOC,COCO,YOLO等常用数据集格式的制作和互相转换脚本","archived":false,"fork":false,"pushed_at":"2021-10-21T06:21:55.000Z","size":1311,"stargazers_count":445,"open_issues_count":3,"forks_count":120,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-05T23:09:50.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DLLXW.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-19T11:29:13.000Z","updated_at":"2025-04-05T08:33:38.000Z","dependencies_parsed_at":"2022-07-09T06:30:20.185Z","dependency_job_id":null,"html_url":"https://github.com/DLLXW/objectDetectionDatasets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLLXW%2FobjectDetectionDatasets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLLXW%2FobjectDetectionDatasets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLLXW%2FobjectDetectionDatasets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLLXW%2FobjectDetectionDatasets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DLLXW","download_url":"https://codeload.github.com/DLLXW/objectDetectionDatasets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252772735,"owners_count":21801974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T23:01:17.318Z","updated_at":"2025-05-06T21:34:05.715Z","avatar_url":"https://github.com/DLLXW.png","language":"Python","funding_links":[],"categories":["Summary"],"sub_categories":[],"readme":"# objectDetectionDatasets\n目标检测数据集制作:VOC,COCO,YOLO等常用数据集格式的制作和互相转换脚本,demo/目录提供的原始的voc格式的20张原图和对应20个.xml标注．\n下面的脚本都可以通过这个demo数据跑通.\n## voc_split_trainVal.py\n该脚本用于生成voc/目录下的ImageSets/..目录,分割了训练和验证集\n## voc_to_coco_V1.py　和　voc_to_coco_V2.py\n这两个脚本都是实现从voc的.xml标注格式转换到coco的.json格式,只是有所区别\n\u003e - v1版本实现了转换的同时进行训练／验证的分割\n\u003e - v2版本包含了segemetation字段(当训练htc等需要分割的任务时候网络需要用到)\n## convert_voc_to_yoloV5.py　和 convert_voc_to_yoloV3.py\n两个脚本实现的功能几乎相同,灵活取用\n\u003e - V5脚本实现将voc格式的数据转化为yoloV5需要的.txt标注文件,运行该脚本，会在voc/目录下生成\nworktxt/目录(yolo需要的格式).\n\u003e - V3这个脚本除了生成.txt的标注(同上)，还会生成一个trianval.txt的索引,以前的yolov3系列用的多一点\n\n## coco_split_trainVal.py\n该脚本实现coco格式的数据分割出训练集和验证集,同时里面还实现了一个去除背景图的方法(没有标注框的图)，可以结合上面的\nvoc_to_coco_v2.py使用.\n\n## make_voc.py(其余各种格式转voc)\n前面没有写coco转voc格式的脚本,make_voc.py就提供了一个制作voc格式数据的通用套路（核心代码）.\n```python\n`img = cv2.imread(image_path)\n            height, width, depth = img.shape\n            with codecs.open(anno_dir + imgId_frame_name[:-4] + '.xml', 'w', 'utf-8') as xml:\n                xml.write('\u003cannotation\u003e\\n')\n                xml.write('\\t\u003cfilename\u003e' + imgId_frame_name + '\u003c/filename\u003e\\n')\n                xml.write('\\t\u003csize\u003e\\n')\n                xml.write('\\t\\t\u003cwidth\u003e' + str(width) + '\u003c/width\u003e\\n')\n                xml.write('\\t\\t\u003cheight\u003e' + str(height) + '\u003c/height\u003e\\n')\n                xml.write('\\t\\t\u003cdepth\u003e' + str(depth) + '\u003c/depth\u003e\\n')\n                xml.write('\\t\u003c/size\u003e\\n')\n                cnt = 0\n                for bbox in bboxs:\n                    xmin, ymin, xmax, ymax = bbox\n                    class_name = 'obstacles'\n                    #\n                    xml.write('\\t\u003cobject\u003e\\n')\n                    xml.write('\\t\\t\u003cname\u003e' + class_name + '\u003c/name\u003e\\n')\n                    xml.write('\\t\\t\u003cbndbox\u003e\\n')\n                    xml.write('\\t\\t\\t\u003cxmin\u003e' + str(xmin) + '\u003c/xmin\u003e\\n')\n                    xml.write('\\t\\t\\t\u003cymin\u003e' + str(ymin) + '\u003c/ymin\u003e\\n')\n                    xml.write('\\t\\t\\t\u003cxmax\u003e' + str(xmax) + '\u003c/xmax\u003e\\n')\n                    xml.write('\\t\\t\\t\u003cymax\u003e' + str(ymax) + '\u003c/ymax\u003e\\n')\n                    xml.write('\\t\\t\u003c/bndbox\u003e\\n')\n                    xml.write('\\t\u003c/object\u003e\\n')\n                    cnt += 1\n                assert cnt \u003e 0\n                xml.write('\u003c/annotation\u003e')`\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDLLXW%2FobjectDetectionDatasets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDLLXW%2FobjectDetectionDatasets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDLLXW%2FobjectDetectionDatasets/lists"}