title: Convert an rgb mask image to coco json polygon format
body: <p>I annotated images using PixelAnnotationTool provided here: <a href="https://github.com/abreheret/PixelAnnotationTool" rel="nofollow noreferrer">https://github.com/abreheret/PixelAnnotationTool</a> and using the provided dictionary:</p>
  
  <pre><code>{
      "labels": {
          "unlabeled": {
              "categorie": "void",
              "color": [
                  0,
                  0,
                  0
              ],
              "id": 0,
              "id_categorie": 0,
              "name": "unlabeled"
          },
          "bicycle_motorcycle": {
              "categorie": "bicycle_motorcycle",
              "color": [
                  119,
                  11,
                  32
              ],
              "id": 1,
              "id_categorie": 1,
              "name": "bicycle_motorcycle"
          },
          "bus": {
              "categorie": "bus",
              "color": [
                  102,
                  51,
                  0
              ],
              "id": 2,
              "id_categorie": 2,
              "name": "bus"
          },
  </code></pre>
  
  <p>....
      }</p>
  
  <p>I want to convert these RGB masks into json polygon format so that I can use them in Mask R-CNN. How to do this? </p>