sleap icon indicating copy to clipboard operation
sleap copied to clipboard

Better support for visualization options when rendering clips

Open crazyhathello opened this issue 2 years ago • 2 comments

Problem: The clip renderer supports only a subset of the visualization features in the native GUI. This is because we have to re-implement a lot of the rendering using OpenCV functions.

MVP: Implement the current visualization options in OpenCV, including the edge wedge display, thicknesses, etc. Most of these are properties that already exist in the renderer class that can be edited in the code (see below in the thread). They should just be exposed in the rendering GUI where we have the other options.

Alternative: Stop using the OpenCV renderer and instead capture the pixels from the QtVideoPlayer scene so the rendered output is identical to what the user sees in the GUI (and so we don't need to re-implement all the rendering routines).


Original issue:

Hello! I was using the "Wedge" edge style for my project, and it seems like the edge style does not carry over when rendering video clips. In addition to edge styles, node marker size and node labels are not displayed properly in the rendered video clip.

I've tried both selecting and unselecting the "Use GUI visual settings" option in the render video menu, and also tried changing the edge style to "Wedge" in preferences.yaml, but these all don't seem to have an effect on the final rendered visuals. Color palette does work though! I am using sleap v1.2.2 .

Thanks for your help! Jensen

crazyhathello avatar Apr 12 '22 08:04 crazyhathello

Hi @crazyhathello,

Thanks for the report. This is a feature we haven't quite gotten around to adding yet, but I agree would be very useful for generating better visualization clips. Tagging it as an enhancement for now and we'll update this thread when we start working on it.

Cheers,

Talmo

talmo avatar Apr 12 '22 15:04 talmo

Thanks @talmo ! Appreciate the response and all the great work on Sleap!

For those that may want a rudimentary implementation of this right now, i found that manually editing some variables are enough to achieve rendering a custom marker radius and line width. (You will need a conda from source installation of sleap)

In sleap/io/visual.py, simply changing edge_line_width and marker_radius to your intended size and launching the GUI again will allow the video to be rendered with these settings. The render video menu checkbox "Use GUI visual settings" can be left checked, as this will only affect the color palette.

It's just a minor but hands-on method, hope to help anyone that would like to try this functionality right now!

image

crazyhathello avatar Apr 13 '22 14:04 crazyhathello