Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yujota/elm-pascal-voc

Elm library for encoding and decoding PASCAL Visual Object Class XML format (http://host.robots.ox.ac.uk/pascal/VOC/)
https://github.com/yujota/elm-pascal-voc

elm pascal-voc

Last synced: 2 days ago
JSON representation

Elm library for encoding and decoding PASCAL Visual Object Class XML format (http://host.robots.ox.ac.uk/pascal/VOC/)

Awesome Lists containing this project

README

        

# elm-pascal-voc

Elm library for encoding and decoding PASCAL Visual Object Class XML format (http://host.robots.ox.ac.uk/pascal/VOC/).

Supported XML tags in this library are;
- folder
- filename
- path
- source
- size
- object (Annotation)

This library may not provide tags which are not used frequently.

## How to use

```elm
import PascalVoc
import PascalVoc.Decode
import PascalVoc.Encode

sampleXmlString = """

Train
sample.png
/my/path/Train/sample.png

Unknown


224
224
3


sample-annotation

82
172
88
146

"""

-- Decoding
data = PascalVoc.Decode.decode sampleXmlString
Result.map PascalVoc.filename data == "sample.png"

-- Access to an annotation object
Result.map PascalVoc.objects data == [
{ name = "sample-annotation"
, bndBox = { xmin = 82, xmax = 172, ymin = 88, ymax = 146 }
, pose = Nothing
, truncated = Nothing
, difficult = Nothing
}
]

-- Encoding
Result.map PascalVoc.Encode.format data
```