bonsai-rx / deeplabcut

A Bonsai interface for real-time markerless pose estimation using DeepLabCut
MIT License
47 stars 9 forks source link

DetectPose node should accept grayscale images and convert them to BGR if necessary #3

Closed glopesdev closed 2 years ago

glopesdev commented 3 years ago

Currently DLC models expect a 3-channel tensor, which means grayscale images have to be converted before detection. It might be useful to do this inside the DetectPose node itself both for convenience and potentially to slightly reduce the cost of external allocations.

glopesdev commented 3 years ago

The main current difficulty is that OpenCV does not seem to allow for simultaneous channel and depth conversion in the same call (e.g. the input TensorFlow image needs to be a 3-channel F32 image), so a temporary buffer would need to be allocated either way (e.g. both CvtColor and Convert need to be called).

glopesdev commented 2 years ago

Duplicate of #6

Specifying the desired RGB color conversion also works for the grayscale case.