Downloads · 30 days
0
voxreality/rgb_language_vqa_onnx
rgb_language_vqa_onnx is a machine learning model from voxreality. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
ONNX format of voxreality/rgblanguagevqa model
Downloads · 30 days
0
Access
Public
Updated Apr 29, 2025
Repo size
1.5 GB
Likes
0
Public
Click a slice to open those files.
.onnx1.5 GB · 100%
From the Hugging Face model README
ONNX format of voxreality/rgb_language_vqa model
Model inference example:
import onnxruntime as ort
from transformers import BlipProcessor
import numpy as np
from PIL import Image
# load the ONNX model
onnx_model_path = "models/rgb_language_vqa_onnx/model.onnx"
ort_session = ort.InferenceSession(onnx_model_path,providers=["CPUExecutionProvider"])
# load the processor
model_id = "models/rgb_language_vqa_onnx"
processor = BlipProcessor.from_pretrained(model_id)
# prepare the input image and question
raw_image = Image.open("img1.jpg")
question = "Where is the person?"
# process the inputs using the processor
inputs = processor(raw_image, question, return_tensors="np")
# the input tensors for ONNX
pixel_values = inputs["pixel_values"]
input_ids = inputs["input_ids"]
# run inference on the ONNX model
outputs = ort_session.run(
None,
{
"pixel_values": pixel_values,
"input_ids": input_ids,
}
)
# decode the output
output_ids = outputs[0] # Extract the output (token IDs)
decoded_output = processor.tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(decoded_output)