InternLM / InternLM-XComposer

InternLM-XComposer2 is a groundbreaking vision-language large model (VLLM) excelling in free-form text-image composition and comprehension.
1.91k stars 120 forks source link

关于多图微调以及推理问题 #315

Open zhangye0402 opened 1 month ago

zhangye0402 commented 1 month ago

感谢分享如此nice的工作,这里我的问题在于多图finetune以及推理方面 问题1:

image

在给出的多图示例中,占位符都是使用\<ImageHere>这个占位符,我的疑问在于,在多张图像输入的情况下,模型能够区分出输入的图像顺序吗? 比如: images = ["./a.png", "./b.png"] image1 = model.encode_img(images[0]) image2 = model.encode_img(images[1]) image = torch.cat((image1, image2), dim=0) query = ""First picture:\<ImageHere>, second picture:\<ImageHere>. Describe the picture 1""" 这种情况下模型总是能区分出我想让他分析的是第几张图像吗?

问题2:"value": "\<ImageHere> \<ImageHere>Please describe these two images in detail." 想请教下从encode后的image到\<ImageHere>占位模型是如何进行处理的呢?这里重复占位符两次,模型是会依次贴上image1以及image2吗?

另外,我想请问模型支持更多的图像输入吗?(比如在我的下游任务中,我需要让其分析6张图像,同时图像的顺序也很重要),如果支持的话,应该使用什么样的方式进行处理呢?全部都torch.cat到一起可以吗? 望不吝赐教!^_^