Supervisely
AboutAPI ReferenceSDK Reference
  • 🤖What's Supervisely
  • 🚀Ecosystem of Supervisely Apps
  • 💡FAQ
  • 📌Getting started
    • How to import
    • How to annotate
    • How to invite team members
    • How to connect agents
    • How to train models
  • 🔁Import and Export
    • Import
      • Overview
      • Import using Web UI
      • Supported annotation formats
        • Images
          • 🤖Supervisely JSON
          • 🤖Supervisely Blob
          • COCO
          • Yolo
          • Pascal VOC
          • Cityscapes
          • Images with PNG masks
          • Links from CSV, TXT and TSV
          • PDF files to images
          • Multiview images
          • Multispectral images
          • Medical 2D images
          • LabelMe
          • LabelStudio
          • Fisheye
          • High Color Depth
        • Videos
          • Supervisely
        • Pointclouds
          • Supervisely
          • .PCD, .PLY, .LAS, .LAZ pointclouds
          • Lyft
          • nuScenes
          • KITTI 3D
        • Pointcloud Episodes
          • Supervisely
          • .PCD, .PLY, .LAS, .LAZ pointclouds
          • Lyft
          • nuScenes
          • KITTI 360
        • Volumes
          • Supervisely
          • .NRRD, .DCM volumes
          • NIfTI
      • Import sample dataset
      • Import into an existing dataset
      • Import using Team Files
      • Import from Cloud
      • Import using API & SDK
      • Import using agent
    • Migrations
      • Roboflow to Supervisely
      • Labelbox to Supervisely
      • V7 to Supervisely
      • CVAT to Supervisely
    • Export
  • 📂Data Organization
    • Core concepts
    • MLOps Workflow
    • Projects
      • Datasets
      • Definitions
      • Collections
    • Team Files
    • Disk usage & Cleanup
    • Quality Assurance & Statistics
      • Practical applications of statistics
    • Operations with Data
      • Data Filtration
        • How to use advanced filters
      • Pipelines
      • Augmentations
      • Splitting data
      • Converting data
        • Convert to COCO
        • Convert to YOLO
        • Convert to Pascal VOC
    • Data Commander
      • Clone Project Meta
  • 📝Labeling
    • Labeling Toolboxes
      • Images
      • Videos 2.0
      • Videos 3.0
      • 3D Point Clouds
      • DICOM
      • Multiview images
      • Fisheye
    • Labeling Tools
      • Navigation & Selection Tools
      • Point Tool
      • Bounding Box (Rectangle) Tool
      • Polyline Tool
      • Polygon Tool
      • Brush Tool
      • Mask Pen Tool
      • Smart Tool
      • Graph (Keypoints) Tool
      • Frame-based tagging
    • Labeling Jobs
      • Labeling Queues
      • Labeling Consensus
      • Labeling Statistics
    • Labeling with AI-Assistance
  • 🤝Collaboration
    • Admin panel
      • Users management
      • Teams management
      • Server disk usage
      • Server trash bin
      • Server cleanup
      • Server stats and errors
    • Teams & workspaces
    • Members
    • Issues
    • Guides & exams
    • Activity log
    • Sharing
  • 🖥️Agents
    • Installation
      • Linux
      • Windows
      • AMI AWS
      • Kubernetes
    • How agents work
    • Restart and delete agents
    • Status and monitoring
    • Storage and cleanup
    • Integration with Docker
  • 🔮Neural Networks
    • Overview
    • Inference & Deployment
      • Overview
      • Supervisely Serving Apps
      • Deploy & Predict with Supervisely SDK
      • Using trained models outside of Supervisely
    • Model Evaluation Benchmark
      • Object Detection
      • Instance Segmentation
      • Semantic Segmentation
      • Custom Benchmark Integration
    • Custom Model Integration
      • Overview
      • Custom Inference
      • Custom Training
    • Legacy
      • Starting with Neural Networks
      • Train custom Neural Networks
      • Run pre-trained models
  • 👔Enterprise Edition
    • Get Supervisely
      • Installation
      • Post-installation
      • Upgrade
      • License Update
    • Kubernetes
      • Overview
      • Installation
      • Connect cluster
    • Advanced Tuning
      • HTTPS
      • Remote Storage
      • Single Sign-On (SSO)
      • CDN
      • Notifications
      • Moving Instance
      • Generating Troubleshoot Archive
      • Storage Cleanup
      • Private Apps
      • Data Folder
      • Firewall
      • HTTP Proxy
      • Offline usage
      • Multi-disk usage
      • Managed Postgres
      • Scalability Tuning
  • 🔧Customization and Integration
    • Supervisely .JSON Format
      • Project Structure
      • Project Meta: Classes, Tags, Settings
      • Tags
      • Objects
      • Single-Image Annotation
      • Single-Video Annotation
      • Point Cloud Episodes
      • Volumes Annotation
    • Developer Portal
    • SDK
    • API
  • 💡Resources
    • Changelog
    • GitHub
    • Blog
    • Ecosystem
Powered by GitBook
On this page
  • Overview
  • Format description
  • Input files structure

Was this helpful?

  1. Import and Export
  2. Import
  3. Supported annotation formats
  4. Images

Images with PNG masks

PreviousCityscapesNextLinks from CSV, TXT and TSV

Last updated 4 months ago

Was this helpful?

Overview

Allows to upload images with annotations in the format of PNG masks. Masks are 3-(1-)channel images containing only pixels that have the same values in all channels, to map pixel masks with the appropriate class app requires obj_class_to_machine_color.json file to match classes and colors, otherwise app won't start. The converter supports both semantic and instance segmentation masks. All data will be uploaded to a single dataset.

Format description

Supported image formats: .jpg, .jpeg, .mpo, .bmp, .png, .webp, .tiff, .tif, .jfif, .avif, .heic, and .heif With annotations: yes Supported annotation format: .png.\

Input files structure

Example data:

Images should be in the folder "img" and masks should be in one (or more) of the following folders below:

  • obj_class_to_machine_color.json - contains class to color mapping.

  • masks_machine - contains semantic segmentation masks. Masks for semantic segmentation should have the same name as the original images (but may have a different extension e.g original image name: cats_1.jpg -> mask name cats_1.png).

  • masks_instance - contains for instance segmentation masks. Masks for instance segmentation must be placed in the subdirectories that have the same name as the original images (but without extension e.g original image name: cats_1.jpg -> subdirectory name cats_1).

Example of obj_class_to_machine_color.json

{
  "dog": [50, 50, 50],
  "cat": [100, 100, 100]
}

Input data structure example:

   📦Drag & Drop
    ┣ 📜obj_class_to_machine_color.json
    ┣ 📂img
    ┃  ┣ 🖼️image_1.jpg
    ┃  ┗ 🖼️image_2.jpg
    ┣ 📂masks_instances
    ┃  ┣ 📂image_1
    ┃  ┃  ┣ 🖼️dog_1.png # <- `dog` class instance mask
    ┃  ┃  ┗ 🖼️dog_2.png
    ┃  ┗ 📂image_2
    ┃     ┣ 🖼️dog_1.png
    ┃     ┗ 🖼️dog_2.png
    ┗ 📂masks_machine
        ┣ 🖼️image_1.png # <- class name for each pixel > 0 must be in the obj_class_to_machine_color.json
        ┗ 🖼️image_2.png

obj_class_to_machine_color.json example:

{
  "Lemon": 170,
  "Kiwi": 85
}

Semantic (machine) masks example

In this configuration example, all pixels in the mask with value equal to 170 will be combined in one Bitmap figure and will be assigned to the class "Lemon" and equal to 85 will be assigned to the class "Kiwi".

Instance masks example

For example we have an image with 2 cats on it placed in img/**cats_1.jpg** directory, and we have instance masks for them placed in mask_instances/**cats_1**/cat_1.png and mask_instances/**cats_1**/cat_2.png. Subdirectories in mask_instances folder define to which original image these masks belong to. Masks names inside these subdirectories define a names of the class. As a result, we will have an image cats_1.jpg with 2 labels cat and cat.

⚠️ Notice: If you just want to import semantic segmentation masks, just drag & drop original images, semantic segmentation masks and obj_class_to_machine_color.json file. Same for instance segmentation masks, you don't have to create all directories if this is unnessecary.

🔁
download ⬇️