Skip to content

Commit

Permalink
Image processing tools return grayscale image, so need to convert it …
Browse files Browse the repository at this point in the history
…to RGB
  • Loading branch information
shankar-vision-eng committed Jun 28, 2024
1 parent f595c82 commit 65e7b9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vision_agent/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ def extract_frames(
if not video:
raise Exception("No suitable video stream found")
video_file_path = video.download(output_path=temp_dir)

return extract_frames_from_video(video_file_path, fps)

return extract_frames_from_video(str(video_uri), fps)
Expand Down Expand Up @@ -1058,7 +1059,7 @@ def overlay_bounding_boxes(
image, [{'score': 0.99, 'label': 'dinosaur', 'bbox': [0.1, 0.11, 0.35, 0.4]}],
)
"""
pil_image = Image.fromarray(image.astype(np.uint8))
pil_image = Image.fromarray(image.astype(np.uint8)).convert("RGB")

if len(set([box["label"] for box in bboxes])) > len(COLORS):
_LOGGER.warning(
Expand Down

0 comments on commit 65e7b9d

Please sign in to comment.