This EyePop.ai Node Module provides convenient 2d rendering functions for predictions returned by to the EyePop.ai's inference API from applications written in the TypeScript or JavaScript language.
By default, the 2d renderer renders boxes and class-labels for every top level object in the prediction. Change this rendering behaviour by passing in rendering rule(s), e.g.:
Each rule has a render object and a target attribute. All prebuild render classes accept a JSONPath expression as target parameter to select which elements should be rendered from predictions. See JSONPath expression
Most prebuild render classes provide a reasonable default target.
Rendering Bounding Boxes and Class Labels
Render2d.renderBox(target = '$.objects.*')
// or
Render2d.renderBox()
Render Human Body Poses (2d or 3d)
Render2d.renderPose(target = '$..objects[?(@.category=="person")]')
// or
Render2d.renderPose()
Render Human Hand Details
Render2d.renderHand(target = '$..objects[?(@.classLabel=="hand circumference")]')
// or
Render2d.renderHand()
Render Human Faces
Render2d.renderFace(target = '$..objects[?(@.classLabel=="face")]')
// or
Render2d.renderFace()
Render Segmentation Masks
Render2d.renderMask(target = '$..objects[?(@.mask)]')
// or
Render2d.renderMask()
Render Segmentation Contours
Render2d.renderContour(target = '$..objects[?(@.contours)]')
// or
Render2d.renderContour()
Blur an Object (TODO does black-put instead of blur)
Render2d.renderTrail(1.0, target = '$..objects[?(@.traceId)]')
// or
Render2d.renderTrail()
By default, this traces the mid-point of the object's bounding box. Instead, one can also draw trails of sub-objects or key points of the traced object. Use the optional parameter traceDetails for this purpose. E.g. trail the nose of every traced person: