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

Remove blink detection visualization #1901

Merged
merged 1 commit into from
Jun 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions pupil_src/shared_modules/blink_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ def __init__(
history_length=0.2,
onset_confidence_threshold=0.5,
offset_confidence_threshold=0.5,
visualize=True,
):
super().__init__(g_pool)
self.visualize = visualize
self.history_length = history_length # unit: seconds
self.onset_confidence_threshold = onset_confidence_threshold
self.offset_confidence_threshold = offset_confidence_threshold
Expand All @@ -74,10 +72,10 @@ def init_ui(self):
self.menu.label = "Blink Detector"
self.menu.append(
ui.Info_Text(
"This plugin detects blink onsets and offsets based on confidence drops."
"This plugin detects blink onsets and "
"offsets based on confidence drops."
)
)
self.menu.append(ui.Switch("visualize", self, label="Visualize"))
self.menu.append(
ui.Slider(
"history_length",
Expand Down Expand Up @@ -181,20 +179,9 @@ def reset_history(self):
logger.debug("Resetting history")
self.history.clear()

def gl_display(self):
if self._recent_blink and self.visualize:
if self._recent_blink["type"] == "onset":
cygl_utils.push_ortho(1, 1)
cygl_utils.draw_gl_texture(
np.zeros((1, 1, 3), dtype=np.uint8),
alpha=self._recent_blink["confidence"] * 0.5,
)
cygl_utils.pop_ortho()

def get_init_dict(self):
return {
"history_length": self.history_length,
"visualize": self.visualize,
"onset_confidence_threshold": self.onset_confidence_threshold,
"offset_confidence_threshold": self.offset_confidence_threshold,
}
Expand All @@ -207,7 +194,6 @@ def __init__(
history_length=0.2,
onset_confidence_threshold=0.5,
offset_confidence_threshold=0.5,
visualize=True,
):
self._history_length = None
self._onset_confidence_threshold = None
Expand All @@ -218,7 +204,6 @@ def __init__(
history_length,
onset_confidence_threshold,
offset_confidence_threshold,
visualize,
)
self.filter_response = []
self.response_classification = []
Expand Down