Giter VIP home page Giter VIP logo

dataset_to_voc_converter's Introduction

These scripts are used for converting annotations of pedestrian datasets, including MS COCO, Caltech pedestrian dataset, and HDA to PASCAL VOC format.

Requirements

Usage

COCO

anno_json_image_urls.py: extract image url (coco source not filckr) from annotation json file. See anno_json_image_urls.sh
download_coco_images.py: download coco image files from given urls (extracted from instance/keypoint annotation json file) . See download.sh
anno_coco2voc.py: convert coco annotation json file to VOC xml files. See anno_coco2voc.sh

For exmaple:

python3 anno_coco2voc.py --anno_file=/Path/to/instances_train2014.json \
                         --type=instance \
                         --output_dir=/Path/to/instance_anno_dir

Caltech

vbb2voc.py: extract images with person bbox in seq file and convert vbb annotation file to xml files.
PS: For Caltech pedestrian dataset, there are 4 kind of persons: person, person-fa, person?, people. In my case, I just need to use person type data. If you want to use other types, specify person_types with corresponding type list (like ['person', 'people']) in parse_anno_file function.

python3 vbb2voc.py --seq_dir=path/to/caltech/seq/dir \        
                   --vbb_dir=path/to/caltech/vbb/dir \
                   --output_dir=/output/saving/path \
                   --person_type=person

HDA

anno_had2voc: convert HDA annotation info to VOC format.

python3 anno_hda2voc.py --input_dir=path/to/HDA_Dataset_V1.3/hda_detections/GtAnnotationsAll \ 
                        --output_dir=anno/saving/path

dataset_to_voc_converter's People

Contributors

casiafan avatar zlingkang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dataset_to_voc_converter's Issues

Error arguments vbb2voc.py

Hi,

I think there is a mistake in the order of the arguments in the main function of vbb2voc.py file. In the main function you call the parse_anno_file function:

parse_anno_file(args.seq_dir, args.vbb_dir, frame_out, anno_out, person_type)

However, the arguments of this functions are:

def parse_anno_file(vbb_inputdir, seq_inputdir, vbb_outputdir, seq_outputdir, person_types=None):

I think there is a mistake in the sequence of these arguments. If you want I can open a pull request.

Thank you!

line 69 error

  • I made the path for the same name with the code and downloaded instance_train2014.json already.

  • and run
    "python anno_coco2voc.py --anno_file /startdt_data/COCO/dataset/annotations/instances_train2014.json \ --type instance \ --output_dir /startdt_data/COCO/dataset/instance_train_annotation"

  • But I got the following error messages.

    File "anno_coco2voc.py", line 69
    print "Formating instance xml file {} done!".format(name)
    ^
    SyntaxError: invalid syntax

How to fix it?
Thank you for uploading "convert dataset to VOC annotation format"
Regards,

Some annotations are missed.

In2017 the number of train Images are 118,237. but, the number of annotation xml which are in 80 categories are 117,266.

In2017 the number of val Images are 5,000. but, the number of annotation xml which are in 80 categories are 4872.

My Question is why some xml are missed ?
Is it related with 80 categories? msCOCO actually has 90 categories.
If it is true, why 10 categories are excluded from converting to make xml?

Thanks ahead!!

Reversed augmentation sequence that leads to empty output when using "vbb2voc.py"

Dear @zlingkang ,

In your vbb2voc.py script, line 221, you call function "parse_anno_file(args.seq_dir, args.vbb_dir, frame_out, anno_out, person_type)" and pass first "args.seq_dir" then "args.vbb_dir".
However, at function definition at line 151 "def parse_anno_file(vbb_inputdir, seq_inputdir, vbb_outputdir, seq_outputdir, person_types=None):", you define the first variable to be "vbb_inputdir" and second variable to be "seq_inputdir".
This different calling sequence of vbb and seq variables will lead to empty output since as you suggest in the other issue, your folder structure is:
--annotations
----set00
------V000.vbb
--set00
----V000.seq
Also, seems your code should require a folder structure like:
--annotations
----set00
------V000.vbb
--sequences
----set00
------V000.seq
to perform correctly.

Moreover, you define augment parser like
"parser.add_argument("seq_dir", help="Caltech dataset seq data root directory")" at line 209-212. However, as you shown in your calling example, if we want to call this script in command line like "python3 vbb2voc.py --seq_dir path/to/seq ...", we need to define augment parser like "parser.add_argument("--seq_dir", help="Caltech dataset seq data root directory")"

Hope this helps! Really appreciate your effort in providing this convenient script for transforming annotations between different formats!

Best,
Yi

vbb2voc.py: error: the following arguments are required: seq_dir, vbb_dir, output_dir, person_type

hello, I was trying to convert the vbb to voc using vbb2voc.py. my parameters as below:
python vbb2voc.py --seq_dir=/home/kli/data/pedestrian_data/set00/
--vbb_dir=/home/kli/data/pedestrian_data/annotations/set00/
--output_dir=/home/kli/data/pedestrian_data/voc/set00/
--person_type=person
but get the error vbb2voc.py: error: the following arguments are required: seq_dir, vbb_dir, output_dir, person_type
Is there any problem with the input format?

wrong image name

i try to converter caltech pedetrian dataset, but the rusult like this;
Generating annotation xml file of picture: set02_V003_719.jpg
Generating annotation xml file of picture: set02_V003_72.jpg
Generating annotation xml file of picture: set02_V003_720.jpg

Generating annotation xml file of picture: set07_V010_1.jpg
Generating annotation xml file of picture: set07_V010_10.jpg
Generating annotation xml file of picture: set07_V010_100.jpg
Generating annotation xml file of picture: set07_V010_1000.jpg
Generating annotation xml file of picture: set07_V010_1001.jpg

the image name is wrong when it contains zero in the end, please answer me.thank you

How we can convert database into VOC format

I am trying to implement my model for the detection of disease (mmdetection) in medical imaging. How I can convert my database into VOC format? Is there any supporting .py file available in your project folder? That can convert my database into VOC format. If not, how I can do this? Can you please help me to sort out this issue?
My database consists of two main folders.

  1. Original Images JPEG format
  2. Ground Truth images in JPEG format
    Now I want to convert my all database into VOC format for XML annotations of Ground Truth images.

Missing license

Could you please add a license to this repository, e.g. MIT. That will make it easier to use. Thanks!

XML files only related to the 80 'things' classes

Running:
python anno_coco2voc.py --anno_file instances_train2014.json --type instance --output_dir ./anno_trainXML

I obtain only 80 folders containing the 80 'things' classes of COCO 2014.
In reality that dataset contain also other 91 'stuff' classes (in total coco2014 contain 172 classes).
So how can I see the other classes ?

keypints don't work

Hi ,
I want to only have some category but when i use arg.type=keypoints i got error :

Traceback (most recent call last):
File "anno_coco2voc.py", line 154, in
main(args)
File "anno_coco2voc.py", line 145, in main
parse_keypoints(content, args.output_dir)
File "anno_coco2voc.py", line 115, in parse_keypoints
keypoints = dict(zip(range(1, len(content['categories'][0]['keypoints'])+1), content['categories'][0]['keypoints']))
KeyError: 'keypoints'

vbb2voc error

你好,请问vbb2voc中第154行 parse_anno_file取消注释运行,为什么输出的是空文件夹呢。

KeyError: 'coco_url'

I am trying to convert dataset from coco to voc format using anno_coco2voc.py file but got this KeyError: 'coco_url'

billion@billion-Inspiron-3542:~/Dataset_to_VOC_converter$ python3 anno_coco2voc.py --anno_file /home/billion/Desktop/Siddhi/document_edge_detection_dataset/earlier_training/testing/test.json \

                     --type instance \
                     --output_dir /home/billion/Desktop/Siddhi/document_edge_detection_dataset/earlier_training/annotations

Traceback (most recent call last):
File "anno_coco2voc.py", line 154, in
main(args)
File "anno_coco2voc.py", line 143, in main
parse_instance(content, args.output_dir)
File "anno_coco2voc.py", line 60, in parse_instance
anno_tree = instance2xml_base(groups[0])
File "anno_coco2voc.py", line 16, in instance2xml_base
E.url(anno['coco_url'])
KeyError: 'coco_url'

crop1

求助inria2voc

想用YOLO训练行人数据集,但不太清楚annotations需要怎么转换成voc格式。

如果方便的话能否提供一些思路?

非常感谢~~~

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.