Remove max check on classification objects

This commit is contained in:
Nicolas Mowen 2025-10-21 16:32:21 -06:00
parent 7c0a97520a
commit d9d98f9d3a

View File

@ -35,10 +35,6 @@ except ModuleNotFoundError:
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
MAX_CLASSIFICATION_VERIFICATION_ATTEMPTS = 6
MAX_CLASSIFICATION_ATTEMPTS = 12
class CustomStateClassificationProcessor(RealTimeProcessorApi): class CustomStateClassificationProcessor(RealTimeProcessorApi):
def __init__( def __init__(
self, self,
@ -268,26 +264,6 @@ class CustomObjectClassificationProcessor(RealTimeProcessorApi):
if obj_data["label"] not in self.model_config.object_config.objects: if obj_data["label"] not in self.model_config.object_config.objects:
return return
if (
obj_data["id"] in self.detected_objects
and len(self.detected_objects[obj_data["id"]])
>= MAX_CLASSIFICATION_VERIFICATION_ATTEMPTS
):
# if we are at max attempts after rec and we have a rec
if obj_data.get("sub_label"):
logger.debug(
"Not processing due to hitting max attempts after true recognition."
)
return
# if we don't have a rec and are at max attempts
if (
len(self.detected_objects[obj_data["id"]])
>= MAX_CLASSIFICATION_ATTEMPTS
):
logger.debug("Not processing due to hitting max rec attempts.")
return
now = datetime.datetime.now().timestamp() now = datetime.datetime.now().timestamp()
x, y, x2, y2 = calculate_region( x, y, x2, y2 = calculate_region(
frame.shape, frame.shape,