bodycompress#
BodyCompress is for compressing and decompressing nonparametric human representations, i.e. keypoints like mesh vertices and joints.
Classes#
Compresses body data to a file using xz compression. |
|
Decompresses body data from a file compressed using BodyCompressor. |
Package Contents#
- class BodyCompressor(path, metadata=None, quantization_mm=0.5, n_threads=0)[source]#
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)[source]#
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)
- class BodyDecompressor(path)[source]#
Bases:
contextlib.AbstractContextManager,collections.abc.IteratorDecompresses body data from a file compressed using BodyCompressor.
The data is decompressed using xz, deserialized using msgpack_numpy, difference decoded and unquantized.
- Parameters:
path – path to the compressed file