Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Sanatize label name for brushlabel conversion
Browse files Browse the repository at this point in the history
Ensure to replace invalid characters of label names before converting to NumPy array or PNG images.
  • Loading branch information
vabt-igd authored Sep 4, 2023
1 parent 84369c3 commit 10e33e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions label_studio_converter/brush.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ def save_brush_images_from_annotation(
) # sanitize filename

for name in layers:
# sanitize label name
sanatized_name = name.replace('/', '-')
sanatized_name = sanatized_name.replace('\\', '-')
sanatized_name = sanatized_name.replace(' ', '-')
sanatized_name = sanatized_name.replace('.', '-')

filename = os.path.join(
out_dir,
'task-'
Expand Down

0 comments on commit 10e33e5

Please sign in to comment.