Skip to content

Commit 917b4c0

Browse files
committed
doc: πŸ“š json and csv example code syntax fix
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
1 parent 8900986 commit 917b4c0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

β€Žsupervision/detection/tools/csv_sink.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CSVSink:
4242
csv_sink = sv.CSVSink(<RESULT_CSV_FILE_PATH>)
4343
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
4444
45-
with csv_sink:
45+
with csv_sink as sink:
4646
for frame in frames_generator:
4747
result = model(frame)[0]
4848
detections = sv.Detections.from_ultralytics(result)

β€Žsupervision/detection/tools/json_sink.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class JSONSink:
3232
json_sink = sv.JSONSink(<RESULT_JSON_FILE_PATH>)
3333
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
3434
35-
with json_sink:
35+
with json_sink as sink:
3636
for frame in frames_generator:
3737
result = model(frame)[0]
3838
detections = sv.Detections.from_ultralytics(result)

0 commit comments

Comments
Β (0)