15
15
get_num_channels ,
16
16
ImageLoader ,
17
17
InfoBase ,
18
+ make_bounding_box_loader ,
18
19
make_bounding_box_loaders ,
20
+ make_detection_mask_loader ,
19
21
make_image_loader ,
20
22
make_image_loaders ,
21
23
make_image_loaders_for_interpolation ,
22
24
make_mask_loaders ,
25
+ make_video_loader ,
23
26
make_video_loaders ,
24
27
mark_framework_limitation ,
25
28
TestMark ,
@@ -1168,12 +1171,18 @@ def reference_inputs_pad_bounding_box():
1168
1171
[1.2405 , 0.1772 , - 6.9113 , 0.0463 , 1.251 , - 5.235 , 0.00013 , 0.0018 ],
1169
1172
[0.7366 , - 0.11724 , 1.45775 , - 0.15012 , 0.73406 , 2.6019 , - 0.0072 , - 0.0063 ],
1170
1173
]
1174
+ _STARTPOINTS = [[0 , 1 ], [2 , 3 ], [4 , 5 ], [6 , 7 ]]
1175
+ _ENDPOINTS = [[9 , 8 ], [7 , 6 ], [5 , 4 ], [3 , 2 ]]
1171
1176
1172
1177
1173
1178
def sample_inputs_perspective_image_tensor ():
1174
1179
for image_loader in make_image_loaders (sizes = ["random" ]):
1175
1180
for fill in get_fills (num_channels = image_loader .num_channels , dtype = image_loader .dtype ):
1176
- yield ArgsKwargs (image_loader , None , None , fill = fill , coefficients = _PERSPECTIVE_COEFFS [0 ])
1181
+ yield ArgsKwargs (
1182
+ image_loader , startpoints = None , endpoints = None , fill = fill , coefficients = _PERSPECTIVE_COEFFS [0 ]
1183
+ )
1184
+
1185
+ yield ArgsKwargs (make_image_loader (), startpoints = _STARTPOINTS , endpoints = _ENDPOINTS )
1177
1186
1178
1187
1179
1188
def reference_inputs_perspective_image_tensor ():
@@ -1200,25 +1209,38 @@ def reference_inputs_perspective_image_tensor():
1200
1209
def sample_inputs_perspective_bounding_box ():
1201
1210
for bounding_box_loader in make_bounding_box_loaders ():
1202
1211
yield ArgsKwargs (
1203
- bounding_box_loader , bounding_box_loader .format , None , None , coefficients = _PERSPECTIVE_COEFFS [0 ]
1212
+ bounding_box_loader ,
1213
+ format = bounding_box_loader .format ,
1214
+ startpoints = None ,
1215
+ endpoints = None ,
1216
+ coefficients = _PERSPECTIVE_COEFFS [0 ],
1204
1217
)
1205
1218
1219
+ format = datapoints .BoundingBoxFormat .XYXY
1220
+ yield ArgsKwargs (
1221
+ make_bounding_box_loader (format = format ), format = format , startpoints = _STARTPOINTS , endpoints = _ENDPOINTS
1222
+ )
1223
+
1206
1224
1207
1225
def sample_inputs_perspective_mask ():
1208
1226
for mask_loader in make_mask_loaders (sizes = ["random" ]):
1209
- yield ArgsKwargs (mask_loader , None , None , coefficients = _PERSPECTIVE_COEFFS [0 ])
1227
+ yield ArgsKwargs (mask_loader , startpoints = None , endpoints = None , coefficients = _PERSPECTIVE_COEFFS [0 ])
1228
+
1229
+ yield ArgsKwargs (make_detection_mask_loader (), startpoints = _STARTPOINTS , endpoints = _ENDPOINTS )
1210
1230
1211
1231
1212
1232
def reference_inputs_perspective_mask ():
1213
1233
for mask_loader , perspective_coeffs in itertools .product (
1214
1234
make_mask_loaders (extra_dims = [()], num_objects = [1 ]), _PERSPECTIVE_COEFFS
1215
1235
):
1216
- yield ArgsKwargs (mask_loader , None , None , coefficients = perspective_coeffs )
1236
+ yield ArgsKwargs (mask_loader , startpoints = None , endpoints = None , coefficients = perspective_coeffs )
1217
1237
1218
1238
1219
1239
def sample_inputs_perspective_video ():
1220
1240
for video_loader in make_video_loaders (sizes = ["random" ], num_frames = ["random" ]):
1221
- yield ArgsKwargs (video_loader , None , None , coefficients = _PERSPECTIVE_COEFFS [0 ])
1241
+ yield ArgsKwargs (video_loader , startpoints = None , endpoints = None , coefficients = _PERSPECTIVE_COEFFS [0 ])
1242
+
1243
+ yield ArgsKwargs (make_video_loader (), startpoints = _STARTPOINTS , endpoints = _ENDPOINTS )
1222
1244
1223
1245
1224
1246
KERNEL_INFOS .extend (
0 commit comments