add private module to create model object for movement api
This commit is contained in:
1
opendbm/api_lib/movement/__init__.py
Normal file
1
opendbm/api_lib/movement/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from opendbm.api_lib.movement.api import Movement
|
||||
11
opendbm/api_lib/movement/_eye_blink.py
Normal file
11
opendbm/api_lib/movement/_eye_blink.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from opendbm.api_lib.model import DLIB_SHAPE_MODEL, VideoModel
|
||||
from opendbm.dbm_lib.dbm_features.raw_features.movement.eye_blink import run_eye_blink
|
||||
|
||||
|
||||
class EyeBlink(VideoModel):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._params = ["mov_blink_ear", "mov_blinkframes", "mov_blinkdur", "fps"]
|
||||
|
||||
def _fit_transform(self, path):
|
||||
return run_eye_blink(path, ".", self.r_config, DLIB_SHAPE_MODEL, save=False)
|
||||
24
opendbm/api_lib/movement/_eye_gaze.py
Normal file
24
opendbm/api_lib/movement/_eye_gaze.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import tempfile
|
||||
|
||||
from opendbm.api_lib.model import VideoModel
|
||||
from opendbm.dbm_lib.dbm_features.raw_features.movement.eye_gaze import run_eye_gaze
|
||||
|
||||
|
||||
class EyeGaze(VideoModel):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._params = [
|
||||
"mov_lefteyex",
|
||||
"mov_lefteyey",
|
||||
"mov_lefteyez",
|
||||
"mov_righteyex",
|
||||
"mov_righteyey",
|
||||
"mov_righteyez",
|
||||
"mov_leyedisp",
|
||||
"mov_reyedisp",
|
||||
]
|
||||
|
||||
def _fit_transform(self, path):
|
||||
return run_eye_gaze(
|
||||
path, f"{tempfile.gettempdir()}/", self.r_config, save=False
|
||||
)
|
||||
52
opendbm/api_lib/movement/_facial_tremor.py
Normal file
52
opendbm/api_lib/movement/_facial_tremor.py
Normal file
@@ -0,0 +1,52 @@
|
||||
import tempfile
|
||||
|
||||
from opendbm.api_lib.model import VideoModel
|
||||
from opendbm.dbm_lib import fac_tremor_process
|
||||
|
||||
|
||||
class FacialTremor(VideoModel):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._params = [
|
||||
"fac_features_mean_5",
|
||||
"fac_tremor_median_5",
|
||||
"fac_disp_median_5",
|
||||
"fac_corr_5",
|
||||
"fac_features_mean_12",
|
||||
"fac_tremor_median_12",
|
||||
"fac_disp_median_12",
|
||||
"fac_corr_12",
|
||||
"fac_features_mean_8",
|
||||
"fac_tremor_median_8",
|
||||
"fac_disp_median_8",
|
||||
"fac_corr_8",
|
||||
"fac_features_mean_48",
|
||||
"fac_tremor_median_48",
|
||||
"fac_disp_median_48",
|
||||
"fac_corr_48",
|
||||
"fac_features_mean_54",
|
||||
"fac_tremor_median_54",
|
||||
"fac_disp_median_54",
|
||||
"fac_corr_54",
|
||||
"fac_features_mean_28",
|
||||
"fac_tremor_median_28",
|
||||
"fac_disp_median_28",
|
||||
"fac_corr_28",
|
||||
"fac_features_mean_51",
|
||||
"fac_tremor_median_51",
|
||||
"fac_disp_median_51",
|
||||
"fac_corr_51",
|
||||
"fac_features_mean_66",
|
||||
"fac_tremor_median_66",
|
||||
"fac_disp_median_66",
|
||||
"fac_corr_66",
|
||||
"fac_features_mean_57",
|
||||
"fac_tremor_median_57",
|
||||
"fac_disp_median_57",
|
||||
"fac_corr_57",
|
||||
]
|
||||
|
||||
def _fit_transform(self, path):
|
||||
return fac_tremor_process(
|
||||
path, f"{tempfile.gettempdir()}/", self.r_config, save=False
|
||||
)
|
||||
19
opendbm/api_lib/movement/_head_movement.py
Normal file
19
opendbm/api_lib/movement/_head_movement.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import tempfile
|
||||
|
||||
from opendbm.api_lib.model import VideoModel
|
||||
from opendbm.dbm_lib import run_head_movement
|
||||
|
||||
|
||||
class HeadMovement(VideoModel):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._params = [
|
||||
"mov_headvel",
|
||||
"mov_hposepitch",
|
||||
"mov_hposeyaw",
|
||||
"mov_hposeroll",
|
||||
"mov_hposedist",
|
||||
]
|
||||
|
||||
def _fit_transform(self, path):
|
||||
return run_head_movement(path, f"{tempfile.gettempdir()}/", self.r_config)
|
||||
18
opendbm/api_lib/movement/_vocal_tremor.py
Normal file
18
opendbm/api_lib/movement/_vocal_tremor.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from opendbm.api_lib.model import VideoModel
|
||||
from opendbm.dbm_lib.dbm_features.raw_features.movement.voice_tremor import run_vtremor
|
||||
|
||||
|
||||
class VocalTremor(VideoModel):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._params = [
|
||||
"mov_freqtremfreq",
|
||||
"mov_freqtremindex",
|
||||
"mov_freqtrempindex",
|
||||
"mov_amptremfreq",
|
||||
"mov_amptremindex",
|
||||
"mov_amptrempindex",
|
||||
]
|
||||
|
||||
def _fit_transform(self, path):
|
||||
return run_vtremor(path, ".", self.r_config, save=False)
|
||||
Reference in New Issue
Block a user