From 6425c5b6d270c73a32a5491c81ad295d2f9c92c2 Mon Sep 17 00:00:00 2001 From: JohnMark Sill Date: Fri, 18 Feb 2022 23:01:53 -0600 Subject: [PATCH] fix: reverted incorrect merge --- frigate/util.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/frigate/util.py b/frigate/util.py index f26ddd554..6a8892a06 100755 --- a/frigate/util.py +++ b/frigate/util.py @@ -623,25 +623,6 @@ def load_labels(path, encoding="utf-8"): else: return {index: line.strip() for index, line in enumerate(lines)} -def load_labels(path, encoding="utf-8"): - """Loads labels from file (with or without index numbers). - Args: - path: path to label file. - encoding: label file encoding. - Returns: - Dictionary mapping indices to labels. - """ - with open(path, "r", encoding=encoding) as f: - lines = f.readlines() - if not lines: - return {} - - if lines[0].split(" ", maxsplit=1)[0].isdigit(): - pairs = [line.split(" ", maxsplit=1) for line in lines] - return {int(index): label.strip() for index, label in pairs} - else: - return {index: line.strip() for index, line in enumerate(lines)} - class FrameManager(ABC): @abstractmethod