Metadata-Version: 2.1
Name: coco_types
Version: 0.0.1
Summary: Package for handling COCO datasets types.
Project-URL: Homepage, https://github.com/hoel-bagard/coco_types
Project-URL: Bug Tracker, https://github.com/hoel-bagard/coco_types/issues
Author: Bagard Hoel
License: MIT
License-File: LICENSE.md
Keywords: COCO,COCO dataset
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.9
Requires-Dist: pydantic
Provides-Extra: dev
Requires-Dist: flake8; extra == 'dev'
Requires-Dist: flake8-bugbear; extra == 'dev'
Requires-Dist: flake8-comprehensions; extra == 'dev'
Requires-Dist: flake8-docstrings; extra == 'dev'
Requires-Dist: flake8-import-order; extra == 'dev'
Requires-Dist: flake8-quotes; extra == 'dev'
Requires-Dist: pep8-naming; extra == 'dev'
Requires-Dist: pip-tools; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Description-Content-Type: text/markdown

# coco_utils

## Loading COCO data

You can load COCO dataset labels into Pydantic objects by using the `Dataset` and `DatasetKP` classes.

Note: This packages loads the data as is and does not create dictionaries mapping ids to lists of annotations/categories.

#### Loading

For an object detection dataset:
```python
import coco_types

with open("path/to/json", encoding="utf-8") as data_file:
    dataset = coco_types.Dataset.parse_raw(data_file.read())
```

For a keypoint detection dataset:
```python
import coco_types

with open("path/to/json", encoding="utf-8") as data_file:
    dataset = coco_types.DatasetKP.parse_raw(data_file.read())
```


#### Using

```python
for image_entry in dataset.images:
    print(image_entry.file_name)
```
