def textract_detect_text(textract_client, filename: str, bucket_name: str) -> dict:
    """Takes a filename of s3 image object.
    Tries to return response from AWS Textract detect_document_text API on the image str
    See docs for more: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/textract.html#Textract.Client.detect_document_text  # noqa: E501

    Args:
        filename (str): s3 path to image

    Returns:
        dict: List of text detections, geometry of the detections, and metadata
    """
    response = textract_client.detect_document_text(
        Document={
            "S3Object": {
                "Bucket": bucket_name,
                "Name": filename,
            }
        }
    )
    return response