-
Image
(Image from https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg)
-
Prompt
Describe this image.
The image depicts a serene beach scene with a woman and a dog. The woman is sitting on the sand, wearing a plaid shirt and black pants, and appears to be smiling. She is giving a high-five to the dog, which is sitting on the sand next to her. The dog is wearing a colorful harness and appears to be wagging its tail. The background shows the ocean with gentle waves, and the sky is clear with a soft glow, suggesting either sunrise or sunset. The overall atmosphere is peaceful and joyful.
This model requires additional module.
pip install git+https://github.com/huggingface/transformers@21fac7abba2a37fae86106f87fcf9974fd1e3830
Automatically downloads the onnx and prototxt files on the first run. It is necessary to be connected to the Internet while downloading.
For the sample image,
$ python3 qwen2_vl.py
If you want to specify the input image, put the image path after the --input
option.
$ python3 qwen2_vl.py --input IMAGE_PATH --prompt "Describe this image."
$ python3 qwen2_vl.py --input IMAGE_PATH IMAGE_PATH2 --prompt "Identify the similarities between these images."
By adding the --video
option, you can input the video.
$ python3 qwen2_vl.py --video VIDEO_PATH --prompt "Describe this video."
If you want to specify the prompt, put the prompt after the --prompt
option.
$ python3 qwen2_vl.py --prompt PROMPT
Pytorch
ONNX opset=17