feat: NavGPT w/ our distance module(expr2)
This commit is contained in:
parent
7e5abbca0e
commit
edc6d6f198
@ -57,7 +57,7 @@ NOW_LOCATION = None
|
|||||||
FOUND_BBOX = ""
|
FOUND_BBOX = ""
|
||||||
LAST_VP = ""
|
LAST_VP = ""
|
||||||
|
|
||||||
THRESHOLD = 0.278
|
THRESHOLD = 0.75
|
||||||
SCAN = ""
|
SCAN = ""
|
||||||
|
|
||||||
MISSING_ACTION_AFTER_THOUGHT_ERROR_MESSAGE = (
|
MISSING_ACTION_AFTER_THOUGHT_ERROR_MESSAGE = (
|
||||||
@ -70,9 +70,14 @@ FINAL_ANSWER_AND_PARSABLE_ACTION_ERROR_MESSAGE = (
|
|||||||
"Parsing LLM output produced both a final answer and a parse-able action:"
|
"Parsing LLM output produced both a final answer and a parse-able action:"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
print("Load GroundingDINO confidence file...")
|
||||||
|
confidences = load_json('../datasets/REVERIE/annotations/grounding_dino_confidence.json')
|
||||||
|
print("Loaded")
|
||||||
|
'''
|
||||||
print("Load CLIP confidence file...")
|
print("Load CLIP confidence file...")
|
||||||
confidences = load_json('../datasets/REVERIE/annotations/confidence.json')
|
confidences = load_json('../datasets/REVERIE/annotations/confidence.json')
|
||||||
print("Loaded")
|
print("Loaded")
|
||||||
|
'''
|
||||||
print()
|
print()
|
||||||
|
|
||||||
print("Load distance file...")
|
print("Load distance file...")
|
||||||
@ -128,8 +133,8 @@ class NavGPTOutputParser(AgentOutputParser):
|
|||||||
found = False
|
found = False
|
||||||
max_bbox, max_bbox_confidence = "", 0
|
max_bbox, max_bbox_confidence = "", 0
|
||||||
|
|
||||||
for bbox in confidences[SCAN][tool_input]:
|
for bbox in confidences[SCAN][tool_input][CLIP_TARGET]:
|
||||||
confidence = confidences[SCAN][tool_input][bbox][CLIP_TARGET]
|
confidence = bbox['score']
|
||||||
if confidence >= THRESHOLD and confidence >= max_bbox_confidence:
|
if confidence >= THRESHOLD and confidence >= max_bbox_confidence:
|
||||||
max_bbox = bbox
|
max_bbox = bbox
|
||||||
max_bbox_confidence = confidence
|
max_bbox_confidence = confidence
|
||||||
@ -401,7 +406,8 @@ class NavGPTAgent(BaseAgent):
|
|||||||
rel_viewpoint_heading = viewpoint_heading - heading_angle
|
rel_viewpoint_heading = viewpoint_heading - heading_angle
|
||||||
rel_viewpoint_heading = normalize_angle(rel_viewpoint_heading)
|
rel_viewpoint_heading = normalize_angle(rel_viewpoint_heading)
|
||||||
rel_viewpoint_heading = angle_to_left_right(rel_viewpoint_heading)
|
rel_viewpoint_heading = angle_to_left_right(rel_viewpoint_heading)
|
||||||
vp_description = rel_viewpoint_heading + f', {viewpoint_data["distance"]:.2f}m'
|
# vp_description = rel_viewpoint_heading + f', {viewpoint_data["distance"]:.2f}m'
|
||||||
|
vp_description = rel_viewpoint_heading
|
||||||
vp_description = vp_description + f', {viewpoint_data["wall_distance"]:.2f}m to the wall'
|
vp_description = vp_description + f', {viewpoint_data["wall_distance"]:.2f}m to the wall'
|
||||||
# rel_range_idx = (vp_range_idx - range_idx) % 8
|
# rel_range_idx = (vp_range_idx - range_idx) % 8
|
||||||
candidate_range.setdefault(vp_range_idx, {}).update({viewpoint_id: vp_description})
|
candidate_range.setdefault(vp_range_idx, {}).update({viewpoint_id: vp_description})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user