diff --git a/supervision/detection/tools/csv_sink.py b/supervision/detection/tools/csv_sink.py index ba0dde97..1e1f2940 100644 --- a/supervision/detection/tools/csv_sink.py +++ b/supervision/detection/tools/csv_sink.py @@ -42,7 +42,7 @@ class CSVSink: csv_sink = sv.CSVSink() frames_generator = sv.get_video_frames_generator() - with csv_sink: + with csv_sink as sink: for frame in frames_generator: result = model(frame)[0] detections = sv.Detections.from_ultralytics(result) diff --git a/supervision/detection/tools/json_sink.py b/supervision/detection/tools/json_sink.py index 1ff5f900..9e73554b 100644 --- a/supervision/detection/tools/json_sink.py +++ b/supervision/detection/tools/json_sink.py @@ -32,7 +32,7 @@ class JSONSink: json_sink = sv.JSONSink() frames_generator = sv.get_video_frames_generator() - with json_sink: + with json_sink as sink: for frame in frames_generator: result = model(frame)[0] detections = sv.Detections.from_ultralytics(result)