From 00281b790ee176ab6af2cea81ad89d34e9f0c107 Mon Sep 17 00:00:00 2001 From: ROY ABITBOL Date: Wed, 20 Dec 2023 10:40:58 +0200 Subject: [PATCH 1/2] Fix deprecated textsize in ImageDraw --- cocoviewer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cocoviewer.py b/cocoviewer.py index 470a4be..4332ec4 100644 --- a/cocoviewer.py +++ b/cocoviewer.py @@ -180,7 +180,9 @@ def draw_bboxes(draw, objects, labels, obj_categories, ignore, width, label_size # TODO: Implement notification message as popup window font = ImageFont.load_default() - tw, th = draw.textsize(text, font) + # use pillow==9.5.0 + tw, th = font.getsize(text) + tx0 = b[0] ty0 = b[1] - th From 054c0ddb5a798b7e248e7ce055104a9786332a70 Mon Sep 17 00:00:00 2001 From: ROY ABITBOL Date: Mon, 15 Jan 2024 16:19:31 +0200 Subject: [PATCH 2/2] removed mask by default --- .gitignore | 4 +++- cocoviewer.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 08bd8aa..9914aa1 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,6 @@ coverage.xml dmypy.json # IDEA config files -.idea/ \ No newline at end of file +.idea/ + +.vscode/ \ No newline at end of file diff --git a/cocoviewer.py b/cocoviewer.py index 4332ec4..e8537a4 100644 --- a/cocoviewer.py +++ b/cocoviewer.py @@ -536,7 +536,7 @@ def __init__(self, data, root, image_panel, statusbar, menu, objects_panel, slid self.labels_on_global = tk.BooleanVar() # Toggles category labels self.labels_on_global.set(True) self.masks_on_global = tk.BooleanVar() # Toggles masks globally - self.masks_on_global.set(True) + self.masks_on_global.set(False) self.coloring_on_global = tk.BooleanVar() # Toggles objects/categories coloring self.coloring_on_global.set(False) # False for categories (defaults), True for objects # Menu Configuration