[GH-ISSUE #248] Accpetable Size of Images for CLIP #216

Open
opened 2026-10-31 21:12:32 +00:00 by bsakaguchi · 8 comments
Owner

Originally created by @Calmepro777 on GitHub (May 30, 2022).
Original GitHub issue: https://github.com/openai/CLIP/issues/248

I wonder if CLIP accepts image with size smaller than 224 * 224 (e.g. 32 * 32). I noticed that an error regarding matrices dimentions will occur if I use 32 * 32 images as the input of CLIP without modifying the model.

Originally created by @Calmepro777 on GitHub (May 30, 2022). Original GitHub issue: https://github.com/openai/CLIP/issues/248 I wonder if CLIP accepts image with size smaller than 224 * 224 (e.g. 32 * 32). I noticed that an error regarding matrices dimentions will occur if I use 32 * 32 images as the input of CLIP without modifying the model.
Author
Owner

@tillaczel commented on GitHub (May 31, 2022):

Did you find a solution? I am reshaping all images to 224X224, but that seems a bit fishy, especially with the varying aspect ratio.

<!-- gh-comment-id:1142149306 --> @tillaczel commented on GitHub (May 31, 2022): Did you find a solution? I am reshaping all images to 224X224, but that seems a bit fishy, especially with the varying aspect ratio.
Author
Owner

@ntushaar92 commented on GitHub (May 31, 2022):

Just exploring. Still in exploring mode.

Best,
N

Get Outlook for iOShttps://aka.ms/o0ukef


From: Till Aczél @.>
Sent: Tuesday, May 31, 2022 4:39:08 PM
To: openai/CLIP @.
>
Cc: Subscribed @.***>
Subject: Re: [openai/CLIP] Accpetable Size of Images for CLIP (Issue #248)

Did you find a solution? I am reshaping all images to 224X224, but that seems a bit fishy, especially with the varying aspect ratio.

—
Reply to this email directly, view it on GitHubhttps://github.com/openai/CLIP/issues/248#issuecomment-1142149306, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYX372QQQFS4J7BYUITNRETVMYI7ZANCNFSM5XJAC74Q.
You are receiving this because you are subscribed to this thread.Message ID: @.***>

<!-- gh-comment-id:1142365778 --> @ntushaar92 commented on GitHub (May 31, 2022): Just exploring. Still in exploring mode. Best, N Get Outlook for iOS<https://aka.ms/o0ukef> ________________________________ From: Till Aczél ***@***.***> Sent: Tuesday, May 31, 2022 4:39:08 PM To: openai/CLIP ***@***.***> Cc: Subscribed ***@***.***> Subject: Re: [openai/CLIP] Accpetable Size of Images for CLIP (Issue #248) Did you find a solution? I am reshaping all images to 224X224, but that seems a bit fishy, especially with the varying aspect ratio. — Reply to this email directly, view it on GitHub<https://github.com/openai/CLIP/issues/248#issuecomment-1142149306>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AYX372QQQFS4J7BYUITNRETVMYI7ZANCNFSM5XJAC74Q>. You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
Author
Owner

@tillaczel commented on GitHub (May 31, 2022):

I found my mistake, I forgot to preprocess the image

<!-- gh-comment-id:1142691744 --> @tillaczel commented on GitHub (May 31, 2022): I found my mistake, I forgot to preprocess the image
Author
Owner

@Calmepro777 commented on GitHub (Jun 1, 2022):

Did you find a solution? I am reshaping all images to 224X224, but that seems a bit fishy, especially with the varying aspect ratio.
That was how I tackle with images with smaller size. I expect that by slightly modifying the model without retraining, CLIP could take in images with smaller sizes.

<!-- gh-comment-id:1143028583 --> @Calmepro777 commented on GitHub (Jun 1, 2022): > Did you find a solution? I am reshaping all images to 224X224, but that seems a bit fishy, especially with the varying aspect ratio. That was how I tackle with images with smaller size. I expect that by slightly modifying the model without retraining, CLIP could take in images with smaller sizes.
Author
Owner

@alexfilothodoros commented on GitHub (Jun 1, 2022):

I haven't tried it, but probably you would have to pass a different argument to CLIPFeatureExtractor.

https://huggingface.co/docs/transformers/v4.19.2/en/model_doc/clip#transformers.CLIPFeatureExtractor

<!-- gh-comment-id:1143631972 --> @alexfilothodoros commented on GitHub (Jun 1, 2022): I haven't tried it, but probably you would have to pass a different argument to CLIPFeatureExtractor. https://huggingface.co/docs/transformers/v4.19.2/en/model_doc/clip#transformers.CLIPFeatureExtractor
Author
Owner

@gqingc commented on GitHub (Feb 27, 2023):

怎么把图片的分辨率从224改成32,因为我使用的是cifar10的数据集,他这个数据集就是32乘以32的分辨率。

<!-- gh-comment-id:1445702563 --> @gqingc commented on GitHub (Feb 27, 2023): 怎么把图片的分辨率从224改成32,因为我使用的是cifar10的数据集,他这个数据集就是32乘以32的分辨率。
Author
Owner

@Charles-Lu commented on GitHub (Apr 13, 2023):

You should upsample the image to (224, 224). ResNet performs 32x downsampling, and ViT also needs fixed-size input to patchify. So smaller images will cause problems here and there

<!-- gh-comment-id:1507490880 --> @Charles-Lu commented on GitHub (Apr 13, 2023): You should upsample the image to (224, 224). ResNet performs 32x downsampling, and ViT also needs fixed-size input to patchify. So smaller images will cause problems here and there
Author
Owner

@trinh-hoang-hiep commented on GitHub (Apr 11, 2024):

Same problem, my server is too weak to handle 224x224 images

<!-- gh-comment-id:2048842171 --> @trinh-hoang-hiep commented on GitHub (Apr 11, 2024): Same problem, my server is too weak to handle 224x224 images
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openai/CLIP#216
No description provided.