Skip to content

Incorrect color conversion in VisualizationDemo #134

Open
@weitanism

Description

@weitanism

The VisualizationDemo converts input image color from BGR to RGB before invoking DefaultPredictor.__call__:

# Convert image from OpenCV BGR format to Matplotlib RGB format.
image = image[:, :, ::-1]

But the DefaultPredictor.__call__ converts the color format again:

if self.input_format == "RGB":
# whether the model expects BGR inputs or RGB
original_image = original_image[:, :, ::-1]

It may cause worse performance compared to the huggingface demo.

Possible related issues: #115

Metadata

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