https://github.com/roma-glushko/coconutools
🥥 Modern API for good old MS-COCO datasets
https://github.com/roma-glushko/coconutools
Last synced: 6 months ago
JSON representation
🥥 Modern API for good old MS-COCO datasets
- Host: GitHub
- URL: https://github.com/roma-glushko/coconutools
- Owner: roma-glushko
- Created: 2022-01-01T18:21:05.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-17T14:06:46.000Z (over 3 years ago)
- Last Synced: 2025-02-12T11:53:52.770Z (8 months ago)
- Language: Python
- Homepage:
- Size: 97.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# coconutools
🥥 Modern API for [good old MS-COCO datasets](https://cocodataset.org/#format-data).
Features:
- Modern, easy-to-use, neat and tidy API
- Typed codebase with IDE autosuggestions and no "magic" numbers or tuples## Installation
CocoNuTools is installed like any other PyPi package:
```bash
# install via PIP
pip install coconutools
# or using Poetry
poetry add coconutools
```## Usage
```python
from pathlib import Pathfrom coconutools import COCO, Image
dataset = COCO(annotation_file=Path("./tmp/instances_train2014.json"))
print(f"COCO Dataset: {dataset.info.description} ({dataset.info.url})")
print(f"Categories: {','.join([category.name for category in dataset.categories])}")
print(f"Images: {len(dataset.images)}")for annotation in dataset.annotations:
image: Image = annotation.imageprint(f"ID #{annotation.id}: {image.width}x{image.height} [{annotation.category.name}]")
```