Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/guyettinger/gle-pascal-voc

A library for working with Pascal Visual Object Classes (VOC) Annotations
https://github.com/guyettinger/gle-pascal-voc

pascal-voc pascal-voc-xml typescript

Last synced: about 6 hours ago
JSON representation

A library for working with Pascal Visual Object Classes (VOC) Annotations

Awesome Lists containing this project

README

        


logo

# GLE Pascal VOC
A library for working with Pascal Visual Object Classes (VOC) Annotations

[![Version](https://img.shields.io/npm/v/gle-pascal-voc?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/gle-pascal-voc)
[![Downloads](https://img.shields.io/npm/dt/gle-pascal-voc.svg?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/gle-pascal-voc)

## Installation
```shell
npm install gle-pascal-voc
```

## Usage
```typescript
const pascalVocModel = new PascalVocModel(
'Image Folder',
'Image.jpg',
'/annotations/Image.jpg',
new SourceModel(),
new SizeModel(100, 100, 3),
Segmented.Linear,
[
new ObjectModel(
'person',
'Unspecified',
Truncated.FullyVisible,
Difficult.Easy,
new BoundingBoxModel(1, 1, 99, 99),
[
new PartModel(
'hand',
new BoundingBoxModel(25, 25, 50, 50)
),
new PartModel(
'hand',
new BoundingBoxModel(50, 25, 99, 99)
)
],
new ActionsModel(new Map([
['other', 1],
['jumping', 0],
['phoning', 1],
['playinginstrument', 0],
['reading', 1],
['ridingbike', 0],
['ridinghorse', 1],
['running', 0],
['takingphoto', 1],
['usingcomputer', 0],
['walking', 0],
])),
),
new ObjectModel(
'person',
'Unspecified',
Truncated.FullyVisible,
Difficult.Easy,
new BoundingBoxModel(1, 1, 99, 99),
[
new PartModel(
'hand',
new BoundingBoxModel(25, 25, 50, 50)
),
new PartModel(
'hand',
new BoundingBoxModel(50, 25, 99, 99)
)
],
new ActionsModel(new Map([
['other', 1],
['jumping', 0],
['phoning', 1],
['playinginstrument', 0],
['reading', 1],
['ridingbike', 0],
['ridinghorse', 1],
['running', 0],
['takingphoto', 1],
['usingcomputer', 0],
['walking', 0],
])),
)
]
)
const xml = toXML.pascalVOCToXML(pascalVocModel)
console.log(xml)
```
```xml

Image Folder
Image.jpg

100
100
3

0

person
Unspecified
0
0

1
1
99
99


hand

25
25
50
50



hand

50
25
99
99



1
0
1
0
1
0
1
0
1
0
0



person
Unspecified
0
0

1
1
99
99


hand

25
25
50
50



hand

50
25
99
99



1
0
1
0
1
0
1
0
1
0
0

```

## Development
Install
```
npm install
```
Build Library
```
npm run build
```
Run Tests
```
npm run test
```