Skip to content

Commit

Permalink
[gpt4v_vqa] bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
sktometometo committed Jan 9, 2024
1 parent 2dbb8de commit bb4b28e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gpt4v_vqa/node_scripts/gpt4v_vqa_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def resize_image(self, image: np.ndarray) -> np.ndarray:
scale = min(self.max_height / height, self.max_width / width)
image = cv2.resize(
image,
(int(width * scale), int(height * scale), num_channel),
(int(width * scale), int(height * scale)),
interpolation=cv2.INTER_AREA,
)
return image
Expand Down Expand Up @@ -108,10 +108,10 @@ def _ac_cb(self, goal: VQATaskGoal):
rospy.logerr(f"No choices in response: {response}")
continue
answer = response["choices"][0]["message"]["content"]
result.result.results.append(
result.result.result.append(
QuestionAndAnswerText(question=question, answer=answer)
)
if len(result.result.results) == 0:
if len(result.result.result) == 0:
rospy.logerr("No answers found")
self.ac.set_aborted(result)
return
Expand Down

0 comments on commit bb4b28e

Please sign in to comment.