#!/usr/bin/env python3 # SPDX-License-Identifier: Apache-2.0 """Build (and optionally send) a ``POST /predict`` request for transfusion-p150. Standard library only. # point cloud (.bin needs --fields; .npy / .npz / .pcd carry their own layout) python3 code/tt_transfusion/server/client.py --points code/tt_transfusion/samples/test_pcd.npz --out req.json curl -s localhost:20000/predict -H 'Content-Type: application/json' -d @req.json # send it directly and print the response python3 code/tt_transfusion/server/client.py --points code/tt_transfusion/samples/test_pcd.npz \ --url http://127.0.0.1:20000 # cameras (+ a calibration file or a preset listed by /info), planner inputs python3 code/tt_transfusion/server/client.py --image CAM_FRONT=f.jpg --calib-preset \ --url http://127.0.0.1:20000 python3 code/tt_transfusion/server/client.py --inputs scene.npz --url http://127.0.0.1:20000 The implementation is the vendored ``ttaw/server/client.py`` (C08); this file runs it from the model repository with any Python 3.9+, without numpy and without installing the package. In Python, use ``tt_transfusion.ttaw.server.client`` (``build_request``, ``post``, ``wait_ready``, ...). """ import runpy from pathlib import Path if __name__ == "__main__": runpy.run_path(str(Path(__file__).resolve().parents[1] / "ttaw" / "server" / "client.py"), run_name="__main__")