fairsenseai.analysis.bias.analyze_image_for_bias¶
- analyze_image_for_bias(image, use_summarizer, progress=<gradio.helpers.Progress object>)[source]¶
- Analyzes an image for bias by extracting text using OCR and by generating image caption. - Parameters:
- image (<module ‘PIL.Image’ from ‘/Users/mukundchettiar/Documents/projects/fairsense/fair-sense-ai/venv/lib/python3.11/site-packages/PIL/Image.py’>) – The input image to analyze for bias. 
- use_summarizer ( - bool) – Whether to use the summarizer to condense the response.
- progress – A callback function to report progress. 
 
- Returns:
- A tuple containing the highlighted text with bias words and the detailed analysis. 
- Return type:
 - Example - >>> image = Image.open("example.jpg") >>> highlighted, analysis = analyze_image_for_bias(image, use_summarizer=True)