pepper.framework.context module

Context

class pepper.framework.context.Context[source]

Bases: object

Context Object

Contains Awareness for People, Objects & Conversations

OBSERVATION_TIMEOUT = 60
add_objects(objects)[source]

Add Object Observations to Context

Parameters:objects (list of Object) – List of Objects
add_people(people)[source]

Add People Observations to Context

Parameters:people (list of Face) – List of People
all_objects

Objects seen since beginning of Context

Returns:objects – List of all Objects since beginning of Context
Return type:list of Object
all_people

People seen since beginning of Context

Returns:people – List of all People seen since beginning of Context
Return type:list of Face
chat

The Current Chat, if any

Returns:chat
Return type:Optional[Chat]
chats

returns: chats – List of all Chats that were held during current session :rtype: list of Chat

chatting

Returns True when a Chat is happening

Returns:chatting
Return type:bool
datetime

The Current Date & Time

Returns:datetime – Current Date and Time
Return type:datetime
id

ID

Returns:id
Return type:int
location

The Current Location

Returns:location – Current Location
Return type:Location
objects

Objects seen within Observation Timeout

Returns:objects – List of Objects seen within Observation Timeout
Return type:list of Object
people

People seen within Observation Timeout

Returns:people – List of People seen within Observation Timeout
Return type:list of Face
start_chat(speaker)[source]

Start Chat with Speaker

Parameters:speaker (str) – Name of Speaker
stop_chat()[source]

Stop Chat

class pepper.framework.context.ObjectObservations[source]

Object Observations for a particular Object Class

EPSILON = 0.2
INSTANCE_TIMEOUT = 120
MAX_SAMPLES = 50
MIN_SAMPLES = 5
OBSERVATION_TIMEOUT = 2
add_observation(obj)[source]

Add Observation of object with this Object Class

Cluster Object Observations to figure out Object Instances

Parameters:obj (Object) –
instances

Get individual object instances for this Object Class

Returns:instances
Return type:List[Object]
update_view(image)[source]

Update Object Instances with Current Image

Remove Observations one by one, when they are not longer where expected

Parameters:image (AbstractImage) –
class pepper.framework.context.Observations[source]

Object Observations

Object to track of which objects have been seen and where. Groups Object Observations based on location, to guess which observations are in fact of the same object. Each Object Class is handled in ObjectObservations.

add_observations(image, objects)[source]

Add Object Observations and figure out with which Object Instance they correspond

Parameters:
instances

Get individual object instances, based on observations

Returns:instances
Return type:List[Object]
pepper.framework.context.getrandbits(k) → x. Generates a long int with k random bits.