Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML files generated from xml2yml.m cannot be read by Opencv FilgStorage class #4

Closed
seanXYZ opened this issue Jan 30, 2015 · 4 comments

Comments

@seanXYZ
Copy link

seanXYZ commented Jan 30, 2015

YAML files generated from xml2yml.m cannot be read by Opencv FilgStorage class
after that , I noticed the comments in xml2yaml.m
%% Convert the file type of opencv xml annotations to yaml thus it can be read by opencv
% This functions relies on http://code.google.com/p/yamlmatlab/
% The results needs to be further refined to deal with indentation problem
what's the meaning of " needs to be further refined" ??

@bittnt
Copy link
Collaborator

bittnt commented Feb 10, 2015

Hi, @seanXYZ I am not sure which OpenCV version you are talking about. The code should works with the previous version 2.4.9. Alternatively, you could try the mexOpenCV https://github.com/kyamagu/mexopencv, it should help you getting things done with the latest OpenCV YAML interface.

@seanXYZ
Copy link
Author

seanXYZ commented Feb 15, 2015

Hi, thank you for your message. I have already figured it out.And read and test all your code.
The problem takes place because that the format of YAML can not be parsed on my machine.So I have tried different formats, this format below is working:
%YAML:1.0

annotation:
folder: VOC2007
filename: "000001.jpg"
source: {database: The VOC2007 Database, annotation: PASCAL VOC2007, image: flickr,
flickrid: '341012865'}
owner: {flickrid: Fried Camels, name: Jinky the Fruit Bat}
size: {width: '353', height: '500', depth: '3'}
segmented: '0'
object:
- bndbox: {xmin: '48', ymin: '240', xmax: '195', ymax: '371'}
name: dog
pose: Left
truncated: '1'
difficult: '0'
- bndbox: {xmin: '8', ymin: '12', xmax: '352', ymax: '498'}
name: person
pose: Left
truncated: '1'
difficult: '0'

@seanXYZ seanXYZ closed this as completed Sep 18, 2015
@ZhengYuxiao
Copy link

@seanXYZ Hello, I want make own data set like VOC2007 Annotations, but the annotations is xml, I want generate yml,could you tell me how to generate the formats like follow
%YAML:1.0

annotation:
folder: VOC2007
filename: "000001.jpg"
source: {database: The VOC2007 Database, annotation: PASCAL VOC2007, image: flickr,
flickrid: '341012865'}
owner: {flickrid: Fried Camels, name: Jinky the Fruit Bat}
size: {width: '353', height: '500', depth: '3'}
segmented: '0'
object:

  • bndbox: {xmin: '48', ymin: '240', xmax: '195', ymax: '371'}
    name: dog
    pose: Left
    truncated: '1'
    difficult: '0'
  • bndbox: {xmin: '8', ymin: '12', xmax: '352', ymax: '498'}
    name: person
    pose: Left
    truncated: '1'
    difficult: '0'

@seanXYZ
Copy link
Author

seanXYZ commented Nov 23, 2016

I think you can use a lot of APIs to edit your YAML file or XML file. To the infomation of the object, you may write a program to select the box of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants