BodyCompressor#
- class bodycompress.BodyCompressor(path, metadata=None, quantization_mm=0.5, n_threads=0)#
Bases:
contextlib.AbstractContextManagerCompresses body data to a file using xz compression.
The data is quantized, difference encoded, serialized using
msgpack_numpythen compressed usingxzand written to the file.- Parameters:
- append(**kwargs)#
Append data for frame to the file.
- Parameters:
**kwargs –
data to be stored. Supported keys are
vertices: (N, 3) float32 array of vertices in millimeters
joints: (N, 3) float32 array of joints in millimeters
vertex_uncertainties: (N,) float32 array of vertex uncertainties in meters
joint_uncertainties: (N,) float32 array of joint uncertainties in meters
camera: cameralib.Camera object or dict with camera parameters
allowed (Other keys are also)
quantized. (but they will not be)
- close()#
Wait for the currently pending compression to finish then close the file.
- __exit__(exc_type, exc_value, traceback)#
Close the file and remove it if an exception occurred.