1

I'm currently working on an image segmentation project and I'm using Labelbox to annotate my training/validation sets.

After labelling, the export gives a JSON metadata file.

How can I convert this JSON file into masks ? The idea here is to have pairs of images and masks and then proceed to model training.

EDIT :

The Labelbox export has the following structure :

{"ID":"cko5efll9000f3q66q6lmo8li","DataRow ID":"cko5d5prh1a1p0zr2g493ei01","Labeled Data":"https://storage.labelbox.com/ckj1emgwo05r507348cdvlxt6%2Fd08facf0-ca22-bf92-ee06-f44dedfa9419-IMG_0058.JPG?Expires=1621064170715&KeyName=labelbox-assets-key-3&Signature=UcsOTO8hZtHm68b28IJfS97_vUk","Label":{"objects":[{"featureId":"cko5dewth00023q66csn0vw77","schemaId":"cko5dblu72n2a0yb4hmc98bnf","title":"Car","value":"car","color":"#1CE6FF","instanceURI":"https://api.labelbox.com/masks/feature/cko5dewth00023q66csn0vw77?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJja2oxZW1neGgyMGVhMDcxNnhqMG0yaDNwIiwib3JnYW5pemF0aW9uSWQiOiJja2oxZW1nd28wNXI1MDczNDhjZHZseHQ2IiwiaWF0IjoxNjE5ODU0NTcwLCJleHAiOjE2MjI0NDY1NzB9.sGvl6vuWSTraDWHTerfMIUSuVa8TY1OhJvMT2HDecF8"},{"featureId":"cko5dnd0m00063q66q0k6s223","schemaId":"cko5dblu72n2c0yb4fz9k0tts","title":"Pedestrian","value":"pedestrian","color":"#FF34FF","instanceURI":"https://api.labelbox.com/masks/feature/cko5dnd0m00063q66q0k6s223?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJja2oxZW1neGgyMGVhMDcxNnhqMG0yaDNwIiwib3JnYW5pemF0aW9uSWQiOiJja2oxZW1nd28wNXI1MDczNDhjZHZseHQ2IiwiaWF0IjoxNjE5ODU0NTcwLCJleHAiOjE2MjI0NDY1NzB9.sGvl6vuWSTraDWHTerfMIUSuVa8TY1OhJvMT2HDecF8"},{"featureId":"cko5dwo9e000a3q66cgbsyr7q","schemaId":"cko5dblu82n2e0yb442da8zo7","title":"Road","value":"road","color":"#FF4A46","instanceURI":"https://api.labelbox.com/masks/feature/cko5dwo9e000a3q66cgbsyr7q?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJja2oxZW1neGgyMGVhMDcxNnhqMG0yaDNwIiwib3JnYW5pemF0aW9uSWQiOiJja2oxZW1nd28wNXI1MDczNDhjZHZseHQ2IiwiaWF0IjoxNjE5ODU0NTcwLCJleHAiOjE2MjI0NDY1NzB9.sGvl6vuWSTraDWHTerfMIUSuVa8TY1OhJvMT2HDecF8"},{"featureId":"cko5e3ko8000c3q6685sid1en","schemaId":"cko5dblu82n2i0yb46tiy5vlv","title":"Sidewalk","value":"sidewalk","color":"#006FA6","instanceURI":"https://api.labelbox.com/masks/feature/cko5e3ko8000c3q6685sid1en?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJja2oxZW1neGgyMGVhMDcxNnhqMG0yaDNwIiwib3JnYW5pemF0aW9uSWQiOiJja2oxZW1nd28wNXI1MDczNDhjZHZseHQ2IiwiaWF0IjoxNjE5ODU0NTcwLCJleHAiOjE2MjI0NDY1NzB9.sGvl6vuWSTraDWHTerfMIUSuVa8TY1OhJvMT2HDecF8"}],"classifications":[]},"Created By":"marwanebelkass@gmail.com","Project Name":"Training Dataset for Seg","Created At":"2021-05-01T07:04:05.000Z","Updated At":"2021-05-01T07:04:37.000Z","Seconds to Label":1853.136,"External ID":"IMG_0058.JPG","Agreement":-1,"Benchmark Agreement":-1,"Benchmark ID":null,"Dataset Name":"Training Dataset","Reviews":[],"View Label":"https://editor.labelbox.com?project=cko5d3yk19q000846d9332rlq&label=cko5efll9000f3q66q6lmo8li","Has Open Issues":0}

I want to extract the LabelIDs image so I can have the same dataset structure as CamVid for example.

  • it depends on the format, i.e., how the polygons are saved in the json file. I would expect LabelBox to have a manual for this procedure. – Shai Jun 02 '21 at 05:21
  • Labelbox does not have anything related to converting the JSON file into a LabelIDs image/mask. – Marwane Belkass Jun 03 '21 at 16:36
  • Labelbox has each labelled object saved in a URL. If you copy and paste the URL to your browser, you should see the mask. For example, this link in your case: [https://api.labelbox.com/masks/feature/cko5dnd0m00063q66q0k6s223?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJja2oxZW1neGgyMGVhMDcxNnhqMG0yaDNwIiwib3JnYW5pemF0aW9uSWQiOiJja2oxZW1nd28wNXI1MDczNDhjZHZseHQ2IiwiaWF0IjoxNjE5ODU0NTcwLCJleHAiOjE2MjI0NDY1NzB9.sGvl6vuWSTraDWHTerfMIUSuVa8TY1OhJvMT2HDecF8] is a "Road". You can write a script to export the objects and make the masks in a a way your model needs. – MsLate Feb 02 '22 at 22:19

0 Answers0