Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch predictions mode #48

Closed
shashi-netra opened this issue Apr 21, 2022 · 1 comment
Closed

Batch predictions mode #48

shashi-netra opened this issue Apr 21, 2022 · 1 comment

Comments

@shashi-netra
Copy link

shashi-netra commented Apr 21, 2022

hi, thanks very much for this awesome project. Is a batch prediction available. I tried this code and it fails. I couldn't find anything in the samples or documentation for batch mode. Is it on the roadmap, if it's not available now.

ref_labels = [...]
image_files = [os.path.join("test_images",f) for f in os.listdir("test_images")]
images = []
for image_file in image_files:
    images.append(load_image(image_file, image_size=384, device=device))
itm_output = model(images, ref_labels, match_head='itm')

@LiJunnan1992
Copy link
Contributor

Hi, the training and evaluation already operate in batch mode. You need to transform images into pytorch tensors first before giving them to the model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants