Limiting crowd-bounding-box to only one label

0

Hi folks

I am trying to create a template where someone bounds an object in the source image, and then writes a description of the object. For this I want to limit the users to only creating one bounding box. Any way to do this easily using the crowd-bounding-box template? Can not find anything online within the last hour that helps.

Thanks

robosam
已提問 4 年前檢視次數 217 次
2 個答案
0

Hello,

You can add onsubmit validation and show an error message.

This code sample shows how to do it for <crowd-keypoint> https://github.com/aws-samples/amazon-a2i-sample-task-uis/blob/master/images/keypoint-additional-answer-validation.liquid.html

It should be straightforward to re-use that code for <crowd-bounding-box> but please let me know if you get stuck.

Thanks,
Sam

已回答 4 年前
0

Thanks for the response. Your link was really helpful, this is the javascript code I ended up using to achieve what I wanted. I just check if one and only one label is being submitted, otherwise i return an error to the user and prevent them from submitting the hit.

For anyone looking to do this, you also need to add <div id="errorBox"></div> to the top of the crowd-form.

https://gist.github.com/SamBahrami/c1bfbbd85b5fb87befca553c3d18d7cb

robosam
已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南