Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mask key for visualization #66

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions vision_agent/agent/vision_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ def _handle_viz_tools(
# 2. return a dictionary but not have the necessary keys

if not isinstance(call_result, dict) or (
"bboxes" not in call_result and "heat_map" not in call_result
"bboxes" not in call_result
and "mask" not in call_result
and "heat_map" not in call_result
):
return image_to_data

Expand All @@ -366,7 +368,8 @@ def _handle_viz_tools(
image_to_data[image]["scores"].extend(call_result.get("scores", []))
image_to_data[image]["masks"].extend(call_result.get("masks", []))
# only single heatmap is returned
image_to_data[image]["heat_map"].append(call_result.get("heat_map", []))
if "heat_map" in call_result:
image_to_data[image]["heat_map"].append(call_result["heat_map"])
if "mask_shape" in call_result:
image_to_data[image]["mask_shape"] = call_result["mask_shape"]

Expand Down
Loading