Update index.js
Browse files
index.js
CHANGED
@@ -118,6 +118,7 @@ export async function imageTextToText(
|
|
118 |
|
119 |
if (vision) {
|
120 |
let image = await RawImage.fromURL(imagePath);
|
|
|
121 |
image = image.rgb().toTensor("CHW").to("float32").div_(255.0);
|
122 |
const pixel_values = image.unsqueeze(0);
|
123 |
|
|
|
118 |
|
119 |
if (vision) {
|
120 |
let image = await RawImage.fromURL(imagePath);
|
121 |
+
image = await image.resize(INPUT_IMAGE_SIZE[0], INPUT_IMAGE_SIZE[1]);
|
122 |
image = image.rgb().toTensor("CHW").to("float32").div_(255.0);
|
123 |
const pixel_values = image.unsqueeze(0);
|
124 |
|