Skip to content

Unconsistent dim in SobelGradients #5176

Description

@KumoLiu

Is your feature request related to a problem? Please describe.
apply_filter is used in SobelGradients to get the gradient map which needs a 'batch' dimension. In SobelGradients, it needs input with shape (batch, channels, H[, W, D]) which may be inconsistent with other post transforms.

Describe the solution you'd like
We may add a temporary batch dimension to the transform to make the transform more consistent, like:

img_ = img_.unsqueeze(0) # adds a batch dim

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions