Repository navigation
feat(vlm_verifier): enhance vlm verifier to verify images before and after cap call - #294
Conversation
Enhance the VLM verifier service to capture and verify both before and after images during capability execution. The service now requires a "before" image to be captured before executing the action, and an "after" image to validate the result. Update the verification logic to handle these phases, ensuring that visual evidence is clearly defined and processed. Adjust tests to validate the new functionality, including checks for image capture and verification outcomes. - Update README to reflect changes in service behavior. - Modify service logic to store and evaluate images based on execution phase. - Enhance tests to cover new before/after verification scenarios. - Ensure backward compatibility with existing verification rules.
|
Thanks for improving the VLM verifier. Comparing the state before and after a call is a reasonable idea, but the current implementation has a design problem: it assumes that the two frames actually show the target and the effect, and nothing guarantees that.
A simple example: a mobile manipulator with a wrist camera runs Verifying the outcome of an executed action when the camera may not see it has been studied; some relevant work:
Common to these: more than one view, evidence taken at the right moment (during execution or at gripper/subgoal events) rather than one frame after the call, non-visual signals for grasping, and an explicit "cannot tell yet" outcome instead of forcing pass/fail. Changes that fit this PR without much work:
Gripper signals for grasp success and keyframes at gripper events are worth a follow-up issue, but they need the arm primitives to expose those signals, so they are out of scope here. |
Enhance the VLM verifier to accept multiple camera providers for image capture during verification. The changes include: - Updated the README to reflect the new configuration for `camera_provider_ids`. - Modified the service logic to handle both single and multiple camera configurations, ensuring backward compatibility. - Enhanced tests to validate the behavior with multiple cameras, including checks for image capture and verification outcomes. - Improved error handling for missing or invalid camera configurations. This update allows for more flexible verification scenarios, improving the robustness of the VLM verifier service.
Thanks for the detailed review. I have made the following changes:
In local BEHAVIOR tests with action assistance, the multi-view configuration completed all six actions and passed the official BDDL goal check. An independent no-op placement was correctly rejected, and subsequent actions were blocked. For the same placement sample, head-camera-only verification reported insufficient evidence, while adding two table views produced an observable, successful verdict. Cameras were configured per action to avoid confusion from unrelated views. |
There was a problem hiding this comment.
Ran head 91cbcd0b locally: the verifier unit tests, the executor tests, the smoke script, and the real service.verify() path.
What needs fixing before merge (details inline):
- the pending before-image cache has no bound or expiry, and the tests written for it fail;
- a duplicate
beforefor the samecall_idis accepted and overwrites the stored frames; smoke_mcp.pyfails in teardown before it reaches the overlap checks;- none of the verifier Python tests run in CI, which is how these failures got in. Please add
python3 -m unittest discover -s tests -p test_verifier.py(inservices/verifiers/vlm_verifier) toci.yml.
Current state of that command: 26 pass, 2 fail, 1 error. cargo test -p robonix-executor passes (55/55).
| head_color[0] = [0, 0, 255] | ||
| for overlap in (False, True): | ||
| for cameras in (("wrist",), ("wrist", "head")): | ||
| entry.CAMERAS.close() |
There was a problem hiding this comment.
After the 10 synchronous checks (both camera sets) pass, the next entry.CAMERAS.close() here fails, so the overlap checks never run. The pool still holds channels opened during the previous check(). That call has already terminated its Atlas and left the ROBONIX_ATLAS patch, so directory.close() sends the disconnect to the default endpoint:
File "tests/smoke_mcp.py", line 209, in main
File "vlm_verifier/camera.py", line 202, in close
File "vlm_verifier/directory.py", line 42, in close
grpc._channel._InactiveRpcError: status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; ... ipv4:127.0.0.1:50051: ... Connection refused"
When I ignored only this error, all 20 checks (1/2 cameras × sync/overlap × pass/reject/unobservable/malformed/missing camera) passed, so the logic looks fine and this is a cleanup-order bug. Close the camera pool inside check() before Atlas is torn down, or make close() tolerate an unreachable directory.
…hance verification logic - Updated the README to document new limits on pending before images, including a maximum of 64 calls and 64 MiB of JPEG data. - Enhanced service logic to manage the lifecycle of before images, including eviction of expired entries and handling of duplicate call IDs. - Improved error handling for scenarios where after requests are made with expired or evicted before images. - Added tests to validate the new behavior, ensuring proper handling of image limits and verification availability. This update strengthens the VLM verifier's image management and verification processes.
Sorry,I thought some changes are needless, so I delete some codes and 3 tests failed. I've changed back and fixed them. I think it is needless to include vlm verifier test in ci, so I didn't do. |
Enhance the VLM verifier service to capture and verify both before and after images during capability execution. The service now requires a "before" image to be captured before executing the action, and an "after" image to validate the result. Update the verification logic to handle these phases, ensuring that visual evidence is clearly defined and processed. Adjust tests to validate the new functionality, including checks for image capture and verification outcomes.