sort_by_field#
- sort_by_field(boxlist: BoxList, field: str, order: SortOrder = 2)[source]#
Sort boxes and associated fields according to a scalar field. A common use case is reordering the boxes according to descending scores.
- Parameters
- Returns
A sorted BoxList with the field in the specified order.
- Return type
- Raises
ValueError – If specified field does not exist or is not of single dimension.
ValueError – If the order is not either descend or ascend.