finalproject / utils /face_labeling.py
jarondon82's picture
Fix numpy array truth value error by redirecting face_labeling.py to simplified version
e6cd628
"""
Face labeling module (DEPRECATED).
This module has been replaced by simple_face_labeling.py.
All functionality is redirected to the new module for backwards compatibility.
"""
import streamlit as st
import numpy as np
from typing import Dict, Any, List, Tuple
# Redirect to the new module
from utils.simple_face_labeling import simple_face_detection_and_labeling_ui
# Keep the function name for backwards compatibility
def show_face_detection_and_labeling_ui(image: np.ndarray, face_service: Any) -> Dict[str, Any]:
"""
Redirects to the simplified version.
Args:
image: Image in numpy array format (RGB)
face_service: Face detection service
Returns:
Dictionary with processed results
"""
return simple_face_detection_and_labeling_ui(image, face_service)
# For backwards compatibility, any other functions that might be imported elsewhere
def draw_face_rectangles(*args, **kwargs):
"""Deprecated function"""
st.warning("Using deprecated face_labeling.py module. Please update your imports.")
return None
def extract_face_thumbnails(*args, **kwargs):
"""Deprecated function"""
st.warning("Using deprecated face_labeling.py module. Please update your imports.")
return {}
def prepare_faces_for_analysis(image, selection_result):
"""
Deprecated function - Fixed to avoid the numpy array truth value error
"""
st.warning("Using deprecated face_labeling.py module. Please update your imports.")
# Just return an empty result to avoid errors
return {"faces_to_analyze": []}