Skip to content

A utility script to convert Run-Length-Encoded Binary Masks from Darwin 2.0 JSON to PNG.

License

Notifications You must be signed in to change notification settings

mukund-ks/RLE-To-PNG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RLE to PNG

A utility script to convert Run-Length-Encoded Binary Masks in Darwin JSON 2.0 from V7 Labs to PNG.

The script must receive a JSON document that complies with the Darwin JSON 2.0 Format. Refer here.

Example

Binary Mask annotated in JSON. See here.

drawing
Binary Mask in PNG Format

Installation

  1. Clone the Repository

    git clone https://github.com/mukund-ks/RLE-To-PNG.git
  2. Move into your local copy of repo

    cd RLE-to-PNG
  3. Setup a Virtual Environment

    python -m venv env
  4. Activate the Virtual Environment

    env/Scripts/activate
  5. Install Dependencies

    pip install -r requirements.txt

Usage

  • Run the 'help' command to see accepted arguments.
python main.py --help
Usage: main.py [OPTIONS]

  Utility script to convert Darwin 2.0 JSON Binary Masks from V7Labs to PNG. The masks should be 
  Run-Length-Encoded and the JSON document should be following the Darwin 2.0 JSON Format.

  Args:     
    mask_dir (str): Mask Directory with Darwin 2.0 JSON files.
    save_dir (str): Saving Directory for PNG Masks.

  Raises:     
    OSError: In the event that provided directory does not exist.

Options:
  -M, --mask-dir TEXT  Directory with Masks as JSON files  [required]
  -S, --save-dir TEXT  Directory to save PNG Masks in  [required]
  --help               Show this message and exit.
  • An example
python main.py --mask-dir Data --save-dir Mask

About

A utility script to convert Run-Length-Encoded Binary Masks from Darwin 2.0 JSON to PNG.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages