22
33from __future__ import annotations
44
5+ import builtins
56import json
67from pathlib import Path
78from typing import Any , IO , Sequence , Union
@@ -291,7 +292,7 @@ def compare(
291292 def batch_register (
292293 self ,
293294 collection_id : str ,
294- items : list [dict [str , Any ]],
295+ items : builtins . list [dict [str , Any ]],
295296 ) -> BatchResponse :
296297 """
297298 Batch register up to 20 faces in a single request.
@@ -308,7 +309,7 @@ def batch_register(
308309 ])
309310 """
310311 files : dict [str , Any ] = {}
311- entries = []
312+ entries : builtins . list [ dict [ str , Any ]] = []
312313 for i , item in enumerate (items ):
313314 fname , fbytes , ftype = _to_bytes_tuple (item ["image" ])
314315 files [f"images[{ i } ]" ] = (fname , fbytes , ftype )
@@ -327,7 +328,7 @@ def batch_register(
327328 )
328329 return BatchResponse .from_dict (resp )
329330
330- def batch_delete (self , collection_id : str , face_ids : list [str ]) -> BatchDeleteResponse :
331+ def batch_delete (self , collection_id : str , face_ids : builtins . list [str ]) -> BatchDeleteResponse :
331332 """Batch delete up to 100 faces by their IDs."""
332333 resp = self ._c ._request (
333334 "DELETE" ,
@@ -349,7 +350,7 @@ def attributes(self, collection_id: str, image: ImageInput) -> AttributesResult:
349350 def batch_register_async (
350351 self ,
351352 collection_id : str ,
352- items : list [dict [str , Any ]],
353+ items : builtins . list [dict [str , Any ]],
353354 ) -> BatchJob :
354355 """
355356 Submit up to 100 faces for asynchronous registration. Returns a job
@@ -361,7 +362,7 @@ def batch_register_async(
361362 :meth:`active_liveness`) are also supported.
362363 """
363364 files : dict [str , Any ] = {}
364- entries = []
365+ entries : builtins . list [ dict [ str , Any ]] = []
365366 for i , item in enumerate (items ):
366367 fname , fbytes , ftype = _to_bytes_tuple (item ["image" ])
367368 files [f"images[{ i } ]" ] = (fname , fbytes , ftype )
0 commit comments