Skip to content

最简单的VOC转COCO, 一条指令完整转换

Notifications You must be signed in to change notification settings

A-Nobel/VOC_to_COCO

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

VOC_to_COCO

update 2019.10.5

最简单的VOC数据集转换为COCO数据集方式

修改路径后, 只要一条指令就能转换

任何报错请issue我

  1. 请先确认你的VOC如下面的格式

      VOC
        |-- Annotations
        		|-- all xml files
        |-- JPEGImages
        		|-- all your samples
        |-- ImageSets
        		|-- 。。。。
    
    
  2. 克隆本仓到你指定的地址

git clone https://github.com/Stephenfang51/VOC_to_COCO
  1. cd 到VOC_to_COCO 编辑 voc_to_coco.py修改以下3点

    1. 设定验证集样本数, 如果设定为100, 则将从你的样本随机提取100个作为验证集
    2. 设定测试集样本数
    3. VOC Annotations 资料夹路径(最后面的"/"务必加上, 否则报错)

    例如

    val_files_num = 100
    test_files_num = 100
    voc_annotations = '././VOC/Annotations/'  #remember to modify the path

    修改到这边已经结束

  2. 执行生成, 确认是python3版本以上解释器, 否则报错

    python3 voc_to_coco.py
    
  3. COCO 数据集已经生成与VOC同一主目录下


The simplest way to covert VOC style dataset to COCO style dataset, only for object detection tesk for now.

Any problem feel free to issue me !

  1. First need to comfirm that your VOC path looks like:

      VOC
        |-- Annotations
        		|-- all xml files
        |-- JPEGImages
        		|-- all your samples
        |-- ImageSets
        		|-- 。。。。
    
  2. Clone this repo

    git clone https://github.com/Stephenfang51/VOC_to_COCO
    
  3. command cd to VOC_to_COCO path, and set the following three parts

    val_files_num = 100
    test_files_num = 100
    voc_annotations = '././VOC/Annotations/'  #remember to modify the path

    ex.

    if you set val_files_num to 100, which means it wil randomly choice 100 samples from your dataset

  4. do it ! only for python3

    python3 voc_to_coco.py
  5. Done ! your COCO dataset and your VOC dataset in the same path. So easy !

About

最简单的VOC转COCO, 一条指令完整转换

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%