urOpinion > /dev/null
05/12/2023, 12:38 PMimport Tesseract from "tesseract.js";
const recognizeText = async () => {
try {
const { data } = await Tesseract.recognize(
"https://tesseract.projectnaptha.com/img/eng_bw.png",
"eng"
);
return data.text;
} catch (err) {
return "Hello world! " + err;
}
};
export default {
async fetch(request, env, ctx) {
const text = await recognizeText();
return new Response(text, {
headers: { "content-type": "text/plain" },
});
},
};
And here is an image of the local dev server.
Thanks in advance for any help!
https://cdn.discordapp.com/attachments/1106561137958453269/1106561138730209290/image.png▾
zegevlier
05/12/2023, 12:44 PMurOpinion > /dev/null
05/12/2023, 1:13 PMDani Foldi
05/12/2023, 1:18 PMurOpinion > /dev/null
05/12/2023, 1:41 PM