Beispiel #1
0
 def _create_progress_indication(self):
     progress = self._detection_controller.progress
     if progress > 0:
         return RangeElementFrameIdx(
             from_idx=self._frame_start,
             to_idx=int(self._frame_start + self._frame_count * progress) - 1,
             color_rgba=(1.0, 1.0, 1.0, 0.8),
             height=4,
         )
     else:
         return RangeElementFrameIdx()
 def _create_calibration_range(self, gaze_mapper, alpha):
     calibration = self._gaze_mapper_controller.get_valid_calibration_or_none(
         gaze_mapper)
     color = [0.6, 0.2, 0.8, alpha]
     # color = [217 / 255, 95 / 255, 2 / 255, alpha]
     if (calibration is not None
             and self._calibration_controller.is_from_same_recording(
                 calibration)):
         from_idx, to_idx = calibration.frame_index_range
         return RangeElementFrameIdx(from_idx,
                                     to_idx,
                                     color_rgba=color,
                                     height=3,
                                     offset=-3.5)
     else:
         return RangeElementFrameIdx(from_idx=0, to_idx=0)
Beispiel #3
0
 def _create_validation_range(self, gaze_mapper, alpha):
     from_idx, to_idx = gaze_mapper.validation_index_range
     color = [0.9, 0.9, 0.2, alpha]
     # color = [27 / 255, 158 / 255, 119 / 255, alpha]
     return RangeElementFrameIdx(
         from_idx, to_idx, color_rgba=color, height=3, offset=3.5
     )
Beispiel #4
0
 def _create_mapping_range(self, gaze_mapper, alpha):
     from_idx, to_idx = gaze_mapper.mapping_index_range
     # TODO: find some final color scheme
     color = (
         [0.3, 0.5, 0.5, alpha]
         # [136 / 255, 92 / 255, 197 / 255, alpha*1.0]
         if not gaze_mapper.empty()
         else [0.66 * 0.7, 0.86 * 0.7, 0.46 * 0.7, alpha * 0.8]
     )
     return RangeElementFrameIdx(from_idx, to_idx, color_rgba=color, height=10)