2121
2222from app .models import DatasetItem , DatasetItemSubset , Label , Polygon , Rectangle , TaskType
2323from app .schemas .project import TaskBase
24+ from app .utils .typing import NDArrayFloat32 , NDArrayInt
2425
2526CONVERSION_BATCH_SIZE = 50
2627
@@ -56,9 +57,8 @@ class MultilabelClassificationSample(Sample):
5657
5758 image : str = image_path_field ()
5859 image_info : ImageInfo = image_info_field ()
59- # TODO: Use NDArrayFloat32 and NDArrayInt instead of np.ndarray after open-edge-platform/datumaro#1949 is solved
60- label : np .ndarray = label_field (dtype = pl .Int32 (), multi_label = True )
61- confidence : np .ndarray | None = score_field (dtype = pl .Float32 (), is_list = True )
60+ label : NDArrayInt = label_field (dtype = pl .Int32 (), multi_label = True )
61+ confidence : NDArrayFloat32 | None = score_field (dtype = pl .Float32 (), is_list = True )
6262 subset : Subset = subset_field ()
6363
6464
@@ -76,10 +76,9 @@ class DetectionSample(Sample):
7676
7777 image : str = image_path_field ()
7878 image_info : ImageInfo = image_info_field ()
79- # TODO: Use NDArrayFloat32 and NDArrayInt instead of np.ndarray after open-edge-platform/datumaro#1949 is solved
80- bboxes : np .ndarray = bbox_field (dtype = pl .Int32 ())
81- label : np .ndarray = label_field (dtype = pl .Int32 (), is_list = True )
82- confidence : np .ndarray | None = score_field (dtype = pl .Float32 (), is_list = True )
79+ bboxes : NDArrayInt = bbox_field (dtype = pl .Int32 ())
80+ label : NDArrayInt = label_field (dtype = pl .Int32 (), is_list = True )
81+ confidence : NDArrayFloat32 | None = score_field (dtype = pl .Float32 (), is_list = True )
8382 subset : Subset = subset_field ()
8483
8584
@@ -97,10 +96,9 @@ class InstanceSegmentationSample(Sample):
9796
9897 image : str = image_path_field ()
9998 image_info : ImageInfo = image_info_field ()
100- # TODO: Use NDArrayFloat32 and NDArrayInt instead of np.ndarray after open-edge-platform/datumaro#1949 is solved
101- polygons : np .ndarray = polygon_field (dtype = pl .Float32 ())
102- label : np .ndarray = label_field (dtype = pl .Int32 (), is_list = True )
103- confidence : np .ndarray | None = score_field (dtype = pl .Float32 (), is_list = True )
99+ polygons : NDArrayFloat32 = polygon_field (dtype = pl .Float32 ())
100+ label : NDArrayInt = label_field (dtype = pl .Int32 (), is_list = True )
101+ confidence : NDArrayFloat32 | None = score_field (dtype = pl .Float32 (), is_list = True )
104102 subset : Subset = subset_field ()
105103
106104
0 commit comments