Skip to content

Commit

Permalink
Add COCO writer (#46)
Browse files Browse the repository at this point in the history
* docs: update tutorial 1.

* docs: update tutorial 2.

* chore: refactor writer to remove dependencies

* feat: add coco writer

* docs: clean docstrings

* fix: annotations format in coco writer

* docs: improve docstrings.

* docs: improve docs.
  • Loading branch information
blinjrm authored Oct 9, 2022
1 parent 4b8307e commit 1d1ecc0
Show file tree
Hide file tree
Showing 14 changed files with 719 additions and 491 deletions.
6 changes: 6 additions & 0 deletions docs/reference/readers.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Base reader class

::: detection_datasets.readers.base.BaseReader

<br>

# COCO reader

::: detection_datasets.readers.coco.CocoReader
26 changes: 26 additions & 0 deletions docs/reference/writers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Base writer class

This is the base class that other writers inherit from.
It enforces the use of the `write()` method in all writers.

::: detection_datasets.writers.base.BaseWriter

<br>

# Mmdet writer

This writer saves a dataset to disk in the MMdetection format, that is called "middle format" on the MMdetection documentation.
For more details check [Tutorial 2: Customize Datasets](https://mmdetection.readthedocs.io/en/latest/tutorials/customize_dataset.html#reorganize-new-data-format-to-middle-format) on the MMdetection documentation.

::: detection_datasets.writers.mmdet.MmdetWriter

<br>

# YOLO writer

This writer saves a dataset to disk in the YOLO format.

::: detection_datasets.writers.yolo.YoloWriter

<br>

# COCO writer

This writer saves a dataset to disk in the COCO format.

::: detection_datasets.writers.coco.CocoWriter
2 changes: 1 addition & 1 deletion docs/tutorials/2_Transform.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,7 @@
"3 thinks will happen when applying this new mapping: \n",
"- The existing categories will be replaced by their mapped category names\n",
"- The existing categories that have no equivalent in this mapping will be dropped \n",
"- The category_id will be recreated using the alphabetical order of the new categories (here 'Accessiroes' will have id et to 0, Bags to 1 and so on)"
"- The category_id will be recreated using the alphabetical order of the new categories (here 'Accessories' will have id 0, 'Bags' 1 and so on)"
]
},
{
Expand Down
10 changes: 9 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ nav:
- Writers: reference/writers.md

plugins:
- mkdocstrings
- mkdocstrings:
default_handler: python
handlers:
python:
options:
docstring_style: google
- section-index
- search
- mkdocs-jupyter:
Expand All @@ -61,3 +66,6 @@ markdown_extensions:
- pymdownx.superfences
- toc:
permalink: "#"

watch:
- src
Loading

0 comments on commit 1d1ecc0

Please sign in to comment.