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

Feature: mean of the array np.mean => simsimd.mean #248

Open
2 of 3 tasks
ternaus opened this issue Jan 25, 2025 · 0 comments
Open
2 of 3 tasks

Feature: mean of the array np.mean => simsimd.mean #248

ternaus opened this issue Jan 25, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@ternaus
Copy link

ternaus commented Jan 25, 2025

Describe what you are looking for

If I have image with shape (height, width, num_channel) and I want to compute mean:

numpy

mean = np.mean(x)

If num_channels = 3, I can use OpenCV:

mean = np.mean(cv2.mean(x)[:3])

OpenCV computes mean per channel for RGBA images returning for RGB images array (mean_channel_0, mean_channel_1, mean_2, 0) and we use np.mean() to take average of that.

First works for any shape but slower
Second works for images with 3 channels, but faster

Request:
mean operation that

  • works on any shape
  • is faster than OpenCV or numpy version

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

It applies to everything

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ternaus ternaus added the enhancement New feature or request label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant