Simple Annotation Viewer using OpenCV.

AnnotationViewer
The Annotation Viewer.

Current supported annotations:

  • circle
  • ellipse
  • point
  • polyline
  • rectangle

Supported keyboard commands:

  • n: Go to next annotation
  • b: Go to previous annotation
  • q: Quit

ImageLoader[source]

Enum = [OPEN_CV, PILLOW]

Currently supported image loader libraries.

show_annotated_images[source]

show_annotated_images(annotation_adapter, subset_type, image_loader, max_width=0, max_height=0, filter_names=None)

Show images with corresponding annotations. Images are shown one at a time with switching by using the arrow left/right keys. annotation_adapter: The annotation adapter to use subset_type: The subset to load image_loader: The image loader library to use max_width: The maximum width to scale the image for visibility. max_height: The maximum height to scale the image for visibility.

Helper Methods

configure_logging[source]

configure_logging(logging_level=20)

Configures logging for the system.

:param logging_level: The logging level to use.

Run from command line

To run the annotation viewer from command line, use the following command: python -m mlcore.via.annotation_viewer [parameters]

The following parameters are supported:

  • -a, --annotation: The annotation adapter to read the annotations (e.g.: VIAAnnotationAdapter)
  • --image_loader: The image library for reading the image, default is Pillow
  • --subset: The image subset to read, default is trainval for reading collections.
  • --max-width: The maximum width to scale the image for visibility, default is no scale
  • --max-height: The maximum height to scale the image for visibility, default is no scale