mlfoundations / open_clip

An open source implementation of CLIP.
Other
9.29k stars 923 forks source link

What is impact on the image embedding result when the alpha channel is dropped by the converter #801

Closed githubusersel closed 5 months ago

githubusersel commented 6 months ago

Discussed in https://github.com/mlfoundations/open_clip/discussions/800

Originally posted by **githubusersel** January 23, 2024 Hi everyone, - I'm wondering what is the impact on image embedding result when alpha channel dropped by converter? I found that taking screenshots from Mac adds extra alpha channel to the image. Because CLIP model only works with RGB, it needs to be converted. But I don't think there's enough explanation of how it affects the embedding results using the dropped channel. - What's good practice to convert RGBA to RGB? It looks like convert method from Image module was used in ReadMe. Is there more efficient way? ` im = Image.open("cat.jpg").convert("RGB")`