Skip to content

Latest commit

 

History

History
72 lines (52 loc) · 1.77 KB

README.md

File metadata and controls

72 lines (52 loc) · 1.77 KB

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