@@ -125,8 +125,10 @@ def __init__(self, box_keys: KeysCollection, box_ref_image_keys: str, allow_miss
125125 super ().__init__ (box_keys , allow_missing_keys )
126126 box_ref_image_keys_tuple = ensure_tuple (box_ref_image_keys )
127127 if len (box_ref_image_keys_tuple ) > 1 :
128- raise ValueError ("Please provide a single key for box_ref_image_keys.\
129- All boxes of box_keys are attached to box_ref_image_keys." )
128+ raise ValueError (
129+ "Please provide a single key for box_ref_image_keys.\
130+ All boxes of box_keys are attached to box_ref_image_keys."
131+ )
130132 self .box_ref_image_keys = box_ref_image_keys
131133
132134 def __call__ (self , data : Mapping [Hashable , NdarrayOrTensor ]) -> dict [Hashable , NdarrayOrTensor ]:
@@ -809,15 +811,13 @@ def __init__(
809811 allow_missing_keys : bool = False ,
810812 ) -> None :
811813 box_keys_tuple = ensure_tuple (box_keys )
812- if len (box_keys_tuple ) < 1 :
813- raise ValueError (
814- "Please provide at least one key for `box_keys`. All `label_keys` are attached to this `box_keys`."
815- )
814+ if len (box_keys_tuple ) != 1 :
815+ raise ValueError ("Provide a single key for `box_keys`. All `label_keys` are attached to this `box_keys`." )
816816 box_ref_image_keys_tuple = ensure_tuple (box_ref_image_keys )
817- if len (box_ref_image_keys_tuple ) < 1 :
817+ if len (box_ref_image_keys_tuple ) != 1 :
818818 raise ValueError (
819- "Please provide at least one key for `box_ref_image_keys`. "
820- "All box_keys and label_keys are attached to this `box_ref_image_keys`."
819+ "Provide a single key for `box_ref_image_keys`. "
820+ "All ` box_keys` and ` label_keys` are attached to this `box_ref_image_keys`."
821821 )
822822
823823 self .label_keys = ensure_tuple (label_keys )
@@ -1086,8 +1086,10 @@ def __init__(
10861086
10871087 box_keys_tuple = ensure_tuple (box_keys )
10881088 if len (box_keys_tuple ) != 1 :
1089- raise ValueError ("Please provide a single key for box_keys.\
1090- All label_keys are attached to this box_keys." )
1089+ raise ValueError (
1090+ "Please provide a single key for box_keys.\
1091+ All label_keys are attached to this box_keys."
1092+ )
10911093 self .box_keys = box_keys_tuple [0 ]
10921094 self .label_keys = ensure_tuple (label_keys )
10931095
0 commit comments