fix: qwen2.5vl, qwen3vl composite image (#12841)

this change fixes images with an alpha channel by overlaying the image
onto a white background
This commit is contained in:
Michael Yang
2025-10-30 10:33:19 -07:00
committed by GitHub
parent 06b3422d5f
commit d432ade714
2 changed files with 4 additions and 0 deletions

View File

@@ -79,6 +79,8 @@ type Grid struct {
}
func (p *ImageProcessor) ProcessImage(img image.Image) ([]float32, *Grid, error) {
img = imageproc.Composite(img)
origWidth := img.Bounds().Dx()
origHeight := img.Bounds().Dy()

View File

@@ -83,6 +83,8 @@ type Grid struct {
}
func (p *ImageProcessor) ProcessImage(ctx ml.Context, img image.Image) (ml.Tensor, *Grid, error) {
img = imageproc.Composite(img)
origWidth := img.Bounds().Dx()
origHeight := img.Bounds().Dy()