From a77184a176abf21c68fe816bf0dac0238cb1511f Mon Sep 17 00:00:00 2001 From: tzutalin Date: Tue, 24 Oct 2017 11:49:46 +0800 Subject: [PATCH] Update version to 1.5.2 --- HISTORY.rst | 10 ++++++++++ libs/lib.py | 4 +++- setup.cfg | 2 +- setup.py | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index c8270182..07fefde8 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,16 @@ History ======= +1.5.2 (2017-10-24) +------------------ + +* Assig different colors to different lablels + +1.5.1 (2017-9-27) +------------------ + +* Show a autosaving dialog + 1.5.0 (2017-9-14) ------------------ diff --git a/libs/lib.py b/libs/lib.py index a9226b8e..da172dc2 100644 --- a/libs/lib.py +++ b/libs/lib.py @@ -1,4 +1,5 @@ from math import sqrt +from libs.ustr import ustr import hashlib try: from PyQt5.QtGui import * @@ -74,7 +75,8 @@ def fmtShortcut(text): def generateColorByText(text): - hashCode = hash(text) + s = str(ustr(text)) + hashCode = int(hashlib.sha256(s.encode('utf-8')).hexdigest(), 16) r = int((hashCode / 255) % 255) g = int((hashCode / 65025) % 255) b = int((hashCode / 16581375) % 255) diff --git a/setup.cfg b/setup.cfg index 99977cac..d2f80e51 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.5.1 +current_version = 1.5.2 commit = True tag = True diff --git a/setup.py b/setup.py index a1cb4245..7836a679 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ required_packages.append('labelImg') setup( name='labelImg', - version='1.5.1', + version='1.5.2', description="LabelImg is a graphical image annotation tool and label object bounding boxes in images", long_description=readme + '\n\n' + history, author="TzuTa Lin",