Skip to content

SegmentedAdaptiveThreshold in image_processing_engine typo? #1442

Closed
@emmantel

Description

Hello, first time describing a 'bug' (not sure if this is the right place)

In the presidio_image_redactor, image_processing_engine.py, class SegmentedAdaptiveThreshold, preprocess_image(),
line 191,

if isinstance(image, np.ndarray):
            image = self.convert_image_to_array(image)

I believe this should be

if not isinstance(image, np.ndarray):
            image = self.convert_image_to_array(image)

since the point of this line is to convert PIL images to np ndarray and passing in an ndarray will simply return it unchanged. I was getting an error trying to run preprocess_image with a PIL Image as input, but changing that line fixed it. Let me know if I ma misunderstanding something!

Best,
Emma

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions