microsoft/OmniParser
Image-Text-to-Text
•
Updated
•
11.3k
•
1.35k
infer
function:grid_img = Image.new('RGB', (width * grid_size_x, height * grid_size_y))
for i, img in enumerate(result.images[:num_images]):
grid_img.paste(img, (i % grid_size_x * width, i // grid_size_x * height))
grid_img
is a blank canvas that will hold the images in a grid format.(i % grid_size_x) * width
calculates the x-coordinate.(i // grid_size_x) * height
calculates the y-coordinate.