@@ -47,10 +47,10 @@ def transform(self, prepared_ldf: PreparedLDF) -> None:
4747
4848 objects : list [dict [str , Any ]] = []
4949 for row in group_df .iter_rows (named = True ):
50- if row . get ( "task_type" ) != "boundingbox" :
50+ if row [ "task_type" ] != "boundingbox" :
5151 continue
52- ann_str = row . get ( "annotation" )
53- cname = row . get ( "class_name" )
52+ ann_str = row [ "annotation" ]
53+ cname = row [ "class_name" ]
5454 if not ann_str or not cname :
5555 continue
5656
@@ -63,11 +63,9 @@ def transform(self, prepared_ldf: PreparedLDF) -> None:
6363 xmin = int (round (xn * W ))
6464 ymin = int (round (yn * H ))
6565
66- # widths/heights: round once (no double rounding)
6766 w_px = max (1 , int (round (wn * W )))
6867 h_px = max (1 , int (round (hn * H )))
6968
70- # build EXCLUSIVE max from min + size
7169 xmax = xmin + w_px # exclusive right edge
7270 ymax = ymin + h_px # exclusive bottom edge
7371
@@ -214,7 +212,6 @@ def _build_voc_xml_string(
214212 SubElement (bb , "xmax" ).text = f"{ xmax :.12f} "
215213 SubElement (bb , "ymax" ).text = f"{ ymax :.12f} "
216214
217- # pretty print with XML declaration
218215 xml_bytes = self ._etree_to_pretty_bytes (ann )
219216 return xml_bytes .decode ("utf-8" )
220217
0 commit comments