Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions supervision/detection/tools/csv_sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ def append(
def parse_field_names(
detections: Detections, custom_data: Dict[str, Any]
) -> List[str]:
dynamic_header = sorted(
set(custom_data.keys()) | set(getattr(detections, "data", {}).keys())
)
detection_keys = getattr(detections, "data", {}).keys()
custom_keys = custom_data.keys()
dynamic_header = list(custom_keys) + [
key for key in detection_keys if key not in custom_keys
]
return BASE_HEADER + dynamic_header