Skip to content

Converts instance/class image maps to RGB semantic segmantion maps and vice-versa, using numerical class tags and color labels. And image frames to a video sequence.

Notifications You must be signed in to change notification settings

pradeep-vishnu/Convert-Image-Maps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Convert : Image ⇆ Maps & Image Frames to Video Sequence

Python scripts for converting instance maps/class tags to RGB semantic segmentation maps and vice-versa.

rgb.py: converts instance image maps to RGB segmentation maps.

inst.py: converts RGB segmentation maps to instance image maps.

'color' is a list of color labels for each class numerically arranged w.r.t each class number tag. Modify this in the scripts depending your requirements.

video.py: converts image frames to a video sequence at a specified fps rate.

Install Requirements

Install python packages from requirements.txt

pip install -r requirements.txt

Usage

Instance maps to RGB maps

python rgb.py --path <datapath> --imagewidth <size> --imageheight <size> --savepath <datapath>

RGB Maps to Instance maps

python inst.py --path <datapath> --imagewidth <size> --imageheight <size> --savepath <datapath>

By default, the converted images are saved in './save/' folder and image size is 2048x1024.

Disclaimer: You will not receive the same color masks if you try to convert back and forth. I think it's because the colors are not properly interpreted during this. Feel free to fix this and leave a PR.

Image Frames to Video Sequence

python video.py --path <datapath> --fps <video fps>

Stores as video.avi in the same directory of script.

About

Converts instance/class image maps to RGB semantic segmantion maps and vice-versa, using numerical class tags and color labels. And image frames to a video sequence.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages