clarify log message

This commit is contained in:
Josh Hawkins 2025-01-31 13:59:50 -06:00
parent 646c3fb5c4
commit 1b952ae3ba

View File

@ -135,7 +135,7 @@ class PtzMotionEstimator:
try: try:
logger.debug( logger.debug(
f"{camera}: Motion estimator transformation: {self.coord_transformations.rel_to_abs([[0,0]])}" f"{camera}: Motion estimator transformation: {self.coord_transformations.rel_to_abs([[0, 0]])}"
) )
except Exception: except Exception:
pass pass
@ -471,7 +471,7 @@ class PtzAutoTracker:
self.onvif.get_camera_status(camera) self.onvif.get_camera_status(camera)
logger.info( logger.info(
f"Calibration for {camera} in progress: {round((step/num_steps)*100)}% complete" f"Calibration for {camera} in progress: {round((step / num_steps) * 100)}% complete"
) )
self.calibrating[camera] = False self.calibrating[camera] = False
@ -515,7 +515,9 @@ class PtzAutoTracker:
) )
if not coefficients_valid: if not coefficients_valid:
logger.warning(f"{camera}: Autotracking calibration failed") logger.warning(
f"{camera}: Autotracking calibration failed. See the Frigate documentation."
)
return False return False
# If coefficients are valid, proceed with updates # If coefficients are valid, proceed with updates
@ -707,7 +709,7 @@ class PtzAutoTracker:
f"{camera}: Predicted movement time: {self._predict_movement_time(camera, pan, tilt)}" f"{camera}: Predicted movement time: {self._predict_movement_time(camera, pan, tilt)}"
) )
logger.debug( logger.debug(
f"{camera}: Actual movement time: {self.ptz_metrics[camera].stop_time.value-self.ptz_metrics[camera].start_time.value}" f"{camera}: Actual movement time: {self.ptz_metrics[camera].stop_time.value - self.ptz_metrics[camera].start_time.value}"
) )
# save metrics for better estimate calculations # save metrics for better estimate calculations
@ -1000,10 +1002,10 @@ class PtzAutoTracker:
logger.debug(f"{camera}: Zoom test: at max zoom: {at_max_zoom}") logger.debug(f"{camera}: Zoom test: at max zoom: {at_max_zoom}")
logger.debug(f"{camera}: Zoom test: at min zoom: {at_min_zoom}") logger.debug(f"{camera}: Zoom test: at min zoom: {at_min_zoom}")
logger.debug( logger.debug(
f'{camera}: Zoom test: zoom in hysteresis limit: {zoom_in_hysteresis} value: {AUTOTRACKING_ZOOM_IN_HYSTERESIS} original: {self.tracked_object_metrics[camera]["original_target_box"]} max: {self.tracked_object_metrics[camera]["max_target_box"]} target: {calculated_target_box if calculated_target_box else self.tracked_object_metrics[camera]["target_box"]}' f"{camera}: Zoom test: zoom in hysteresis limit: {zoom_in_hysteresis} value: {AUTOTRACKING_ZOOM_IN_HYSTERESIS} original: {self.tracked_object_metrics[camera]['original_target_box']} max: {self.tracked_object_metrics[camera]['max_target_box']} target: {calculated_target_box if calculated_target_box else self.tracked_object_metrics[camera]['target_box']}"
) )
logger.debug( logger.debug(
f'{camera}: Zoom test: zoom out hysteresis limit: {zoom_out_hysteresis} value: {AUTOTRACKING_ZOOM_OUT_HYSTERESIS} original: {self.tracked_object_metrics[camera]["original_target_box"]} max: {self.tracked_object_metrics[camera]["max_target_box"]} target: {calculated_target_box if calculated_target_box else self.tracked_object_metrics[camera]["target_box"]}' f"{camera}: Zoom test: zoom out hysteresis limit: {zoom_out_hysteresis} value: {AUTOTRACKING_ZOOM_OUT_HYSTERESIS} original: {self.tracked_object_metrics[camera]['original_target_box']} max: {self.tracked_object_metrics[camera]['max_target_box']} target: {calculated_target_box if calculated_target_box else self.tracked_object_metrics[camera]['target_box']}"
) )
# Zoom in conditions (and) # Zoom in conditions (and)
@ -1086,7 +1088,7 @@ class PtzAutoTracker:
pan = ((centroid_x / camera_width) - 0.5) * 2 pan = ((centroid_x / camera_width) - 0.5) * 2
tilt = (0.5 - (centroid_y / camera_height)) * 2 tilt = (0.5 - (centroid_y / camera_height)) * 2
logger.debug(f'{camera}: Original box: {obj.obj_data["box"]}') logger.debug(f"{camera}: Original box: {obj.obj_data['box']}")
logger.debug(f"{camera}: Predicted box: {tuple(predicted_box)}") logger.debug(f"{camera}: Predicted box: {tuple(predicted_box)}")
logger.debug( logger.debug(
f"{camera}: Velocity: {tuple(np.round(average_velocity).flatten().astype(int))}" f"{camera}: Velocity: {tuple(np.round(average_velocity).flatten().astype(int))}"
@ -1196,7 +1198,7 @@ class PtzAutoTracker:
) )
zoom = (ratio - 1) / (ratio + 1) zoom = (ratio - 1) / (ratio + 1)
logger.debug( logger.debug(
f'{camera}: limit: {self.tracked_object_metrics[camera]["max_target_box"]}, ratio: {ratio} zoom calculation: {zoom}' f"{camera}: limit: {self.tracked_object_metrics[camera]['max_target_box']}, ratio: {ratio} zoom calculation: {zoom}"
) )
if not result: if not result:
# zoom out with special condition if zooming out because of velocity, edges, etc. # zoom out with special condition if zooming out because of velocity, edges, etc.