Recipe: Dataset Capture and Replay Loop¶
Record live gst data, replay it deterministically, and refine samples in place.
This recipe covers a practical loop for pipeline work:
Capture a dataset from live gstreamer cameras.
Replay that dataset while iterating on pipeline code.
Inspect or prune samples before retraining or exporting a cleaned set.
0) Prerequisites¶
s6installed and runnable (pip install -e .).Valid gstreamer client configuration for the live capture source.
A pipeline config under
configs/if you want repeatable replay runs.
1) Record from live cameras¶
Use track in record-only mode so frames are saved without running inference.
# Record from the live gst source into a dataset directory
s6 track -i gst -o ./temp/run_net_01 -r
# Add logs if you want timing and trace output for the run
s6 track -i gst -o ./temp/run_net_01 -r -x
Notes
-i gstuses the configured remote gstreamer camera source.-osets the dataset output directory and supports path placeholders.-r/--record-onlyskips inference and is the fastest way to collect data.-x/--output-logwriteslogs/runs/<timestamp>/metrics.jsonandperf.log.json.
2) Replay the dataset while you iterate¶
Point track back at the saved dataset directory. Use --repeat to loop the
playback for quick iteration, and --realtime-playback when you want recorded
timestamp spacing instead of maximum-speed replay.
# Headless replay, loop forever, and write logs for profiling
s6 track -i ./temp/run_net_01 --repeat -x
# Use the UI while iterating on overlays or pipeline behavior
s6 track -i ./temp/run_net_01 --repeat -v
# Keep the pipeline config pinned and replay at recorded timing
s6 track -i ./temp/run_net_01 --repeat --realtime-playback \
--config ./configs/pipeline.config.yaml
Tips
Keep the same
--configand--run-levelwhen you want comparable runs.Edit the relevant module under
src/s6/app/pipeline/, then re-run the same replay command to validate changes.s6 perf-statssummarizesmetrics.jsonfor one run or compares two runs.
3) Inspect or prune bad samples¶
Use the dataset filter UI to clean up the recorded data before training.
s6 data filter ./temp/run_net_01
If your training config already describes the dataset layout, you can point the filter at the config file instead:
s6 data filter --config ./cfg/ds_keypoint.json
Controls
aanddmove to the previous or next entry in the current dataset.wandsswitch to the previous or next non-empty dataset when multiple dataset roots are configured.xdeletes the current entry.qquits.
4) Summarize the run¶
If you recorded logs with -x, use the perf-stats tool to compare timing
across runs or summarize the latest capture.
# Show stats for the latest run under ./logs
s6 perf-stats
# Compare two recorded runs
s6 perf-stats ./logs/runs/2024_10_01 ./logs/runs/2024_10_02
Troubleshooting¶
Recording is slow or drops frames: keep
--record-onlyand close other heavy apps during collection.Replay feels too fast or too slow: add
--realtime-playbackto honor the recorded timestamp spacing.Results differ between runs: pin
--configand--run-level, then verify the calibration file referenced by that config.
See also
Tracking app usage:
application/track.mdDataset browser:
application/data-filter.mdDataset management:
application/dataset.mdChrome trace workflow:
recipes/pipeline_chrome_trace.mdStats comparison tool:
application/perf-stats.md