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

Review and reduce amount of log messages being displayed in the UI #2190

Merged
merged 12 commits into from
Oct 12, 2021
9 changes: 8 additions & 1 deletion pupil_src/shared_modules/gaze_mapping/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ def _filter_pupil_list_by_confidence(pupil_list, threshold):
pupil_list = [p for p in pupil_list if p["confidence"] >= threshold]
len_post_filter = len(pupil_list)
dismissed_percentage = 100 * (1.0 - len_post_filter / len_pre_filter)
logger.info(
logger.debug(
f"Dismissing {dismissed_percentage:.2f}% pupil data due to "
f"confidence < {threshold:.2f}"
)
max_expected_percentage = 20.0
if dismissed_percentage >= max_expected_percentage:
logger.warning(
"An unexpectedly large amout of pupil data "
papr marked this conversation as resolved.
Show resolved Hide resolved
f"(> {max_expected_percentage:.0f}%) was dismissed due to low confidence. "
"Please check the pupil detection."
)
papr marked this conversation as resolved.
Show resolved Hide resolved
return pupil_list


Expand Down