Welcome to kwcoco’s documentation!¶
If you are new, please see our getting started document: getting_started.
Please also see information in the repo README, which contains similar but complementary information.
Documentation about higher level kwcoco concepts can be found here.
from __future__ import annotations
The Kitware COCO module defines a variant of the Microsoft COCO format, originally developed for the “collected images in context” object detection challenge. We are backwards compatible with the original module, but we also have improved implementations in several places, including segmentations, keypoints, annotation tracks, multi-spectral images, and videos (which represents a generic sequence of images).
A kwcoco file is a “manifest” that serves as a single reference that points to all images, categories, and annotations in a computer vision dataset. Thus, when applying an algorithm to a dataset, it is sufficient to have the algorithm take one dataset parameter: the path to the kwcoco file. Generally a kwcoco file will live in a “bundle” directory along with the data that it references, and paths in the kwcoco file will be relative to the location of the kwcoco file itself.
The main data structure in this model is largely based on the implementation in https://github.com/cocodataset/cocoapi It uses the same efficient core indexing data structures, but in our implementation the indexing can be optionally turned off, functions are silent by default (with the exception of long running processes, which optionally show progress by default). We support helper functions that add and remove images, categories, and annotations.
The kwcoco.CocoDataset class is capable of dynamic addition and removal
of categories, images, and annotations. Has better support for keypoints and
segmentation formats than the original COCO format. Despite being written in
Python, this data structure is reasonably efficient.
>>> import kwcoco
>>> import json
>>> # Create demo data
>>> demo = kwcoco.CocoDataset.demo()
>>> # Reroot can switch between absolute / relative-paths
>>> demo.reroot(absolute=True)
>>> # could also use demo.dump / demo.dumps, but this is more explicit
>>> text = json.dumps(demo.dataset)
>>> with open('demo.json', 'w') as file:
>>> file.write(text)
>>> # Read from disk
>>> self = kwcoco.CocoDataset('demo.json')
>>> # Add data
>>> cid = self.add_category('Cat')
>>> gid = self.add_image('new-img.jpg')
>>> aid = self.add_annotation(image_id=gid, category_id=cid, bbox=[0, 0, 100, 100])
>>> # Remove data
>>> self.remove_annotations([aid])
>>> self.remove_images([gid])
>>> self.remove_categories([cid])
>>> # Look at data
>>> import ubelt as ub
>>> print(ub.urepr(self.basic_stats(), nl=1))
>>> print(ub.urepr(self.extended_stats(), nl=2))
>>> print(ub.urepr(self.boxsize_stats(), nl=3))
>>> print(ub.urepr(self.category_annotation_frequency()))
>>> # Inspect data
>>> # xdoctest: +REQUIRES(module:kwplot)
>>> import kwplot
>>> kwplot.autompl()
>>> self.show_image(gid=1)
>>> # Access single-item data via imgs, cats, anns
>>> cid = 1
>>> self.cats[cid]
{'id': 1, 'name': 'astronaut', 'supercategory': 'human'}
>>> gid = 1
>>> self.imgs[gid]
{'id': 1, 'file_name': '...astro.png', 'url': 'https://i.imgur.com/KXhKM72.png'}
>>> aid = 3
>>> self.anns[aid]
{'id': 3, 'image_id': 1, 'category_id': 3, 'line': [326, 369, 500, 500]}
>>> # Access multi-item data via the annots and images helper objects
>>> aids = self.index.gid_to_aids[2]
>>> annots = self.annots(aids)
>>> print('annots = {}'.format(ub.urepr(annots, nl=1, sv=1)))
annots = <Annots(num=2)>
>>> annots.lookup('category_id')
[6, 4]
>>> annots.lookup('bbox')
[[37, 6, 230, 240], [124, 96, 45, 18]]
>>> # built in conversions to efficient kwimage array DataStructures
>>> print(ub.urepr(annots.detections.data, sv=1))
{
'boxes': <Boxes(xywh,
array([[ 37., 6., 230., 240.],
[124., 96., 45., 18.]], dtype=float32))>,
'class_idxs': [5, 3],
'keypoints': <PointsList(n=2)>,
'segmentations': <PolygonList(n=2)>,
}
>>> gids = list(self.imgs.keys())
>>> images = self.images(gids)
>>> print('images = {}'.format(ub.urepr(images, nl=1, sv=1)))
images = <Images(num=3)>
>>> images.lookup('file_name')
['...astro.png', '...carl.png', '...stars.png']
>>> print('images.annots = {}'.format(images.annots))
images.annots = <AnnotGroups(n=3, m=3.7, s=3.9)>
>>> print('images.annots.cids = {!r}'.format(images.annots.cids))
images.annots.cids = [[1, 2, 3, 4, 5, 5, 5, 5, 5], [6, 4], []]
CocoDataset API¶
The following is a logical grouping of the public kwcoco.CocoDataset API attributes and methods. See the in-code documentation for further details.
CocoDataset classmethods (via MixinCocoConstructors)¶
kwcoco.CocoDataset.coerce- Attempt to transform the input into the intended CocoDataset.
kwcoco.CocoDataset.coerce_multiple- Coerce multiple CocoDataset objects in parallel.
kwcoco.CocoDataset.demo- Create a toy coco dataset for testing and demo purposes
kwcoco.CocoDataset.empty- Create an empty dataset
kwcoco.CocoDataset.from_class_image_paths- Ingest classification data in the common format where images of different categories are stored in folders with the category label.
kwcoco.CocoDataset.from_coco_paths- Constructor from multiple coco file paths.
kwcoco.CocoDataset.from_data- Constructor from a json dictionary
kwcoco.CocoDataset.from_image_paths- Constructor from a list of images paths.
kwcoco.CocoDataset.load- Constructor from a open file or file path.
kwcoco.CocoDataset.load_multiple- Load multiple CocoDataset objects in parallel.
kwcoco.CocoDataset.random- Creates a random CocoDataset according to distribution parameters
CocoDataset slots¶
kwcoco.CocoDataset.index- an efficient lookup index into the coco data structure. The index defines its own attributes likeanns,cats,imgs,gid_to_aids,file_name_to_img, etc. SeeCocoIndexfor more details on which attributes are available.
kwcoco.CocoDataset.hashid- If computed, this will be a hash uniquely identifying the dataset. To ensure this is computed seekwcoco.coco_dataset.MixinCocoHashing._build_hashid().
kwcoco.CocoDataset.hashid_parts-
kwcoco.CocoDataset.tag- A tag indicating the name of the dataset.
kwcoco.CocoDataset.dataset- raw json data structure. This is the base dictionary that contains {‘annotations’: List, ‘images’: List, ‘categories’: List}
kwcoco.CocoDataset.bundle_dpath- If known, this is the root path that all image file names are relative to. This can also be manually overwritten by the user.
kwcoco.CocoDataset.assets_dpath-
kwcoco.CocoDataset.cache_dpath-
CocoDataset properties¶
kwcoco.CocoDataset.anns-
kwcoco.CocoDataset.cats-
kwcoco.CocoDataset.cid_to_aids-
kwcoco.CocoDataset.data_fpath-
kwcoco.CocoDataset.data_root-
kwcoco.CocoDataset.fpath- if known, this stores the filepath the dataset was loaded from
kwcoco.CocoDataset.gid_to_aids-
kwcoco.CocoDataset.img_root-
kwcoco.CocoDataset.imgs-
kwcoco.CocoDataset.n_annots-
kwcoco.CocoDataset.n_cats-
kwcoco.CocoDataset.n_images-
kwcoco.CocoDataset.n_videos-
kwcoco.CocoDataset.name_to_cat-
CocoDataset methods (via MixinCocoAddRemove)¶
kwcoco.CocoDataset.add_annotation- Register a new annotation with the dataset
kwcoco.CocoDataset.add_annotations- Faster less-safe multi-item alternative to add_annotation.
kwcoco.CocoDataset.add_asset- Adds an auxiliary / asset item to the image dictionary.
kwcoco.CocoDataset.add_auxiliary_item- Adds an auxiliary / asset item to the image dictionary.
kwcoco.CocoDataset.add_categories- Faster less-safe multi-item alternative to add_category.
kwcoco.CocoDataset.add_category- Register a new category with the dataset
kwcoco.CocoDataset.add_image- Register a new image with the dataset
kwcoco.CocoDataset.add_images- Faster less-safe multi-item alternative
kwcoco.CocoDataset.add_keypoint_categories- Faster less-safe multi-item alternative to add_category.
kwcoco.CocoDataset.add_track- Register a new track with the dataset
kwcoco.CocoDataset.add_video- Register a new video with the dataset
kwcoco.CocoDataset.clear_annotations- Removes all annotations and tracks (but not images and categories)
kwcoco.CocoDataset.clear_images- Removes all images and annotations (but not categories)
kwcoco.CocoDataset.ensure_category- Register a category if it is new or returns an existing id.
kwcoco.CocoDataset.ensure_image- Register an image if it is new or returns an existing id.
kwcoco.CocoDataset.ensure_track- Register a track if it is new or returns an existing id.
kwcoco.CocoDataset.ensure_video- Register a video if it is new or returns an existing id.
kwcoco.CocoDataset.remove_annotation- Remove a single annotation from the dataset
kwcoco.CocoDataset.remove_annotation_keypoints- Removes all keypoints with a particular category
kwcoco.CocoDataset.remove_annotations- Remove multiple annotations from the dataset.
kwcoco.CocoDataset.remove_categories- Remove categories and all annotations in those categories.
kwcoco.CocoDataset.remove_images- Remove images and any annotations contained by them
kwcoco.CocoDataset.remove_keypoint_categories- Removes all keypoints of a particular category as well as all annotation keypoints with those ids.
kwcoco.CocoDataset.remove_tracks- Remove tracks and all annotations in those tracks.
kwcoco.CocoDataset.remove_videos- Remove videos and any images / annotations contained by them
kwcoco.CocoDataset.set_annotation_category- Sets the category of a single annotation
CocoDataset methods (via MixinCocoObjects)¶
kwcoco.CocoDataset.annots- Return vectorized annotation objects
kwcoco.CocoDataset.categories- Return vectorized category objects
kwcoco.CocoDataset.images- Return vectorized image objects
kwcoco.CocoDataset.tracks- Return vectorized track objects
kwcoco.CocoDataset.videos- Return vectorized video objects
CocoDataset methods (via MixinCocoStats)¶
kwcoco.CocoDataset.basic_stats- Reports number of images, annotations, and categories.
kwcoco.CocoDataset.boxsize_stats- Compute statistics about bounding box sizes.
kwcoco.CocoDataset.category_annotation_frequency- Reports the number of annotations of each category
kwcoco.CocoDataset.conform- Make the COCO file conform a stricter spec, infers attributes where possible.
kwcoco.CocoDataset.extended_stats- Reports number of images, annotations, and categories.
kwcoco.CocoDataset.find_representative_images- Find images that have a wide array of categories.
kwcoco.CocoDataset.stats- Compute summary statistics to describe the dataset at a high level
kwcoco.CocoDataset.validate- Performs checks on this coco dataset.
CocoDataset methods (via MixinCocoDepricate)¶
kwcoco.CocoDataset.category_annotation_type_frequency- DEPRECATED
kwcoco.CocoDataset.imread- DEPRECATED: use load_image or delayed_image
kwcoco.CocoDataset.keypoint_annotation_frequency- DEPRECATED
CocoDataset methods (via MixinCocoAccessors)¶
kwcoco.CocoDataset.category_graph- Construct a networkx category hierarchy
kwcoco.CocoDataset.coco_image- Args: gid (int): image id
kwcoco.CocoDataset.delayed_load- Experimental method
kwcoco.CocoDataset.get_auxiliary_fpath- Returns the full path to auxiliary data for an image
kwcoco.CocoDataset.get_image_fpath- Returns the full path to the image
kwcoco.CocoDataset.keypoint_categories- Construct a consistent CategoryTree representation of keypoint classes
kwcoco.CocoDataset.load_annot_sample- Reads the chip of an annotation. Note this is much less efficient than using a sampler, but it doesn’t require disk cache.
kwcoco.CocoDataset.load_image- Reads an image from disk and
kwcoco.CocoDataset.object_categories- Construct a consistent CategoryTree representation of object classes
CocoDataset methods (via CocoDataset)¶
kwcoco.CocoDataset.copy- Deep copies this object
kwcoco.CocoDataset.dump- Writes the dataset out to the json format
kwcoco.CocoDataset.dumps- Writes the dataset out to the json format
kwcoco.CocoDataset.rebuild_index- Build or rebuild the fast lookup index.
kwcoco.CocoDataset.subset- Return a subset of the larger coco dataset by specifying which images to port. All annotations in those images will be taken.
kwcoco.CocoDataset.union- Merges multipleCocoDatasetitems into one. Names and associations are retained, but ids may be different.
kwcoco.CocoDataset.view_sql- Create a cached SQL interface to this dataset suitable for large scale multiprocessing use cases.
CocoDataset methods (via MixinCocoExtras)¶
kwcoco.CocoDataset.corrupted_images- Check for images that don’t exist or can’t be opened
kwcoco.CocoDataset.missing_images- Check for images that don’t exist
kwcoco.CocoDataset.rename_categories- Rename categories with a potentially coarser categorization.
kwcoco.CocoDataset.reroot- Modify the prefix of the image/data paths onto a new image/data root.
CocoDataset methods (via MixinCocoDraw)¶
kwcoco.CocoDataset.draw_image- Use kwimage to draw all annotations on an image and return the pixels as a numpy array.
kwcoco.CocoDataset.show_image- Use matplotlib to show an image with annotations overlaid
Package Layout
- kwcoco
- kwcoco package
- Subpackages
- kwcoco.cli package
- Submodules
- kwcoco.cli.__main__ module
- kwcoco.cli.coco_conform module
- kwcoco.cli.coco_eval module
- kwcoco.cli.coco_fixup module
- kwcoco.cli.coco_grab module
- kwcoco.cli.coco_info module
- kwcoco.cli.coco_modify_categories module
- kwcoco.cli.coco_move module
- kwcoco.cli.coco_move_assets module
- kwcoco.cli.coco_plot_stats module
PlotStatsCLIprep_plots()run()rerun_plots()geospatial_stats()build_stats_data()PlotsBuiltinPlotsBuiltinPlots.polygon_centroid_absolute_distribution()BuiltinPlots.polygon_centroid_relative_distribution()BuiltinPlots.polygon_centroid_absolute_distribution_jointplot()BuiltinPlots.polygon_centroid_relative_distribution_jointplot()BuiltinPlots.image_size_histogram()BuiltinPlots.image_size_scatter()BuiltinPlots.obox_size_distribution()BuiltinPlots.obox_size_distribution_jointplot()BuiltinPlots.obox_size_distribution_logscale()BuiltinPlots.polygon_area_vs_num_verts()BuiltinPlots.polygon_area_vs_num_verts_jointplot()BuiltinPlots.polygon_area_vs_num_verts_jointplot_logscale()BuiltinPlots.polygon_area_histogram_logscale()BuiltinPlots.polygon_area_histogram()BuiltinPlots.polygon_area_histogram_splity()BuiltinPlots.polygon_num_vertices_histogram()BuiltinPlots.anns_per_image_histogram()BuiltinPlots.anns_per_image_histogram_splity()BuiltinPlots.anns_per_image_histogram_ge1()BuiltinPlots.images_over_time()BuiltinPlots.images_timeofday_distribution()BuiltinPlots.all_polygons()
polygon_shape_stats()geometry_flatten()geometry_length()
- kwcoco.cli.coco_reroot module
- kwcoco.cli.coco_show module
- kwcoco.cli.coco_split module
- kwcoco.cli.coco_stats module
- kwcoco.cli.coco_subset module
- kwcoco.cli.coco_toydata module
- kwcoco.cli.coco_union module
- kwcoco.cli.coco_validate module
- kwcoco.cli.find_unregistered_images module
- kwcoco.cli.finish_install module
- Module contents
- Submodules
- kwcoco.data package
- kwcoco.demo package
- Submodules
- kwcoco.demo.boids module
- kwcoco.demo.perterb module
- kwcoco.demo.toydata module
- kwcoco.demo.toydata_image module
- kwcoco.demo.toydata_video module
- kwcoco.demo.toypatterns module
CategoryPatternsCategoryPatterns._default_categoriesCategoryPatterns._default_keypoint_categoriesCategoryPatterns._default_catnamesCategoryPatterns.coerce()CategoryPatterns.index()CategoryPatterns.get()CategoryPatterns.random_category()CategoryPatterns.render_category()CategoryPatterns._todo_refactor_geometric_info()CategoryPatterns._package_info()CategoryPatterns._from_elem()
star()Rasters
- Module contents
- Submodules
- kwcoco.formats package
- Submodules
- kwcoco.formats.kpf module
- kwcoco.formats.kw18 module
- kwcoco.formats.labelme module
labelme_to_coco_structure()LabelMeFileLabelMeFile.demo()LabelMeFile.empty()LabelMeFile.load()LabelMeFile.multiple_from_coco()LabelMeFile.reroot()LabelMeFile.from_coco()LabelMeFile.add_to_coco()LabelMeFile.to_coco()LabelMeFile.add_point()LabelMeFile.add_polygon()LabelMeFile.add_rectangle()LabelMeFile.dump()LabelMeFile.dumps()
- kwcoco.formats.voc module
- kwcoco.formats.webdataset module
- Module contents
- Submodules
- kwcoco.metrics package
- Submodules
- kwcoco.metrics.assignment module
- kwcoco.metrics.clf_report module
- kwcoco.metrics.confusion_measures module
- kwcoco.metrics.confusion_vectors module
- kwcoco.metrics.detect_metrics module
DetectionMetricsDetectionMetrics.gid_to_true_detsDetectionMetrics.gid_to_pred_detsDetectionMetrics.clear()DetectionMetrics.enrich_confusion_vectors()DetectionMetrics.from_coco()DetectionMetrics._register_imagename()DetectionMetrics.add_predictions()DetectionMetrics.add_truth()DetectionMetrics.true_detections()DetectionMetrics.pred_detections()DetectionMetrics.classesDetectionMetrics.confusion_vectors()DetectionMetrics.score_kwant()DetectionMetrics.score_kwcoco()DetectionMetrics.score_voc()DetectionMetrics._to_coco()DetectionMetrics.score_pycocotools()DetectionMetrics.score_coco()DetectionMetrics.demo()DetectionMetrics.summarize()
_demo_construct_probs()pycocotools_confusion_vectors()eval_detections_cli()_summarize()pct_summarize2()
- kwcoco.metrics.drawing module
- kwcoco.metrics.functional module
- kwcoco.metrics.segmentation_metrics module
SegmentationEvalConfigmain()SingleImageSegmentationMetricsSingleImageSegmentationMetrics.run()SingleImageSegmentationMetrics.resolve_config_variables()SingleImageSegmentationMetrics.prepare_common_truth()SingleImageSegmentationMetrics.build_saliency_masks()SingleImageSegmentationMetrics.build_class_masks()SingleImageSegmentationMetrics.score_saliency_masks()SingleImageSegmentationMetrics.score_class_masks()
single_image_segmentation_metrics()_memo_legend()draw_confusion_image()colorize_class_probs()draw_truth_borders()draw_chunked_confusion()dump_chunked_confusion()evaluate_segmentations()_redraw_measures()_max_digits()build_image_header_text()ensure_heuristic_coco_colors()ensure_heuristic_category_tree_colors()_ensure_distinct_dict_colors()colorize_weights()_poc_online_binary_saliency_measures_demo()
- kwcoco.metrics.sklearn_alts module
- kwcoco.metrics.voc_metrics module
- Module contents
BinaryConfusionVectorsConfusionVectorsDetectionMetricsDetectionMetrics.gid_to_true_detsDetectionMetrics.gid_to_pred_detsDetectionMetrics.clear()DetectionMetrics.enrich_confusion_vectors()DetectionMetrics.from_coco()DetectionMetrics._register_imagename()DetectionMetrics.add_predictions()DetectionMetrics.add_truth()DetectionMetrics.true_detections()DetectionMetrics.pred_detections()DetectionMetrics.classesDetectionMetrics.confusion_vectors()DetectionMetrics.score_kwant()DetectionMetrics.score_kwcoco()DetectionMetrics.score_voc()DetectionMetrics._to_coco()DetectionMetrics.score_pycocotools()DetectionMetrics.score_coco()DetectionMetrics.demo()DetectionMetrics.summarize()
MeasuresOneVsRestConfusionVectorsPerClass_Measureseval_detections_cli()
- Submodules
- kwcoco.rc package
- kwcoco.util package
- Subpackages
- Submodules
- kwcoco.util.dict_like module
- kwcoco.util.dict_proxy2 module
- kwcoco.util.ijson_ext module
- kwcoco.util.jsonschema_elements module
- kwcoco.util.lazy_frame_backends module
- kwcoco.util.util_archive module
- kwcoco.util.util_deprecate module
- kwcoco.util.util_eval module
- kwcoco.util.util_futures module
- kwcoco.util.util_json module
- kwcoco.util.util_kwutil module
- kwcoco.util.util_monkey module
- kwcoco.util.util_networkx module
- kwcoco.util.util_parallel module
- kwcoco.util.util_reroot module
- kwcoco.util.util_rich module
- kwcoco.util.util_sklearn module
- kwcoco.util.util_special_json module
- kwcoco.util.util_truncate module
- kwcoco.util.util_windows module
- Module contents
ALLOF()ANYOF()ARRAY()ArchiveContainerElementsDictLikeElementIndexableWalkerIndexableWalker.dataIndexableWalker.dict_clsIndexableWalker.list_clsIndexableWalker.indexable_clsIndexableWalker._walk_genIndexableWalker.send()IndexableWalker.throw()IndexableWalker.keys()IndexableWalker.values()IndexableWalker._abc_implIndexableWalker._walk()IndexableWalker.allclose()IndexableWalker.diff()
NOT()OBJECT()ONEOF()QuantifierElementsScalarElementsSchemaElementsStratifiedGroupKFoldensure_json_serializable()find_json_unserializable()indexable_allclose()resolve_directory_symlinks()resolve_relative_to()smart_truncate()special_reroot_single()unarchive_file()
- kwcoco.cli package
- Submodules
- kwcoco.__main__ module
- kwcoco._helpers module
- kwcoco.abstract_coco_dataset module
- kwcoco.category_tree module
CategoryTreeCategoryTree.copy()CategoryTree.from_mutex()CategoryTree.from_json()CategoryTree.from_coco()CategoryTree.coerce()CategoryTree.demo()CategoryTree.to_coco()CategoryTree.id_to_idxCategoryTree.idx_to_idCategoryTree.idx_to_ancestor_idxsCategoryTree.idx_to_descendants_idxsCategoryTree.idx_pairwise_distanceCategoryTree.is_mutex()CategoryTree.num_classesCategoryTree.class_namesCategoryTree.category_namesCategoryTree.catsCategoryTree.index()CategoryTree.take()CategoryTree.subgraph()CategoryTree._build_index()CategoryTree.show()CategoryTree.forest_str()CategoryTree.print_graph()CategoryTree.normalize()
- kwcoco.channel_spec module
- kwcoco.coco_dataset module
MixinCocoDepricateMixinCocoAccessorsMixinCocoAccessors.delayed_load()MixinCocoAccessors.load_image()MixinCocoAccessors.get_image_fpath()MixinCocoAccessors._get_img_auxiliary()MixinCocoAccessors.get_auxiliary_fpath()MixinCocoAccessors.load_annot_sample()MixinCocoAccessors._resolve_to_id()MixinCocoAccessors._resolve_to_cid()MixinCocoAccessors._resolve_to_gid()MixinCocoAccessors._resolve_to_vidid()MixinCocoAccessors._resolve_to_trackid()MixinCocoAccessors._resolve_to_ann()MixinCocoAccessors._resolve_to_img()MixinCocoAccessors._resolve_to_kpcat()MixinCocoAccessors._resolve_to_cat()MixinCocoAccessors._alias_to_cat()MixinCocoAccessors.category_graph()MixinCocoAccessors.object_categories()MixinCocoAccessors.keypoint_categories()MixinCocoAccessors._keypoint_category_names()MixinCocoAccessors._lookup_kpnames()MixinCocoAccessors._coco_image()MixinCocoAccessors.coco_image()
MixinCocoConstructorsMixinCocoConstructors.coerce()MixinCocoConstructors.demo()MixinCocoConstructors.random()MixinCocoConstructors.empty()MixinCocoConstructors.load()MixinCocoConstructors.from_data()MixinCocoConstructors.from_image_paths()MixinCocoConstructors.from_class_image_paths()MixinCocoConstructors.coerce_multiple()MixinCocoConstructors.load_multiple()MixinCocoConstructors._load_multiple()MixinCocoConstructors.from_coco_paths()
MixinCocoExtrasMixinCocoExtras._tree()MixinCocoExtras._dataset_id()MixinCocoExtras._ensure_imgsize()MixinCocoExtras._ensure_image_data()MixinCocoExtras.missing_images()MixinCocoExtras.corrupted_images()MixinCocoExtras.normalize_category_ids()MixinCocoExtras.rename_categories()MixinCocoExtras._ensure_json_serializable()MixinCocoExtras._aspycoco()MixinCocoExtras.reroot()MixinCocoExtras.data_rootMixinCocoExtras.img_rootMixinCocoExtras.data_fpath
MixinCocoHashingMixinCocoObjectsMixinCocoStatsMixinCocoStats.n_annotsMixinCocoStats.n_imagesMixinCocoStats.n_catsMixinCocoStats.n_tracksMixinCocoStats.n_videosMixinCocoStats.category_annotation_frequency()MixinCocoStats.conform()MixinCocoStats.validate()MixinCocoStats.stats()MixinCocoStats.basic_stats()MixinCocoStats.extended_stats()MixinCocoStats.boxsize_stats()MixinCocoStats.find_representative_images()
MixinCocoDraw_normalize_intensity_if_needed()MixinCocoAddRemoveMixinCocoAddRemove.add_video()MixinCocoAddRemove.add_image()MixinCocoAddRemove.add_asset()MixinCocoAddRemove.add_auxiliary_item()MixinCocoAddRemove.add_annotation()MixinCocoAddRemove.add_category()MixinCocoAddRemove.add_track()MixinCocoAddRemove.ensure_video()MixinCocoAddRemove.ensure_track()MixinCocoAddRemove.ensure_image()MixinCocoAddRemove.ensure_category()MixinCocoAddRemove.add_categories()MixinCocoAddRemove.add_keypoint_categories()MixinCocoAddRemove.add_annotations()MixinCocoAddRemove.add_images()MixinCocoAddRemove.clear_images()MixinCocoAddRemove.clear_annotations()MixinCocoAddRemove.remove_annotation()MixinCocoAddRemove.remove_annotations()MixinCocoAddRemove.remove_categories()MixinCocoAddRemove.remove_tracks()MixinCocoAddRemove.remove_images()MixinCocoAddRemove.remove_videos()MixinCocoAddRemove.remove_annotation_keypoints()MixinCocoAddRemove.remove_keypoint_categories()MixinCocoAddRemove.set_annotation_category()
CocoIndexCocoIndex._setCocoIndex._images_set_sorted_by_frame_index()CocoIndex._set_sorted_by_frame_index()CocoIndex._annots_set_sorted_by_frame_index()CocoIndex.cid_to_gidsCocoIndex._add_video()CocoIndex._add_image()CocoIndex._add_images()CocoIndex._add_annotation()CocoIndex._add_keypoint_categories()CocoIndex._add_categories()CocoIndex._add_annotations()CocoIndex._add_category()CocoIndex._add_track()CocoIndex._remove_all_annotations()CocoIndex._remove_all_images()CocoIndex._remove_keypoint_categories()CocoIndex._remove_annotations()CocoIndex._remove_tracks()CocoIndex._remove_categories()CocoIndex._remove_images()CocoIndex._remove_videos()CocoIndex.clear()CocoIndex.build()
MixinCocoIndexCocoDatasetCocoDataset.fpathCocoDataset._update_fpath()CocoDataset._infer_dirs()CocoDataset.copy()CocoDataset.dumps()CocoDataset._compress_dump_to_fileptr()CocoDataset._dump()CocoDataset.dump()CocoDataset._check_json_serializable()CocoDataset._check_integrity()CocoDataset._check_warnables()CocoDataset._check_index()CocoDataset._check_pointers()CocoDataset._build_index()CocoDataset._abc_implCocoDataset.rebuild_index()CocoDataset.union()CocoDataset.subset()CocoDataset.view_sql()
demo_coco_data()
- kwcoco.coco_evaluator module
- kwcoco.coco_image module
_CocoObjectCocoImageCocoImage.from_gid()CocoImage.videoCocoImage.nameCocoImage.detach()CocoImage.assetsCocoImage.datetimeCocoImage.annots()CocoImage.stats()CocoImage.get()CocoImage.keys()CocoImage.channelsCocoImage.n_assetsCocoImage.num_channelsCocoImage.dsizeCocoImage.image_filepath()CocoImage.primary_image_filepath()CocoImage.primary_asset()CocoImage.iter_image_filepaths()CocoImage.iter_assets()CocoImage.iter_asset_objs()CocoImage.find_asset()CocoImage.find_asset_obj()CocoImage._assets_key()CocoImage.add_annotation()CocoImage.add_asset()CocoImage.imdelay()CocoImage.valid_regionCocoImage.warp_vid_from_imgCocoImage.warp_img_from_vidCocoImage._warp_for_resolution()CocoImage._annot_segmentation()CocoImage._annot_segmentations()CocoImage.resolution()CocoImage._scalefactor_for_resolution()CocoImage._detections_for_resolution()CocoImage.add_auxiliary_item()CocoImage.delay()CocoImage.show()CocoImage.draw()
CocoAssetCocoVideoCocoAnnotationCocoCategoryCocoTrack_delay_load_imglike()parse_quantity()coerce_resolution()
- kwcoco.coco_objects1d module
ObjectList1DObjectList1D._id_to_objObjectList1D.unique()ObjectList1D.idsObjectList1D.objs_iter()ObjectList1D.objsObjectList1D.take()ObjectList1D.compress()ObjectList1D.peek()ObjectList1D.lookup()ObjectList1D.sort_values()ObjectList1D.get()ObjectList1D.get_iter()ObjectList1D._iter_get()ObjectList1D.set()ObjectList1D._set()ObjectList1D._lookup()ObjectList1D.attribute_frequency()
ObjectGroupsCategoriesVideosImagesAnnotsTracksAnnotGroupsImageGroups_BaseViewObjViewCocoImageView
- kwcoco.coco_schema module
- kwcoco.coco_sql_dataset module
FallbackCocoBaseCategoryKeypointCategoryVideoImageTrackAnnotationAnnotation.idAnnotation.image_idAnnotation.category_idAnnotation.track_idAnnotation.segmentationAnnotation.keypointsAnnotation.bboxAnnotation._bbox_xAnnotation._bbox_yAnnotation._bbox_wAnnotation._bbox_hAnnotation.scoreAnnotation.weightAnnotation.probAnnotation.iscrowdAnnotation.captionAnnotation._unstructuredAnnotation._sa_class_manager
clsorm_to_dict()dict_restructure()_orm_yielder()_raw_yielder()_new_proxy_cache()SqlListProxySqlDictProxySqlIdGroupDictProxyCocoSqlIndex_handle_sql_uri()CocoSqlDatabaseCocoSqlDatabase.MEMORY_URICocoSqlDatabase.coerce()CocoSqlDatabase.disconnect()CocoSqlDatabase.connect()CocoSqlDatabase.fpathCocoSqlDatabase.delete()CocoSqlDatabase.table_names()CocoSqlDatabase.populate_from()CocoSqlDatabase.datasetCocoSqlDatabase.annsCocoSqlDatabase.catsCocoSqlDatabase.imgsCocoSqlDatabase.name_to_catCocoSqlDatabase.pandas_table()CocoSqlDatabase.raw_table()CocoSqlDatabase._raw_tables()CocoSqlDatabase._column_lookup()CocoSqlDatabase._all_rows_column_lookup()CocoSqlDatabase.tabular_targets()CocoSqlDatabase._table_names()CocoSqlDatabase.bundle_dpathCocoSqlDatabase.data_fpathCocoSqlDatabase._orig_coco_fpath()CocoSqlDatabase._abc_implCocoSqlDatabase._cached_hashid()
cached_sql_coco_view()ensure_sql_coco_view()demo()assert_dsets_allclose()_benchmark_dset_readtime()_benchmark_dict_proxy_ops()devcheck()
- kwcoco.compat_dataset module
- kwcoco.exceptions module
- kwcoco.kpf module
- kwcoco.kw18 module
- kwcoco.sensorchan_spec module
- Module contents
- CocoDataset API
- CocoDataset classmethods (via MixinCocoConstructors)
- CocoDataset slots
- CocoDataset properties
- CocoDataset methods (via MixinCocoAddRemove)
- CocoDataset methods (via MixinCocoObjects)
- CocoDataset methods (via MixinCocoStats)
- CocoDataset methods (via MixinCocoDepricate)
- CocoDataset methods (via MixinCocoAccessors)
- CocoDataset methods (via CocoDataset)
- CocoDataset methods (via MixinCocoExtras)
- CocoDataset methods (via MixinCocoDraw)
AbstractCocoDatasetCategoryTreeCategoryTree.copy()CategoryTree.from_mutex()CategoryTree.from_json()CategoryTree.from_coco()CategoryTree.coerce()CategoryTree.demo()CategoryTree.to_coco()CategoryTree.id_to_idxCategoryTree.idx_to_idCategoryTree.idx_to_ancestor_idxsCategoryTree.idx_to_descendants_idxsCategoryTree.idx_pairwise_distanceCategoryTree.is_mutex()CategoryTree.num_classesCategoryTree.class_namesCategoryTree.category_namesCategoryTree.catsCategoryTree.index()CategoryTree.take()CategoryTree.subgraph()CategoryTree._build_index()CategoryTree.show()CategoryTree.forest_str()CategoryTree.print_graph()CategoryTree.normalize()
ChannelSpecChannelSpec.specChannelSpec.infoChannelSpec.from_spec()ChannelSpec.from_int()ChannelSpec.coerce()ChannelSpec.parse()ChannelSpec.concise()ChannelSpec.normalize()ChannelSpec.keys()ChannelSpec.values()ChannelSpec.items()ChannelSpec.fuse()ChannelSpec.split()ChannelSpec.streams()ChannelSpec.code_list()ChannelSpec.as_path()ChannelSpec.difference()ChannelSpec.intersection()ChannelSpec.union()ChannelSpec.issubset()ChannelSpec.issuperset()ChannelSpec.numel()ChannelSpec.sizes()ChannelSpec.unique()ChannelSpec._item_shapes()ChannelSpec._demo_item()ChannelSpec.encode()ChannelSpec.decode()ChannelSpec.component_indices()
CocoDatasetCocoDataset.fpathCocoDataset._update_fpath()CocoDataset._infer_dirs()CocoDataset.copy()CocoDataset.dumps()CocoDataset._compress_dump_to_fileptr()CocoDataset._dump()CocoDataset.dump()CocoDataset._check_json_serializable()CocoDataset._check_integrity()CocoDataset._check_warnables()CocoDataset._check_index()CocoDataset._check_pointers()CocoDataset._build_index()CocoDataset._abc_implCocoDataset.rebuild_index()CocoDataset.union()CocoDataset.subset()CocoDataset.view_sql()
CocoImageCocoImage.from_gid()CocoImage.videoCocoImage.nameCocoImage.detach()CocoImage.assetsCocoImage.datetimeCocoImage.annots()CocoImage.stats()CocoImage.get()CocoImage.keys()CocoImage.channelsCocoImage.n_assetsCocoImage.num_channelsCocoImage.dsizeCocoImage.image_filepath()CocoImage.primary_image_filepath()CocoImage.primary_asset()CocoImage.iter_image_filepaths()CocoImage.iter_assets()CocoImage.iter_asset_objs()CocoImage.find_asset()CocoImage.find_asset_obj()CocoImage._assets_key()CocoImage.add_annotation()CocoImage.add_asset()CocoImage.imdelay()CocoImage.valid_regionCocoImage.warp_vid_from_imgCocoImage.warp_img_from_vidCocoImage._warp_for_resolution()CocoImage._annot_segmentation()CocoImage._annot_segmentations()CocoImage.resolution()CocoImage._scalefactor_for_resolution()CocoImage._detections_for_resolution()CocoImage.add_auxiliary_item()CocoImage.delay()CocoImage.show()CocoImage.draw()
CocoSqlDatabaseCocoSqlDatabase.MEMORY_URICocoSqlDatabase.coerce()CocoSqlDatabase.disconnect()CocoSqlDatabase.connect()CocoSqlDatabase.fpathCocoSqlDatabase.delete()CocoSqlDatabase.table_names()CocoSqlDatabase.populate_from()CocoSqlDatabase.datasetCocoSqlDatabase.annsCocoSqlDatabase.catsCocoSqlDatabase.imgsCocoSqlDatabase.name_to_catCocoSqlDatabase.pandas_table()CocoSqlDatabase.raw_table()CocoSqlDatabase._raw_tables()CocoSqlDatabase._column_lookup()CocoSqlDatabase._all_rows_column_lookup()CocoSqlDatabase.tabular_targets()CocoSqlDatabase._table_names()CocoSqlDatabase.bundle_dpathCocoSqlDatabase.data_fpathCocoSqlDatabase._orig_coco_fpath()CocoSqlDatabase._abc_implCocoSqlDatabase._cached_hashid()
FusedChannelSpecFusedChannelSpec._alias_lutFusedChannelSpec._memoFusedChannelSpec._size_lutFusedChannelSpec.concat()FusedChannelSpec.specFusedChannelSpec.uniqueFusedChannelSpec.parse()FusedChannelSpec.from_spec()FusedChannelSpec.from_int()FusedChannelSpec.coerce()FusedChannelSpec.concise()FusedChannelSpec.normalize()FusedChannelSpec.numel()FusedChannelSpec.sizes()FusedChannelSpec.code_list()FusedChannelSpec.as_listFusedChannelSpec.as_osetFusedChannelSpec.as_setFusedChannelSpec.to_setFusedChannelSpec.to_osetFusedChannelSpec.to_listFusedChannelSpec.as_path()FusedChannelSpec.difference()FusedChannelSpec.intersection()FusedChannelSpec.union()FusedChannelSpec.issubset()FusedChannelSpec.issuperset()FusedChannelSpec.component_indices()FusedChannelSpec.streams()FusedChannelSpec.fuse()FusedChannelSpec.split()
SensorChanSpec
- CocoDataset API
- Subpackages
- kwcoco package
- Manual Docs