Auto-CS 2.0

https://sourceforge.net/projects/autocs/

Module CuedSpeech.wherecue.position

Class WherePositionPredictorUnified

Description

Predict the coordinates of vowels from 2D sights.

Extend the base class to predict the coordinates of vowels from 2D sights. It overrides methods to provide specific calculations for different vowel positions based on facial landmarks.

It adds the calculation of a radius for each vowel: it allows to define an area in which the target is acceptable.

This model was created from observed values in a corpus.

  • Collected data: 3769 values
  • Filtered data: 3752 values (outliers removed)

Statistics by Hand Position - b: Count = 230, Mean = (144, 397), Std Dev = (70.45, 92.26) - c: Count = 529, Mean = (425, 888), Std Dev = (112.48, 76.10) - m: Count = 676, Mean = (260, 682), Std Dev = (79.36, 90.67) - s: Count = 1750, Mean = (-193, 635), Std Dev = (241.45, 232.91) - t: Count = 584, Mean = (435, 1419), Std Dev = (143.24, 223.21)

Constructor

View Source
def __init__(self, nb_sights=68):
    super(WherePositionPredictorUnified, self).__init__(nb_sights)
    self._description = MSG_DESCRIPTION_UNIFIED

Private functions

_calculate_vowel_n

Override. Calculate the position of the neutral vowel.

Returns
  • (tuple) coordinates and radius of the neutral vowel
View Source
def _calculate_vowel_n(self) -> tuple:
    """Override. Calculate the position of the neutral vowel.

        :return: (tuple) coordinates and radius of the neutral vowel

        """
    x = self._x(0)
    y = self._y(8) + 4 * (self._y(8) - self._y(57))
    r = int(0.2 * self._radius_ratio())
    return (x, y, r)

_calculate_vowel_b

Override. Calculate the position of the cheek bone vowel.

Returns
  • (tuple) coordinates and radius of the cheek bone vowel
View Source
def _calculate_vowel_b(self) -> tuple:
    """Override. Calculate the position of the cheek bone vowel.

        :return: (tuple) coordinates and radius of the cheek bone vowel

        """
    x = self._x(4) + int(abs(self._x(36) - self._x(0)) / 3.7)
    y = self._y(1) + int(abs(self._y(2) - self._y(1)) / 1.4)
    r = int(0.08 * self._radius_ratio())
    return (x, y, r)

_calculate_vowel_c

Override. Calculate the position of the chin vowel.

Returns
  • (tuple) coordinates and radius of the chin vowel
View Source
def _calculate_vowel_c(self) -> tuple:
    """Override. Calculate the position of the chin vowel.

        :return: (tuple) coordinates and radius of the chin vowel

        """
    x = self._x(8) - int(abs(self._x(8) - self._x(6)) / 3.2)
    y = self._y(8) - int(abs(self._y(8) - self._y(57)) / 4.2)
    r = int(0.094 * self._radius_ratio())
    return (x, y, r)

_calculate_vowel_m

Override. Calculate the position of the mouth vowel.

Returns
  • (tuple) coordinates and radius of the mouth vowel
View Source
def _calculate_vowel_m(self) -> tuple:
    """Override. Calculate the position of the mouth vowel.

        :return: (tuple) coordinates and radius of the mouth vowel

        """
    x = self._x(48) - abs(self._x(48) - self._x(4)) // 5
    y = self._y(60) + int(abs(self._y(60) - self._y(4)) * 0.8)
    r = int(0.085 * self._radius_ratio())
    return (x, y, r)

_calculate_vowel_s

Override. Calculate the position of the side vowel.

Returns
  • (tuple) coordinates and radius of the side vowel
View Source
def _calculate_vowel_s(self) -> tuple:
    """Override. Calculate the position of the side vowel.

        :return: (tuple) coordinates and radius of the side vowel

        """
    x = self._x(0) - int(abs(self._x(8) - self._x(0)) / 2.6)
    y = self._y(4) - abs(self._y(4) - self._y(3)) // 2
    r = int(0.237 * self._radius_ratio())
    return (x, y, r)

_calculate_vowel_t

Override. Calculate the position of the throat vowel.

Returns
  • (tuple) coordinates and radius of the throat vowel
View Source
def _calculate_vowel_t(self) -> tuple:
    """Override. Calculate the position of the throat vowel.

        :return: (tuple) coordinates and radius of the throat vowel

        """
    x = self._x(8) - int(abs(self._x(8) - self._x(6)) / 3.6)
    y = self._y(8) + int(0.85 * float(abs(self._y(8) - self._y(33))))
    r = int(0.183 * self._radius_ratio())
    return (x, y, r)