Annotating larger images

I'm trying to annotate images. They're only around 6MB, but the interface gets pretty laggy, especially on weaker CPUs. A firefox profile reveals that the entire canvas is re-drawn upon each mouse move, which leads to janky behavior. Here's a link to the profile: https://share.firefox.dev/2OVkInV

Is there a way to fix this? I have already optimised the images to be as small as possible. They cannot become any smaller since they contain text that must remain legible.

Wow, thanks for this next-level reporting, this is super helpful! :pray::100:

Prodigy definitely shouldn't be redrawing the 6MB image on every move, just the boxes – so that's something we need to fix. I'll look into this. Working with canvas elements can sometimes introduce these subtle performance gotchas.

Workaround in the meantime: You can try setting "image_manual_legacy": true in your config to use the old, SVG-based interface. This will be a lot more efficient, but it only supports a limited set of actions (no freehand shapes, no moving/resizing). But if you're mostly looking to draw some boxes, it should work fine.

1 Like

Thanks a lot, Ines! We'll try the SVG-based interface. It'll probably work well enough for now :slight_smile:

We have one more question. In the SVG-based interface, how do we "finalise" polygon shapes? We can't seem to figure that out on our own.

Edit: Nevermind, we did figure it out. A double-click will close the current polygon shape.

@AK_Fischer Could you test this again with the current nightly release? I made a small change that should have an impact. (I think I remember seeing your name in the nightly applications, so you have access to it, right? :slightly_smiling_face:)

Yes, I do have access to the nightly releases :slight_smile:

It's much better! On my machine (MacBook Pro with 2,6 GHz 6-Core Intel Core i7), average frame rates for small images hover around 57fps and I can't get that down significantly. For large images, if I create dozens of boxes, the frame rate drops pretty linearly (I got it down to about 15fps for around 100 boxes).

I suspect that weaker machines will still struggle at some point, but it stays usable much longer. I'll see if I can test it on a weaker machine, too.

This is very nice! :fireworks:

Thanks for testing, that's great to hear! :tada:

(I'd accept there will be a point where those types of complex image annotations on large images become less efficient on weaker machines – especially given the types of features we want to support in the UI. There's always a workaround via resizing the images, and we'll also keep the legacy UI around as a more performant alternative with a slightly limited feature set :slightly_smiling_face:)

I agree -- I think further significant optimisations would probably require specialised data structures. That's probably not worth the effort if the use case is too niche-y.

I suspect that instead of optimising for a fringe use case, it might make more sense to give the user finer control over the canvas and image loading logics so they can optimise for their use case themselves. That way, someone might be able to load and annotate e.g. PDFs, too. That would be neat.

Yes, I agree :100: I also have some other plans for how we could make PDF workflows easier, especially with mixed text-based / image-based + OCR requirements. Currently focused on Prodigy Teams but should have some time to explore this more deeply soon :blush:

1 Like

That sounds great -- we definitely need both :heart_eyes: