From cddfcc901433c4ec073bb006f5b068bf36f68d58 Mon Sep 17 00:00:00 2001 From: Waliens Date: Thu, 4 Jun 2020 10:30:34 +0200 Subject: [PATCH 1/2] FIX properly specify mask=True as well in setup_classify when the alpha channel should be downloaded --- cytomine/utilities/software.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cytomine/utilities/software.py b/cytomine/utilities/software.py index e138e58..d825878 100644 --- a/cytomine/utilities/software.py +++ b/cytomine/utilities/software.py @@ -83,6 +83,7 @@ def setup_classify(args, logger, root_path=None, image_folder="images", set_fold zoom_level = args.cytomine_zoom_level base_path = os.path.join(base_path, "zoom_level", str(zoom_level)) if hasattr(args, "cytomine_download_alpha"): + # to download the alphamask as a fourth channel download_alpha = args.cytomine_download_alpha base_path = os.path.join(base_path, "alpha", str(int(download_alpha))) if set_folder is not None: @@ -118,6 +119,7 @@ def setup_classify(args, logger, root_path=None, image_folder="images", set_fold dest_pattern=os.path.join(base_path, dest_pattern), override=True, alpha=download_alpha, + mask=download_alpha, zoom=zoom_level, n_workers=args.n_jobs ) From 0ad60a46adf11678f496dbc7c02c90680d10ef16 Mon Sep 17 00:00:00 2001 From: Waliens Date: Thu, 4 Jun 2020 17:45:53 +0200 Subject: [PATCH 2/2] FIX filtering of annotations with no term --- cytomine/utilities/software.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cytomine/utilities/software.py b/cytomine/utilities/software.py index d825878..7ab631a 100644 --- a/cytomine/utilities/software.py +++ b/cytomine/utilities/software.py @@ -111,7 +111,7 @@ def setup_classify(args, logger, root_path=None, image_folder="images", set_fold ) if 'showTerm' in annot_params and not keep_without_term: - annotations = annotations.filter(lambda a: hasattr(a, '__len__') and len(a.term) > 0) + annotations = annotations.filter(lambda a: hasattr(a.term, '__len__') and len(a.term) > 0) # download annotations logger.abs_update(progress=65, statusComment="Download crops of annotations.")