Git Product home page Git Product logo

fix-labelbox-polyline-exports's Introduction

A Script to help fix polyline image segmentation annotations exported from www.labelbox.com

Labelbox is a popular and easy to use tool to make the labelling process streamlined across teams. My team was annotating certain images where we were drawing lines over roads in satellite images. When exporting these annotations from labelbox, we found that instead of leaving the roads as just lines with a specific thickness, labelbox's service exported them as closed figues.
explain
The script labelbox_generate_masks.py solves this issue.

Note: You need to export your segmentations using the JSON option in the export UI on labelbox's website to get this to work.

Requirements

Matplotlib
Numpy
OpenCV
Skimage
Pylab
Os
Sys
Json

Usage:

Usage: $python labelbox_generate_masks.py annotation_file image_output_dir mask_output_dir element_name width_of_roads_in_pixels

Defaults :
annotation_file = 'latest.json' (Name of the exported JSON file from labelbox)
image_output_dir = 'Images' (Directory to output Images downloaded from labelbox)
mask_output_dir = 'Masks' (Directory to output generated masks in png format)
element_name = 'Roads' (Name of the element corresponding to which the annotations are to be generated - this has to be exactly the same as the name of the element setup on labelbox)
width_of_roads_in_pixels = 25 (Since the masks generated will only have lines, we need to specify their width)

Example:

python labelbox_generate_masks.py ann_file.json Img_output_dir Masks_output_dir 'Roads' 30

This will download all the images from labelbox and generate their corresponding annotations in the specified folders.

fix-labelbox-polyline-exports's People

Contributors

akashpalrecha avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.