From 4f25efd52ed435e145f4dd9613042c200cadc25f Mon Sep 17 00:00:00 2001 From: Martin Baeuml Date: Fri, 13 May 2011 11:08:14 +0200 Subject: [PATCH] document containers --- doc/api.rst | 7 ++++++- doc/concepts.rst | 6 +++--- doc/configuration.rst | 24 +++++++++--------------- doc/containers.rst | 10 ++++++++++ doc/index.rst | 1 + doc/inserters.rst | 2 ++ 6 files changed, 31 insertions(+), 19 deletions(-) create mode 100644 doc/containers.rst diff --git a/doc/api.rst b/doc/api.rst index 7e9aa1a..0f1d061 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -7,7 +7,7 @@ API annotationmodel =============== -.. automodule:: annotationmodel +.. automodule:: annotations.model .. autoclass:: AnnotationModel :members: :undoc-members: @@ -36,6 +36,11 @@ annotationmodel :members: :undoc-members: +annotation.container +==================== +.. automodule:: annotations.container +.. autoclass:: AnnotationContainer + :members: annotationscene =============== diff --git a/doc/concepts.rst b/doc/concepts.rst index 5c01998..fb07096 100644 --- a/doc/concepts.rst +++ b/doc/concepts.rst @@ -110,7 +110,7 @@ The storage on disk of the labels however can be very different. The label tool does not have *the one* in which way to store the labels. Again, there are some default formats with which the label tool can deal out of the box (one of which will be a yaml file, which resembles the textual representation above). However, -you are free to define your own loading and saving routines for your labels (see ***). This -allows you for example to support legacy third-party label formats without the need of converting -them first. +you are free to define your own loading and saving routines for your labels (see :doc:`Containers`). This +allows you for example to support legacy third-party label formats without the need of converting +them to yaml first. diff --git a/doc/configuration.rst b/doc/configuration.rst index 783a898..0e27c6f 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -90,33 +90,27 @@ Defines a mapping of which inserter should be used for interactively inserting a into the image. The default inserters allow to draw the respective shape. Read more about how to write your own inserter in :ref:`Inserters`. -.. _LOADERS: +.. _CONTAINERS: -LOADERS -------- +CONTAINERS +---------- Default:: { - 'txt': 'loaders.SimpleOneLinerTextLoader', - 'yaml': 'loaders.YamlLoader', - 'pickle': 'loaders.PickleLoader', + '*.txt': 'annotations.container.SimpleOneLinerTextContainer', + '*.yaml': 'annotations.container.YamlContainer', + '*.pickle': 'annotations.container.PickleContainer', } -Defines a mapping of which loader should be used for loading a label file with the given extension. -This can of course also be a user defined loader. You can also define the class directly (instead +Defines a mapping of which container should be used for loading a label file matching the given filename pattern. +This can of course also be a user defined container. You can also define the class directly (instead of a module path):: { - 'foo': MyFooLoader + '*.foo': MyFooContainer } -.. todo:: - - What is a better name for LOADERS? SERIALIZERS? Because this class should take care of - writing the labels to the file as well. - - .. _PLUGINS: PLUGINS diff --git a/doc/containers.rst b/doc/containers.rst new file mode 100644 index 0000000..f04eea3 --- /dev/null +++ b/doc/containers.rst @@ -0,0 +1,10 @@ +.. highlight:: python + +========== +Containers +========== + +Annotation containers provide functions for loading and saving labels. You can +supply custom containers to support specific label formats. + +.. todo:: write diff --git a/doc/index.rst b/doc/index.rst index 4f4295a..4d3b955 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -31,6 +31,7 @@ Contents configuration items inserters + containers api diff --git a/doc/inserters.rst b/doc/inserters.rst index 2201bc1..026e5ac 100644 --- a/doc/inserters.rst +++ b/doc/inserters.rst @@ -1,3 +1,5 @@ +.. highlight:: python + ========= Inserters =========