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

fix: Sanitize label name for brushlabel conversion #240

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion 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 All @@ -155,7 +161,7 @@ def save_brush_images_from_annotation(
+ '-by-'
+ email
+ '-'
+ name,
+ sanatized_name,
)
image = layers[name]
logger.debug(f'Save image to {filename}')
Expand Down