Working with pre-annotations

Learn how to work with pre-annotations by acquiring a fundamental understanding of project configuration. The subsequent example demonstrates the process of uploading pre-annotations for image annotation. This procedure remains consistent across all project types. JSON structures and custom code are provided for each project type.

  1. Configure project metadata as instructed in the setup document. Click NEXT.

  1. In the Task Design tab, field MediaUrl of type “Image” is added by default. To store our pre-annotations add another field JsonData of type “Text”. Add necessary output fields.

  1. Once the rest of the project configuration is done, go to Advanced > Project Task > Custom code > On load. Add the following code, click on SAVE.

if(currentUserLevel === 1) { let inputJsonData = JSON.parse(inputValues["JsonData"]) let x = JSON.stringify(inputJsonData); this.updateAnnotations(x); }
  1. Create an input file containing two fields MediaURL and JsonData . The field JsonData should have the JSON data containing pre-annotations. The JSON structure is as follows. Import it as a dataset.

[ { "id": "e1c6b909-5533-4207-b3dd-7c58deb25620", "label": [ "Eyes" ], "shape": "rectangle", "points": [ //Co-ordinates for bounding box points X1Y1,X1Y2,X2Y2,X2Y1 [ 0.5665601469237833, 0.44077134986225897 ], [ 0.6820606060606061, 0.44077134986225897 ], [ 0.6820606060606061, 0.54178145087236 ], [ 0.5665601469237833, 0.54178145087236 ] ], "notes": "", "attributes": { "Colour": [ "Hazel" ] }, "imageWidth": 1000, "imageHeight": 662 }, { "id": "a1e40daf-5beb-434b-ac13-62edaff3e132", "label": [ "Nose" ], "shape": "rectangle", "points": [ [ 0.45957024793388435, 0.5252525252525253 ], [ 0.5957392102846649, 0.5252525252525253 ], [ 0.5957392102846649, 0.6685032139577594 ], [ 0.45957024793388435, 0.6685032139577594 ] ], "notes": "", "attributes": { }, "imageWidth": 1000, "imageHeight": 662 } ]
  1. Follow the same procedure for all types of projects to upload pre-annotations.

  2. For Audio pre-annotation, use the same custom code as Image pre-annotation. The JSON structure for audio pre-annotation:

[ { "id": 1, "curTime": 0, "endTime": 1.3003174603174585, "startTime": 0, "UistartTime": 0, "UiendTime": 1.3003174603174585, "split": 0, "audiourl": "", "pos": 0, "transliterationData": [ { "word": "Plenty", "tags": [ ], "languageTag": "", "editedText": "" } ] }, { "id": 2, "curTime": 0, "endTime": 2.171065759637184, "startTime": 1.3003174603174585, "UistartTime": 1.3003174603174585, "UiendTime": 2.171065759637184, "split": 0, "audiourl": "", "pos": 0, "transliterationData": [ { "word": "Good", "tags": [ ], "languageTag": "", "editedText": "" } ] } ]
  1. NER pre-annotation.

Custom code :

JSON structure :

 

  1. For pre-annotation in Segmentation, use the same custom code as used for image annotation.

JSON structure :

 

© 2020 Taskmonk Technology Pvt. Ltd. All Rights Reserved .