doc: 📚 json and csv example code syntax fix

Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
This commit is contained in:
Onuralp SEZER 2024-03-14 22:33:30 +03:00
parent 8900986775
commit 917b4c0fe4
No known key found for this signature in database
GPG Key ID: CF0835DFDF14CA38
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ class CSVSink:
csv_sink = sv.CSVSink(<RESULT_CSV_FILE_PATH>)
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
with csv_sink:
with csv_sink as sink:
for frame in frames_generator:
result = model(frame)[0]
detections = sv.Detections.from_ultralytics(result)

View File

@ -32,7 +32,7 @@ class JSONSink:
json_sink = sv.JSONSink(<RESULT_JSON_FILE_PATH>)
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
with json_sink:
with json_sink as sink:
for frame in frames_generator:
result = model(frame)[0]
detections = sv.Detections.from_ultralytics(result)