File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed
labelbox/data/annotation_types Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,5 @@ class VideoClassificationAnnotation(ClassificationAnnotation):
4949 frame : int
5050
5151
52- AnnotationType = Union [ClassificationAnnotation , ObjectAnnotation ]
53- VideoAnnotationType = Union [VideoObjectAnnotation ,
54- VideoClassificationAnnotation ]
55-
5652VideoObjectAnnotation .update_forward_refs ()
5753ObjectAnnotation .update_forward_refs ()
Original file line number Diff line number Diff line change 22
33from pydantic import BaseModel , root_validator
44
5+ from .types import Cuid
6+
57
68class FeatureSchema (BaseModel ):
79 """
@@ -13,7 +15,7 @@ class FeatureSchema(BaseModel):
1315 to retroactively add schema ids by looking them up from the names.
1416 """
1517 name : Optional [str ] = None
16- schema_id : Optional [str ] = None
18+ schema_id : Optional [Cuid ] = None
1719
1820 @root_validator
1921 def must_set_one (cls , values ):
Original file line number Diff line number Diff line change 88from .data import VideoData , TextData , RasterData
99from .geometry .mask import Mask
1010from .metrics import Metric
11- from .annotation import (AnnotationType , ClassificationAnnotation ,
12- ObjectAnnotation , VideoAnnotationType )
11+ from .annotation import (ClassificationAnnotation , ObjectAnnotation ,
12+ VideoClassificationAnnotation , VideoObjectAnnotation )
1313
1414
1515class Label (BaseModel ):
1616 data : Union [VideoData , RasterData , TextData ]
17- annotations : List [Union [AnnotationType , VideoAnnotationType , Metric ]] = []
17+ annotations : List [Union [ClassificationAnnotation , ObjectAnnotation ,
18+ VideoObjectAnnotation ,
19+ VideoClassificationAnnotation , Metric ]] = []
1820 extra : Dict [str , Any ] = {}
1921
2022 def add_url_to_data (self , signer ) -> "Label" :
Original file line number Diff line number Diff line change 1+ from pydantic import Field
2+ from typing_extensions import Annotated
3+
4+ Cuid = Annotated [str , Field (min_length = 25 , max_length = 25 )]
You can’t perform that action at this time.
0 commit comments