session module¶
-
class
session.
Session
(client, uuid, start_client=False, notebook=True, session_endpoint=None, verify_ssl=True, socket_params=None)¶ Bases:
object
-
apply_deformation
(**kwargs)¶ Apply deformation given a set of parameters
- Args:
params: a level-one dict
- Returns:
verts: [N,3] float32 array, deformed vertex coordinates
-
delete
()¶ Delete session
-
property
info
¶ Session info
-
property
model_id
¶ Gets the current model id
-
predict
(**kwargs)¶ Makes a prediction for the current mesh If dataset_id or (verts, faces) are set, prediction is done for the provided mesh.
- Args:
dataset_id: identifier of a dataset (uuid or name) sample_id: identifier of a sample within the dataset verts: [N,3] float32 array, vertex coordinates faces: [F,3] int32 array input_scalars: [S,] - float32 vector, scalar inputs input_fields: [N,NF] - float32 array, field inputs
- Returns:
a dict with the outputs
-
property
sample
¶ Gets current sample as a pair of numpy arrays, [V, 3] verts float32, [F, 3] faces, int64
-
static
start
(client, trained_model_id, dataset_id, sample_id, parametrizer_type='rbf', notebook=True, endpoint=None, verify_ssl=True, socket_params=None)¶ Start a session for a given model and sample
- Args:
trained_model_id: the uuid or name of a trained_model dataset_id: uuid or name of the dataset sample_id: sample id, string parametrizer_type: a string definining the type of the parametrizer notebook: whether to use in notebook mode, defaults to True endpoint: custom endpoint for websockets, defaults to the client endpoint with port 5000 replaced by 5010 verify_ssl: whether to verify ssl certificate for websocket connections, defaults to True socket_params: custom dict to specify wbesocket connection parameters, such as max message size
-
start_client
(notebook=True, verify_ssl=True, socket_params=None)¶ Starts websocket client
- Args:
notebook: whether to use in notebook mode, defaults to True verify_ssl: whether to verify ssl certificate for websocket connections, defaults to True socket_params: custom dict to specify wbesocket connection parameters, such as max message size
-
stop
()¶ Stop session
-