Removed pyhash dependency (#2170)

* Removed problematic pyhash dependency

* Added CHANGELOG
main
Dmitry Kalinin 6 years ago committed by GitHub
parent ca70941fb4
commit b8346ce3da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed multiple errors which arises when polygon is of length 5 or less (<https://github.com/opencv/cvat/pull/2100>)
- Fixed task creation from PDF (<https://github.com/opencv/cvat/pull/2141>)
- Fixed CVAT format import for frame stepped tasks (<https://github.com/openvinotoolkit/cvat/pull/2151>)
- Fixed unnecessary pyhash dependency (<https://github.com/openvinotoolkit/cvat/pull/2170>)
### Security
-

@ -3,11 +3,10 @@
# SPDX-License-Identifier: MIT
import os.path as osp
from pyhash import murmur3_32
from hashlib import blake2s
from datumaro.cli.util import make_file_name
hasher = murmur3_32()
def get_color_from_index(index):
def get_bit(number, index):
@ -69,7 +68,8 @@ def get_label_color(label_name, label_names):
normalized_name = normalize_label(label_name)
color = predefined.get(normalized_name, None)
offset = hasher(normalized_name) + normalized_names.count(normalized_name)
name_hash = int.from_bytes(blake2s(normalized_name.encode(), digest_size=4).digest(), byteorder="big")
offset = name_hash + normalized_names.count(normalized_name)
if color is None:
color = get_color_from_index(DEFAULT_COLORMAP_CAPACITY + offset)

@ -10,7 +10,6 @@ Pillow==7.2.0
numpy==1.18.5
python-ldap==3.3.1
pytz==2020.1
pyhash==0.9.3
pyunpack==0.2.1
rcssmin==1.0.6
redis==3.5.3

Loading…
Cancel
Save