facereader_client¶
Code documentation¶
-
class
msrresearch_helpers.facereader.
FaceReader
(host, port, buffer_size=4, func=None, func_args=None)¶ FaceReader class to use the API provided by Noldus
The purpose of this class is to operate FaceReader by Noldus. It uses all functionality given by the API documentation from Noldus.
Parameters: -
class
MySocket
(host, port, log=None, func=None, func_args=None, sock=None)¶ Class to send and receive messages via TCP.
-
connect
(host, port)¶ Connect to a host via TCP using socket.
Parameters:
-
receive
()¶ Receive a message from the set and connected host.
Returns: str - the received message
-
stop
()¶ Stop the thread in which MySocket is running.
-
-
FaceReader.
get_classification_value
(value)¶ Get any value from within the ClassificationValues dictionary of the last log entry.
-
FaceReader.
get_events
()¶ Receive a list of all event markers set in the current FaceReader project.
Returns: A list of all event markers.
-
FaceReader.
get_stimuli
()¶ Receive a list of all stimuli set in the current FaceReader project
Returns: A list of all stimuli
-
FaceReader.
score_event
(event)¶ Scores a event marker within the running analysis.
Parameters: event (str) – The name of the event marker to be scored.
-
FaceReader.
score_stimulus
(stimulus)¶ Scores a stimuli within the running anlysis
Parameters: stimulus (str) – Name of the stimulus to score
-
FaceReader.
start_analyzing
()¶ Starts analyzing.
This function sends an action message to FaceReader to start analyzing a preset data source.
-
FaceReader.
start_detailed_log
()¶ Starts a log mode, which returns all of the data known to man.
-
FaceReader.
start_state_log
()¶ Starts a log mode, which returns the at the moment dominant facial expression.
-
FaceReader.
stop_analyzing
()¶ Stops analyzing.
This function sends an action message to Facereader to stop analyzing a preset data source.
-
FaceReader.
stop_detailed_log
()¶ Stops the log mode started with
start_detailed_log()
.
-
FaceReader.
stop_state_log
()¶ Stops the log mode started with
start_state_log()
.
-
class
Logs¶
At the moment FaceReader supports to kinds of logs: the detailed and the state log. While the first mentioned includes all data gathered while analyzing a frame, the later log only contains the at the moment dominant facial expression.
Detailed log¶
Detailed logging can be enabled by calling the function
start_detailed_log()
and can be stopped by calling
stop_detailed_log()
.
State log¶
State logging can be enabled by calling the function
start_state_log()
and can be stopped by calling
stop_state_log()
.