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

Brisque changes #6

Open
wants to merge 1 commit into
base: restructure2
Choose a base branch
from
Open

Conversation

avinabsaha
Copy link
Member

Summary of changes :

  1. In utils.py -> estimation of GGDparameters returns mean and sigma_sq in place of mean and sigma.
  2. Added MATLAB-like implementation of bicubic resizing in python.

Comment on lines 42 to +44
# print(np.mean(vec))
sigma_sq = np.mean(vec**2) #-(np.mean(vec))**2
sigma = np.sqrt(sigma_sq)
#sigma = np.sqrt(sigma_sq)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If sigma is not being used, let's remove these commented lines. Same on lines 42 and 43, and any other unnecessary comments.

E = np.mean(np.abs(vec))
rho = sigma_sq / (E**2 + 1e-6)
array_position = (np.abs(rho - r_gam)).argmin()
alphaparam = gam[array_position]
return alphaparam, sigma
return alphaparam, sigma_sq
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make sure that every function that uses estimateggdparam is updated to reflect this change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avinabsaha in the MATLAB version was the second feature sigma^2 or sigma?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sigma^2.
You can check here: https://github.com/utlive/BRISQUE/blob/bd088c3f6b745629caa02f663e4665cb51591ac0/MATLAB/brisque_feature.m#L21

In the Matlab code, estimateggdparam returns sigma but in the brisque_feature.m it is squared and added to the feature vector. Even the paper mentions using sigma^2.

I will check for compatibility with NIQE by the weekend and update the code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching that!

E = np.mean(np.abs(vec))
rho = sigma_sq / (E**2 + 1e-6)
array_position = (np.abs(rho - r_gam)).argmin()
alphaparam = gam[array_position]
return alphaparam, sigma
return alphaparam, sigma_sq
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avinabsaha in the MATLAB version was the second feature sigma^2 or sigma?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants