Subsections below describe alternative ways to realize the general development workflow:
- Start jaeger and module processes
- The client sends input image to the module and receives module results (image, metadata, logs)
- Uri Input script + Always On sink allow to send a video file to be processed by the module and receive a stream output
- Changes in pyfuncs, drawfunc, pre- and postprocessing code are loaded at runtime when module receives input from the client
- Changes in module configuration require module container restart
- Changes in module docker image, e.g. changes in
requirements.txt, require module image rebuild
Note that starting module for the first time involves downloading the model files and building TRT engine which may take several minutes. Additionally, client's wait for module status has a timeout which may be exceeded if TRT engine build process takes long enough. Wait for TRT build finish and restart the client script if so.
URI-Input script demonstration requires a sample video.
curl -o assets/test_data/elon_musk_perf.mp4 https://eu-central-1.linodeobjects.com/savant-data/demo/elon_musk_perf.mp4
- Start Jaeger container
docker compose -f docker-compose.x86.yml up jaeger -dThis is required by the sample module since it is configured to use Jaeger telemetry.
Visit http://127.0.0.1:16686 to access the Jaeger UI.
- Start module container
docker compose -f docker-compose.x86.yml up module -d- Run and re-run the client script (result image written into
src/outputdirectory)
docker compose -f docker-compose.x86.yml up client- Send a video to the module and receive stream output
Start Always On Sink container
docker compose -f docker-compose.x86.yml up always-on-sink -dStart Uri Input container
docker compose -f docker-compose.x86.yml up uri-inputOpen rtsp://127.0.0.1:554/stream in your player, or visit http://127.0.0.1:888/stream/ in a browser.
- Restart module container
E.g., in case module.yml was modified.
docker compose -f docker-compose.x86.yml restart module- Rebuild module image (optionally, use
--no-cacheand--pullflags for docker build to force full rebuild)
E.g., in case Dockerfile.x86 or requirements.txt were modified.
docker compose -f docker-compose.x86.yml down module
docker compose -f docker-compose.x86.yml build module- Open the module directory on host in IDE
File -> Open Folder -> enter path
- Start Jaeger container
docker compose -f docker-compose.x86.yml up jaeger -dThis is required by the sample module since it is configured to use Jaeger telemetry.
Visit http://127.0.0.1:16686 to access the Jaeger UI.
- Reopen the directory in dev container
Command Palette (F1) -> "Dev Containers: Reopen in container" -> Select devcontainer.json appropriate for the platform
- Start and restart module
python module/run.py- Run and re-run the client script (result image written into
/opt/savant/src/outputdirectory)
python client/run.py- Send a video to the module and receive stream output
Open the module directory on host, start Always On Sink container
docker compose -f docker-compose.x86.yml up always-on-sink -dRun URI Input script inside the dev container
cd /opt/savant
python scripts/uri-input.py /test_data/elon_musk_perf.mp4 --socket pub+connect:ipc:///tmp/zmq-sockets/input-video.ipc --syncOpen rtsp://127.0.0.1:554/stream in your player, or visit http://127.0.0.1:888/stream/ in a browser.
- Rebuild module image
E.g., in case Dockerfile.x86 or requirements.txt were modified.
Command Palette (F1) -> "Dev Containers: Rebuild container"