mPLUG icon indicating copy to clipboard operation
mPLUG copied to clipboard

which version is damo/mplug_visual-question-answering_coco_large_en used in modelscope? And there is memory leak with pipeline inference...

Open aixiaodewugege opened this issue 1 year ago • 0 comments

Hi, thanks for your work!

I used your model with modelscope, but I didn't find which model size is the default setting in modelscope, I only know is its named mplug_visual-question-answering_coco_large_en.

And I found that there is memory leak with following code.

pipeline_vqa = pipeline(Tasks.visual_question_answering, model=model_id)
for image_path in image_paths:
    count = count + 1
    raw_image = Image.open(image_path).convert('RGB')
    image_list.append(raw_image)
    image_name_list.append(os.path.basename(image_path))
    question = "what is the man doing in the picture?"
    input_vqa = {
        'image': image_path,
        'question': question,
    }

    text = pipeline_vqa(input_vqa)  # {'text': 'talking on phone'}
    text = text['text']
    result_list.append(text)

aixiaodewugege avatar May 10 '23 12:05 aixiaodewugege