Visualization
It's so nice to see your data! MetriCal provides visualization features to help you understand exactly what's going on with your calibrations, so you're never left in the dark.
- Visual inspection of detections during the calibration process
- Ability to verify the spatial alignment of different sensors
- Confirmation that your calibration procedure is capturing the right data
- Immediate visual feedback on calibration quality
By properly setting up and using the visualization features in MetriCal, you can gain greater confidence in your calibration results and more easily troubleshoot any issues that arise during the calibration process.
Setting up Visualization with Rerun
MetriCal uses Rerun as its visualization engine. There are two ways MetriCal interacts with Rerun:
- Option 1: MetriCal can spawn a Rerun server and connect to it directly. This is the default behavior.
- Option 2: MetriCal can connect to another Rerun server running elsewhere (on host, in network, etc).
When using MetriCal via Docker, you'll need to run a separate Rerun server on your host machine.
Installing Rerun
Install Rerun on your host machine using either pip
or cargo
:
# Option 1: via pip
pip install rerun-sdk==0.20
# Option 2: via cargo
cargo install rerun-cli --version ^0.20
Make sure to install Rerun version 0.20 to ensure compatibility with MetriCal's current version. Rerun is a great tool, but it's still in heavy development, and there's no guarantee of backwards compatibility.
Run Separate Rerun Server
Before using any visualization in MetriCal, start a Rerun rendering server in a separate terminal:
rerun --memory-limit=1GB
Then, ensure your docker run
command includes the host gateway configuration:
--add-host=host.docker.internal:host-gateway
This allows the Docker container to communicate with Rerun running on your host machine.
Visualization in Different Modes
Display Mode
Display mode is designed specifically for visualization, allowing you to see the applied results of your calibration.
metrical display [OPTIONS] $INPUT_DATA_PATH $PLEX_OR_RESULTS_PATH
Display mode visualizes the calibration results applied to your dataset in real-time, providing a quick "ocular validation" of your calibration quality. Read more about Display mode here.
Calibrate Mode
In Calibrate mode, you can visualize the detection process and calibration data by adding the
--render
flag:
metrical calibrate \
--render \
--output-json results.json \
$DATA $PLEX $OBJSPC
This allows you to see detections in real-time as the calibration process runs. Learn more about Calibrate mode here.
Advanced Visualization Options
Custom Render Socket
If you're running Rerun on a non-default port or IP address, use the --render-socket
option:
metrical display --render-socket="127.0.0.1:3030" $DATA $RESULTS
By default:
- Docker setup:
host.docker.internal:9876
- Local setup:
127.0.0.1:9876
When running Rerun from its CLI, the IP would correspond to its --bind
option and the port would
correspond to its --port
option.
Troubleshooting Visualization
If you're having trouble with visualization:
- Make sure Rerun is running and listening on the correct port
- Verify that you've included the
--add-host=host.docker.internal:host-gateway
flag when running MetriCal via Docker - Check that you're using a compatible version of Rerun (v0.20)
- Try specifying the render socket explicitly with
--render-socket