forked from Github/frigate
Show sub label in debug view when available (#7567)
* Show sub label in debug view if available * Ensure sub label is printable to be used
This commit is contained in:
@@ -4,6 +4,7 @@ import datetime
|
||||
import logging
|
||||
from abc import ABC, abstractmethod
|
||||
from multiprocessing import shared_memory
|
||||
from string import printable
|
||||
from typing import AnyStr, Optional
|
||||
|
||||
import cv2
|
||||
@@ -154,6 +155,11 @@ def draw_box_with_label(
|
||||
)
|
||||
|
||||
|
||||
def is_label_printable(label) -> bool:
|
||||
"""Check if label is printable."""
|
||||
return not bool(set(label) - set(printable))
|
||||
|
||||
|
||||
def calculate_region(frame_shape, xmin, ymin, xmax, ymax, model_size, multiplier=2):
|
||||
# size is the longest edge and divisible by 4
|
||||
size = int((max(xmax - xmin, ymax - ymin) * multiplier) // 4 * 4)
|
||||
|
||||
Reference in New Issue
Block a user