From 10e33e5212b799fc0f2a58f1ddc614ec8e79ad57 Mon Sep 17 00:00:00 2001 From: vabt-igd <90448279+vabt-igd@users.noreply.github.com> Date: Mon, 4 Sep 2023 11:42:05 +0200 Subject: [PATCH] Sanatize label name for brushlabel conversion Ensure to replace invalid characters of label names before converting to NumPy array or PNG images. --- label_studio_converter/brush.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/label_studio_converter/brush.py b/label_studio_converter/brush.py index ef097416..34d138c6 100644 --- a/label_studio_converter/brush.py +++ b/label_studio_converter/brush.py @@ -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-'