Skip to content

XML annotation format commonly used Imagescope and modyfying color of annotation for every object could be cumbersome. This script helps to change the color of annotation and could be useful to adapt for other task.

Notifications You must be signed in to change notification settings

jjagtap/XML_Annotation_modify_with_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

XML_Annotation_modify_with_Python

XML annotation format commonly used in Imagescope and modyfying the color of annotation for every image could be cumbersome. This script helps to change the color of annotation and could be useful to adapt for other task.

Provide the folder paths:

xml_path= r'xml_folder'
mask_output =r"xml_newoutput"

Provide the label you want to change color for; e.g 'NSG_area2s':
if re.findall(r'Name="NSG_area2s".*LineColor="(\d+)"', line):

Provide the new color for label NSG_area2s; '255' is for red here:

line=re.sub(r'LineColor="(\d+)"',r'LineColor="255"', line)

List of color to choose:
255 and 8388863 for red
0 for black
65535 for yellow
65280 for green
4227327 for Brown

The XML annotation format exmaple is as follows, where 'LineColor' is annotation color. XML

About

XML annotation format commonly used Imagescope and modyfying color of annotation for every object could be cumbersome. This script helps to change the color of annotation and could be useful to adapt for other task.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages