cvisionai / tator

Video analytics web platform
https://tator.io
GNU Affero General Public License v3.0
98 stars 32 forks source link

Allow video player to decode + display RLE masks stored as box attributes #1721

Open bctcvai opened 3 weeks ago

bctcvai commented 3 weeks ago

Storing RLE masks as box attributes is a nice way to deal with immutable masks in video sources because they are much more efficient to store and transmit.

Add a way for the video player to detect a box type has RLE attribute (likely a blob type) and display the mask in the image alongside the box.

Of note: the RLE attribute will be valid JSON, an example RLE encoded mask is

A929B225A3B229A2B229A3B228A4B227A5B226A5B226A5B225A6B225A6B225A6B224A7B224A7B224A7B224A7B224A7B224A7B223A8B223A9B222A10B219A13B218A14B216A15B216A15B215A16B215A16B214A17B213A19B212A20B210A22B209A23B207A24B206A25B205A26B204A27B204A28B202A30B199A33B197A35B196A35B195A37B192A40B190A42B188A43B187A45B184A47B183A49B181A51B179A53B178A54B176A55B176A56B175A58B173A59B172A59B172A60B171A62B169A63B168A63B168A64B167A66B165A67B164A67B164A68B163A70B161A72B159A73B158A75B156A78B152A80B151A80B151A81B150A83B148A84B146A85B145A87B144A96B134A98B133A99B132A100B130A123B106A127B103A129B102A130B99A133B93A138B92A140B91A141B89A143B78A154B76A155B75A157B71A162B54A178B51A180B49A183B46A186B39A193B37A195B35A197B32A93

where A is 0 and B is 1. This allows the encoding to be stored in a UTF-8 compliant string.