Skip to content

Commit 5b6713f

Browse files
authored
Merge pull request roboflow#996 from roboflow/fix/doc_syntax_fix
doc: 📚 json and csv example code syntax fix
2 parents 012ff2b + 917b4c0 commit 5b6713f

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)