Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support input of non three-channel image #1866

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion mmpretrain/models/backbones/poolformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ class PoolFormer(BaseBackbone):
Defaults to ``dict(type='LN2d', eps=1e-6)``.
act_cfg (dict): The config dict for activation between pointwise
convolution. Defaults to ``dict(type='GELU')``.
in_chans (int): The num of channels of input image.
in_patch_size (int): The patch size of input image patch embedding.
Defaults to 7.
in_stride (int): The stride of input image patch embedding.
Expand Down Expand Up @@ -285,6 +286,7 @@ def __init__(self,
pool_size=3,
norm_cfg=dict(type='GN', num_groups=1),
act_cfg=dict(type='GELU'),
in_chans=3,
in_patch_size=7,
in_stride=4,
in_pad=2,
Expand Down Expand Up @@ -320,7 +322,7 @@ def __init__(self,
patch_size=in_patch_size,
stride=in_stride,
padding=in_pad,
in_chans=3,
in_chans=in_chans,
embed_dim=embed_dims[0])

# set the main block in network
Expand Down
Loading