Don't send back base64 images to backend

Hi, we are trying to adapt prodigy to our use case.

We are annotating images (bounding boxes) and we have dedicated team for that, those people are working from different parts of the world, so we setup for them secure access to the prodigy instance in the cloud.

The problem that we really like the way, that prodigy sends to frontend images in base64, which makes thing more secure and easier, but we saw also that ones batch of images are annotated it sends all base64 to backend. Not everyone have a good connection at their homes, downloading usually goes smooth, but uploading takes a lot of time.

Currently I can't find a way, how to solve this issue, maybe anyone may help and suggest how to deal with this problem? Is it possible to avoid sending back base64 information?


Hi! This is an interesting requirement and I'm just trying to think of the best solution for this :thinking:

There's one peculiar thing about the manual image annotation UI that you might be able to use to your advantage here: it's canvas-based, and once the value of "image" is loaded, the image is visible and updating the current annotation task won't change that. So in theory, you could just set the value of image to an empty string on the client side, before sending the answer back.

You can test this by enabling JavaScript (e.g. add something like "javascript": "console.log('JS!')" to your prodigy.json) and then typing this into your browser's developer console: window.prodigy.update({ image: '' }). Logging window.prodigy.content shows you the value of the current annotation task that will be sent back to the server – without the base64. Only downside: the "undo" action won't work anymore because once the base64 is gone, it's gone...

The other tricky part is how to automate this... there's no easy way to have an event listener modify a task on the client before it gets sent back and using prodigyupdate will get you stuck in an infinite recursion because the call to .update triggers and update :sweat_smile: You could just use JavaScript to add a button to the UI somewhere that people can click to remove the base64. But that's obviously pretty inconvenient...

That looks like complicated workaround :stuck_out_tongue:

I think that we will end up by putting images somewhere and putting proxy behind them and use urls in prodigy directly, that should be simpler.

Thanks :wink: