datumaro.components.annotations.merger#
Classes
|
Method generated by attrs for class AnnotationMerger. |
|
Method generated by attrs for class BboxMerger. |
|
Method generated by attrs for class CaptionsMerger. |
|
Method generated by attrs for class Cuboid2DMerger. |
|
Method generated by attrs for class Cuboid3dMerger. |
|
Method generated by attrs for class EllipseMerger. |
|
Method generated by attrs for class FeatureVectorMerger. |
|
Method generated by attrs for class HashKeyMerger. |
|
Method generated by attrs for class ImageAnnotationMerger. |
|
Method generated by attrs for class LabelMerger. |
|
Method generated by attrs for class LineMerger. |
|
Method generated by attrs for class MaskMerger. |
|
Method generated by attrs for class PointsMerger. |
|
Method generated by attrs for class PolygonMerger. |
|
Method generated by attrs for class RotatedBboxMerger. |
|
Method generated by attrs for class TabularMerger. |
- class datumaro.components.annotations.merger.AnnotationMerger(*, context: IMatcherContext | IMergerContext | None = None)[source]#
Bases:
AnnotationMatcher
Method generated by attrs for class AnnotationMerger.
- class datumaro.components.annotations.merger.LabelMerger(*, context: IMatcherContext | IMergerContext | None = None, quorum=0)[source]#
Bases:
AnnotationMerger
,LabelMatcher
Method generated by attrs for class LabelMerger.
- class datumaro.components.annotations.merger.BboxMerger(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>, quorum=0)[source]#
Bases:
_ShapeMerger
,BboxMatcher
Method generated by attrs for class BboxMerger.
- class datumaro.components.annotations.merger.RotatedBboxMerger(sigma: list | None = None, *, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>, quorum=0)[source]#
Bases:
_ShapeMerger
,RotatedBboxMatcher
Method generated by attrs for class RotatedBboxMerger.
- class datumaro.components.annotations.merger.PolygonMerger(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>, quorum=0)[source]#
Bases:
_ShapeMerger
,PolygonMatcher
Method generated by attrs for class PolygonMerger.
- class datumaro.components.annotations.merger.MaskMerger(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>, quorum=0)[source]#
Bases:
_ShapeMerger
,MaskMatcher
Method generated by attrs for class MaskMerger.
- class datumaro.components.annotations.merger.PointsMerger(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>, quorum=0, sigma: list | None = None, instance_map)[source]#
Bases:
_ShapeMerger
,PointsMatcher
Method generated by attrs for class PointsMerger.
- class datumaro.components.annotations.merger.LineMerger(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>, quorum=0)[source]#
Bases:
_ShapeMerger
,LineMatcher
Method generated by attrs for class LineMerger.
- class datumaro.components.annotations.merger.CaptionsMerger(*, context: IMatcherContext | IMergerContext | None = None)[source]#
Bases:
AnnotationMerger
,CaptionsMatcher
Method generated by attrs for class CaptionsMerger.
- class datumaro.components.annotations.merger.Cuboid3dMerger(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>, quorum=0)[source]#
Bases:
_ShapeMerger
,Cuboid3dMatcher
Method generated by attrs for class Cuboid3dMerger.
- class datumaro.components.annotations.merger.ImageAnnotationMerger(*, context: IMatcherContext | IMergerContext | None = None)[source]#
Bases:
AnnotationMerger
,ImageAnnotationMatcher
Method generated by attrs for class ImageAnnotationMerger.
- class datumaro.components.annotations.merger.EllipseMerger(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>, quorum=0)[source]#
Bases:
_ShapeMerger
,ShapeMatcher
Method generated by attrs for class EllipseMerger.
- class datumaro.components.annotations.merger.HashKeyMerger(*, context: IMatcherContext | IMergerContext | None = None)[source]#
Bases:
AnnotationMerger
,HashKeyMatcher
Method generated by attrs for class HashKeyMerger.
- class datumaro.components.annotations.merger.FeatureVectorMerger(*, context: IMatcherContext | IMergerContext | None = None)[source]#
Bases:
AnnotationMerger
,FeatureVectorMatcher
Method generated by attrs for class FeatureVectorMerger.
- class datumaro.components.annotations.merger.AnnotationMatcher(*, context: IMatcherContext | IMergerContext | None = None)[source]#
Bases:
object
Method generated by attrs for class AnnotationMatcher.
- class datumaro.components.annotations.merger.Bbox(x, y, w, h, *args, **kwargs)[source]#
Bases:
Shape
Bbox annotation class. This class represents a bounding box defined by its top-left corner (x, y) and its width and height (w, h).
- _type#
The type of annotation, set to AnnotationType.bbox.
- Type:
- x()#
Property to get the x-coordinate of the bounding box.
- y()#
Property to get the y-coordinate of the bounding box.
- w()#
Property to get the width of the bounding box.
- h()#
Property to get the height of the bounding box.
Initialize the Bbox with its top-left corner (x, y) and its width and height (w, h).
- Parameters:
- property x#
Get the x-coordinate of the top-left corner of the bounding box.
- Returns:
The x-coordinate of the bounding box.
- Return type:
- property y#
Get the y-coordinate of the top-left corner of the bounding box.
- Returns:
The y-coordinate of the bounding box.
- Return type:
- property w#
Get the width of the bounding box.
- Returns:
The width of the bounding box.
- Return type:
- property h#
Get the height of the bounding box.
- Returns:
The height of the bounding box.
- Return type:
- get_area()[source]#
Calculate the area of the bounding box.
- Returns:
The area of the bounding box.
- Return type:
- get_bbox()[source]#
Get the bounding box coordinates and dimensions.
- Returns:
The bounding box as [x, y, w, h].
- Return type:
List[float]
- as_polygon() List[float] [source]#
Convert the bounding box into a polygon representation.
- Returns:
The bounding box as a polygon.
- Return type:
List[float]
- class datumaro.components.annotations.merger.BboxMatcher(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>)[source]#
Bases:
ShapeMatcher
Method generated by attrs for class BboxMatcher.
- class datumaro.components.annotations.merger.CaptionsMatcher(*, context: IMatcherContext | IMergerContext | None = None)[source]#
Bases:
AnnotationMatcher
Method generated by attrs for class CaptionsMatcher.
- class datumaro.components.annotations.merger.Cuboid2DMatcher(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>)[source]#
Bases:
ShapeMatcher
Method generated by attrs for class Cuboid2DMatcher.
- class datumaro.components.annotations.merger.Cuboid2DMerger(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>, quorum=0)[source]#
Bases:
_ShapeMerger
,Cuboid2DMatcher
Method generated by attrs for class Cuboid2DMerger.
- class datumaro.components.annotations.merger.Cuboid3dMatcher(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>)[source]#
Bases:
ShapeMatcher
Method generated by attrs for class Cuboid3dMatcher.
- exception datumaro.components.annotations.merger.FailedLabelVotingError(item_id, votes, ann=None, *, sources=_Nothing.NOTHING)[source]#
Bases:
DatasetMergeError
Method generated by attrs for class FailedLabelVotingError.
- item_id#
- votes#
- ann#
- class datumaro.components.annotations.merger.FeatureVectorMatcher(*, context: IMatcherContext | IMergerContext | None = None)[source]#
Bases:
AnnotationMatcher
Method generated by attrs for class FeatureVectorMatcher.
- class datumaro.components.annotations.merger.HashKeyMatcher(*, context: IMatcherContext | IMergerContext | None = None)[source]#
Bases:
AnnotationMatcher
Method generated by attrs for class HashKeyMatcher.
- class datumaro.components.annotations.merger.ImageAnnotationMatcher(*, context: IMatcherContext | IMergerContext | None = None)[source]#
Bases:
AnnotationMatcher
Method generated by attrs for class ImageAnnotationMatcher.
- class datumaro.components.annotations.merger.Label(label, *, id: int = 0, attributes: Dict[str, Any] = _Nothing.NOTHING, group: int = 0, object_id: int = -1)[source]#
Bases:
Annotation
Method generated by attrs for class Label.
- class datumaro.components.annotations.merger.LabelMatcher(*, context: IMatcherContext | IMergerContext | None = None)[source]#
Bases:
AnnotationMatcher
Method generated by attrs for class LabelMatcher.
- class datumaro.components.annotations.merger.LineMatcher(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>)[source]#
Bases:
ShapeMatcher
Method generated by attrs for class LineMatcher.
- class datumaro.components.annotations.merger.MaskMatcher(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>)[source]#
Bases:
ShapeMatcher
Method generated by attrs for class MaskMatcher.
- class datumaro.components.annotations.merger.PointsMatcher(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>, sigma: list | None = None, instance_map)[source]#
Bases:
ShapeMatcher
Method generated by attrs for class PointsMatcher.
- class datumaro.components.annotations.merger.PolygonMatcher(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>)[source]#
Bases:
ShapeMatcher
Method generated by attrs for class PolygonMatcher.
- class datumaro.components.annotations.merger.RotatedBboxMatcher(sigma: list | None = None, *, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>)[source]#
Bases:
ShapeMatcher
Method generated by attrs for class RotatedBboxMatcher.
- class datumaro.components.annotations.merger.ShapeMatcher(*, context: ~datumaro.components.abstracts.merger.IMatcherContext | ~datumaro.components.abstracts.merger.IMergerContext | None = None, pairwise_dist=0.9, cluster_dist=-1.0, match_segments=<function match_segments_pair>)[source]#
Bases:
AnnotationMatcher
Method generated by attrs for class ShapeMatcher.
- match_annotations(sources: List[List[Annotation]]) List[List[Annotation]] [source]#
- class datumaro.components.annotations.merger.TabularMatcher(*, context: IMatcherContext | IMergerContext | None = None)[source]#
Bases:
AnnotationMatcher
Method generated by attrs for class TabularMatcher.
- class datumaro.components.annotations.merger.TabularMerger(*, context: IMatcherContext | IMergerContext | None = None)[source]#
Bases:
AnnotationMerger
,TabularMatcher
Method generated by attrs for class TabularMerger.
- datumaro.components.annotations.merger.attrib(default=_Nothing.NOTHING, validator=None, repr=True, cmp=None, hash=None, init=True, metadata=None, type=None, converter=None, factory=None, kw_only=False, eq=None, order=None, on_setattr=None, alias=None)[source]#
Create a new field / attribute on a class.
Identical to attrs.field, except it’s not keyword-only.
Consider using attrs.field in new code (
attr.ib
will never go away, though).Warning
Does nothing unless the class is also decorated with attr.s (or similar)!
New in version 15.2.0: convert
New in version 16.3.0: metadata
Changed in version 17.1.0: validator can be a
list
now.Changed in version 17.1.0: hash is None and therefore mirrors eq by default.
New in version 17.3.0: type
Deprecated since version 17.4.0: convert
New in version 17.4.0: converter as a replacement for the deprecated convert to achieve consistency with other noun-based arguments.
New in version 18.1.0:
factory=f
is syntactic sugar fordefault=attr.Factory(f)
.New in version 18.2.0: kw_only
Changed in version 19.2.0: convert keyword argument removed.
Changed in version 19.2.0: repr also accepts a custom callable.
Deprecated since version 19.2.0: cmp Removal on or after 2021-06-01.
New in version 19.2.0: eq and order
New in version 20.1.0: on_setattr
Changed in version 20.3.0: kw_only backported to Python 2
Changed in version 21.1.0: eq, order, and cmp also accept a custom callable
Changed in version 21.1.0: cmp undeprecated
New in version 22.2.0: alias
- datumaro.components.annotations.merger.attrs(maybe_cls=None, these=None, repr_ns=None, repr=None, cmp=None, hash=None, init=None, slots=False, frozen=False, weakref_slot=True, str=False, auto_attribs=False, kw_only=False, cache_hash=False, auto_exc=False, eq=None, order=None, auto_detect=False, collect_by_mro=False, getstate_setstate=None, on_setattr=None, field_transformer=None, match_args=True, unsafe_hash=None)[source]#
A class decorator that adds dunder methods according to the specified attributes using attr.ib or the these argument.
Consider using attrs.define / attrs.frozen in new code (
attr.s
will never go away, though).- Parameters:
repr_ns (str) – When using nested classes, there was no way in Python 2 to automatically detect that. This argument allows to set a custom name for a more meaningful
repr
output. This argument is pointless in Python 3 and is therefore deprecated.
Caution
Refer to attrs.define for the rest of the parameters, but note that they can have different defaults.
Notably, leaving on_setattr as None will not add any hooks.
New in version 16.0.0: slots
New in version 16.1.0: frozen
New in version 16.3.0: str
New in version 16.3.0: Support for
__attrs_post_init__
.Changed in version 17.1.0: hash supports None as value which is also the default now.
New in version 17.3.0: auto_attribs
Changed in version 18.1.0: If these is passed, no attributes are deleted from the class body.
Changed in version 18.1.0: If these is ordered, the order is retained.
New in version 18.2.0: weakref_slot
Deprecated since version 18.2.0:
__lt__
,__le__
,__gt__
, and__ge__
now raise a DeprecationWarning if the classes compared are subclasses of each other.__eq
and__ne__
never tried to compared subclasses to each other.Changed in version 19.2.0:
__lt__
,__le__
,__gt__
, and__ge__
now do not consider subclasses comparable anymore.New in version 18.2.0: kw_only
New in version 18.2.0: cache_hash
New in version 19.1.0: auto_exc
Deprecated since version 19.2.0: cmp Removal on or after 2021-06-01.
New in version 19.2.0: eq and order
New in version 20.1.0: auto_detect
New in version 20.1.0: collect_by_mro
New in version 20.1.0: getstate_setstate
New in version 20.1.0: on_setattr
New in version 20.3.0: field_transformer
Changed in version 21.1.0:
init=False
injects__attrs_init__
Changed in version 21.1.0: Support for
__attrs_pre_init__
Changed in version 21.1.0: cmp undeprecated
New in version 21.3.0: match_args
New in version 22.2.0: unsafe_hash as an alias for hash (for PEP 681 compliance).
Deprecated since version 24.1.0: repr_ns
Changed in version 24.1.0: Instances are not compared as tuples of attributes anymore, but using a big
and
condition. This is faster and has more correct behavior for uncomparable values like math.nan.New in version 24.1.0: If a class has an inherited classmethod called
__attrs_init_subclass__
, it is executed after the class is created.Deprecated since version 24.1.0: hash is deprecated in favor of unsafe_hash.