-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: restructure2
Are you sure you want to change the base?
Conversation
# print(np.mean(vec)) | ||
sigma_sq = np.mean(vec**2) #-(np.mean(vec))**2 | ||
sigma = np.sqrt(sigma_sq) | ||
#sigma = np.sqrt(sigma_sq) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
Summary of changes :