Add setup script and JSON pose output for CSI pipeline#46
Add setup script and JSON pose output for CSI pipeline#46nbschultz97 wants to merge 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
| try: | ||
| tensor = np.asarray(amps, dtype="float32") | ||
| tensor = tensor.reshape(1, *tensor.shape) | ||
| pose, conf = self.model.predict(tensor) | ||
| return str(pose), float(conf) |
There was a problem hiding this comment.
[P1] Convert amplitude window to torch tensor before calling WiPose
The new PoseEstimator.predict forwards the flattened NumPy amplitudes directly into self.model.predict. WiPose is a PyTorch model and its predict helper expects a torch.Tensor (or something it can call .to() on) wrapped in a no_grad context. Passing a plain NumPy array will typically raise inside WiPose and trigger the broad except, so the method always falls back to ("unknown", 0.0) even when WiPose is installed. This means the advertised pose output never materialises. Convert the array with torch.from_numpy(...).unsqueeze(0) and call the model under torch.no_grad() so real predictions are returned.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Summary
- Flattened the input amplitude array and wrapped WiPose inference in a
torch.no_grad()block, converting the array to a tensor so predictions return correctly when WiPose is available csi_node/pose.pyL46-L49
Testing
- ✅
pytest
Summary
setup_and_run.shto bootstrap environment, install FeitCSI, verify hardware, and launch appTesting
pytesthttps://chatgpt.com/codex/tasks/task_e_68c32b4944b4832890eb6f2df9c20b45