Download code/tt_frnet/server/client.py from changh95/frnet-p150: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/changh95/frnet-p150/resolve/main/code/tt_frnet/server/client.py
- Command line
-
hf download hf://changh95/frnet-p150/code/tt_frnet/server/client.py
-
curl -L -o client.py https://huggingface.co/changh95/frnet-p150/resolve/main/code/tt_frnet/server/client.py
1.37 kB
| #!/usr/bin/env python3 | |
| # SPDX-License-Identifier: Apache-2.0 | |
| """Build (and optionally send) a ``POST /predict`` request for frnet-p150. Standard library only. | |
| # point cloud (.bin needs --fields; .npy / .npz / .pcd carry their own layout) | |
| python3 code/tt_frnet/server/client.py --points code/tt_frnet/samples/synthetic_ot128.npz \ | |
| --calib-preset synthetic_ot128 --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_frnet/server/client.py --points code/tt_frnet/samples/synthetic_ot128.npz \ | |
| --calib-preset synthetic_ot128 --url http://127.0.0.1:20000 | |
| # another cloud: its own sensor -> base_link transform for the ego crop box (a JSON file), or no box | |
| python3 code/tt_frnet/server/client.py --points my_scan.pcd --calib my_calib.json --out req.json | |
| 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_frnet.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__") | |