Skip to content

Commit

Permalink
chore: fixed copy to superpoint.image_processing_superpoint.convert_t…
Browse files Browse the repository at this point in the history
…o_grayscale
  • Loading branch information
sbucaille committed Oct 14, 2024
1 parent 5058d63 commit 574f865
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def convert_to_grayscale(
requires_backends(convert_to_grayscale, ["vision"])

if isinstance(image, np.ndarray):
if is_grayscale(image, input_data_format=input_data_format):
return image
if input_data_format == ChannelDimension.FIRST:
gray_image = image[0, ...] * 0.2989 + image[1, ...] * 0.5870 + image[2, ...] * 0.1140
gray_image = np.stack([gray_image] * 3, axis=0)
Expand Down

0 comments on commit 574f865

Please sign in to comment.