man I just want to say thank you, I've learned so much from you and done so many awesome projects I though it would take years for me to see realized. I am about to start college and I hope I get to meet people as passionate and good explaining stuff like you, You have been a real motivation to keep coding and learning, dont stop man , I wish happiness and success to you. Thanks
For anyone still struggling with 'const worker = new TesseractWorker()' is not a constructor. TeseractWorker is depreciated in versions 2+ so we use createWorker() instead. Here is the fix: Replace all forms of TesseractWorker with createWorker() for versions 2.0+ of Tesseract by using npm install tesseract.js@next and npm install tesseract.js-core Install tesseract.js-core link: www.npmjs.com/package/tesseract.js-core Make sure to remove ^ the carrot sign before tesseract.js within the package.json which forces the dependency to be the newest version. Not sure if this step matters but the code below is what you use instead of TesseractWorker() which is depreciated in the 2.0+ versions. SOLUTION: const { createWorker } = require("tesseract.js"); const worker = new createWorker({ logger: m => console.log(m) }); ... rest of backend code in app.js
I subscribed within the first minute itself, The way you teach is funny and we can watch without getting bored. It would be great if you could share the code as well :D
I think you have to do process.env.PROCESS || 5000; because if you are deploying... It will find PORT in env variable and then set it to app.. What you did will always set it to 5000 no matter the env has PORT or not
Amazing tutorial! After poking around with newer Tesseract syntax I got it working wow. If you are stuck, you'd want to search for the documentation on your version of Tesseract.
Hi! I've been trying to make the code work with the current version of Tesseract and I just can't seem to make it work, how did you make it work exactly? Thanks!
Still getting the TesseractWorker is not a constructor on both versions :( Looking for what changed now github.com/naptha/tesseract.js I've been looking at issues about the constructor error on github too. Did you ever figure it out?
Fix: github.com/naptha/tesseract.js/issues/346 I'm on mobile so no correct syntax but Changing to "tesseract.js" : "2.0.0.alpha.13", And tesseract-js-core : 2.0.0-beta.11 ^ Add those to package.json Plain `npm install` for dependant Remove any "^"'s from the package . json so it takes both versions (I think that's how you do it? Someone smarter than me can correct:) ) Changing those in package.json seemed to get the app working. Ily
According to the GitHub repo of tesseract , TesseractWorker has been depreciated and it's alternative is createWorker but it's too not working can any one help me with that ..I am unable to use both the key words also I have tried different versions of tesseract..
use this: --------------------------------------------------------------- const { createWorker } = require("tesseract.js"); const worker = createWorker({}); ------------------------------------------------------------------ i just removed the new keyword that was behind createWorker({})
After I click Convert and it the OCR does it thing and redirects, I'm getting "Cannot GET /download". It doesn't seem to be creating the ocr-result.pdf file. I had to rewrite the worker since the newer version of tesseractjs doesn't like how it's done in the video. const { createWorker } = require('tesseract.js'); // OCR const worker = createWorker({ logger: m => console.log(m), }); app.post('/upload', (request, response) => { upload(request, response, err => { console.log(request.file); fs.readFile(`./uploads/${request.file.originalname}`, (error, data) => { if (error) return console.log('ERROR: ', error); (async () => { await worker.load(); await worker.loadLanguage('eng'); await worker.initialize('eng'); const { data: { text } } = await worker.recognize(data); //console.log(text); response.redirect('/download'); await worker.terminate(); })(); }); }); });
The Google API for OCR worked better for me plus there are some paid ones that are very powerful. I was using them to get results from virtual greyhounds straight from the live stream. :)
I am getting an Error: TypeError: Cannot read property '_malloc' of undefined. How to overcome this error? I am using tesseract: 2.1.4 and using cretaeworker line
I have complex tables in my PDF file, will the text output of the OCR deliver the text content in the same format and representation as in the table cell contents of the PDF
RuntimeError: abort(TypeError: Failed to parse URL from /home/bashar/Desktop/project/ocr/node_modules/tesseract.js-core/tesseract-core.wasm). Build with -s ASSERTIONS=1 for more info.
ComSci would be more theoretical ( covers concepts that are more abstract that IT ) but IT would have less theoretical concepts and I think IT would cover more of the Technology concepts like maybe IT would have more networking and other technology related concepts that may not be as abstract. I think :) but you can google it too.
@@riodacayana7823 I honestly think you would need to decide that for yourself. But in terms of focusing only on programming (with a focus on the theoretical underlying knowledge and concepts to write ad understand software and solve those problems ) Yes, probably CompSci. However, there are so many overlaps and it does not always mean that IT students do not have the experience or knowledge required to do the same thing. CompSci though is less common than IT though ( a lot of people are doing IT but, then again IT and Tech is broad ) and same with CompSci because now there are so many different filed within CompSci( AI, ML, Web Dev, Software , Robotics) and probably many other future related type stuff... I would choice CompSci but I would not turn down or look down on IT too. :) Hope that helps
This video is great, I'm tried to create the proyect but I have this error TypeError: worker.progress is not a function, any idea How I can resolve this issue, Thanks :::?????????:(
This helped me, along the comments of others (do what they say + this) Inside the "fs.readFile(`./uploads/${req.file.originalname}`, (err, test) => {" part of the code, replace everything with (async () => { const worker = createWorker(); await worker.load(); await worker.loadLanguage('eng'); await worker.initialize('eng'); const { data: { text } } = await worker.recognize(image); console.log(text); const { data } = await worker.getPDF('Tesseract OCR Result'); fs.writeFileSync('tesseract-ocr-result.pdf', Buffer.from(data)); console.log('Generate PDF: tesseract-ocr-result.pdf'); await worker.terminate(); })(); replace "image" with whatever you're calling the file in the app.post function's parameters (but don't make it "data") hope this helped
@@paulogodoyp Hi, I have a question. What do you mean by 'changing "image" with whatever you're calling the file in the app.post'? What should I change it to?
@@paulogodoyp I finally realized what you mean, in the line of 'const { data: { text } } = await worker.recognize(image);' we replace the parameter inside function worker.recognize() with `./upload/${req.file.originalname}` so basically it is now const { data: { text } } = await worker.recognize(`./upload/${req.file.originalname}`);' To anyone reading this, please do note to use backtick ` ` instead of apostrophe ' ' when filling in the field in the await worker.recognize() parameter.
Hello, when i'm trying to convert a jpg or npg file, it send me this error: " TypeError: worker.recognize(...).progress is not a function " and localhost didn't send any data Can someone help me ?
Hello my gorgeous friend on the internet
hi
Hello. my. gorgeous. friends. on.. the.. internet..
man I just want to say thank you, I've learned so much from you and done so many awesome projects I though it would take years for me to see realized. I am about to start college and I hope I get to meet people as passionate and good explaining stuff like you, You have been a real motivation to keep coding and learning, dont stop man , I wish happiness and success to you.
Thanks
sooo....... hows college going? just curious
@@naveenarora6467 bad as fuck
For anyone still struggling with 'const worker = new TesseractWorker()' is not a constructor. TeseractWorker is depreciated in versions 2+ so we use createWorker() instead.
Here is the fix:
Replace all forms of TesseractWorker with createWorker() for versions 2.0+ of Tesseract by using npm install tesseract.js@next and npm install tesseract.js-core
Install tesseract.js-core link: www.npmjs.com/package/tesseract.js-core
Make sure to remove ^ the carrot sign before tesseract.js within the package.json which forces the dependency to be the newest version. Not sure if this step matters but the code below is what you use instead of TesseractWorker() which is depreciated in the 2.0+ versions.
SOLUTION:
const { createWorker } = require("tesseract.js");
const worker = new createWorker({
logger: m => console.log(m)
});
... rest of backend code in app.js
wow! what an work it is ......an effortless work from this man
Thank you and Happy anniversary!
You are more than our expectations. Power to Dev Ed.
i think im in love, these are the best tutorials ever
Ed back with the great projects
Edit : just finished your react tutorial series
Fantastic work, man! I love your over 8570 level of humor, by the way!
just make it over 9000 if you had watched dragon ball z when vegeta's scouter explodes and he says the power level is over 9000
@@meteachesprogramming9395 I was hinting to the fact that it's not 9000 just yet, but getting there. :)
Awesome your tutorials are very creative
great tutrl
btw, thumbnail is classy!
Wow, this is so impresive! Great job, and thanks for sharing with us! Cheers!
You have great sponsors. The message was clear. But the project is nice.
orange cucumber raspberries this abbreviation's gonna stay in my mind forever
cool tut as always, keep up the good work :)
You are an amazing teacher.
In new tesseract.js a lots of commands have changes. Please make a update tutorial 🙏🏼🙏🏼
Hey Ed, do what you like, just do it! 0:07
The video is awesome great work
I subscribed within the first minute itself, The way you teach is funny and we can watch without getting bored. It would be great if you could share the code as well :D
😂😂😂 first minute and I love the total randomness
Love your videos
dude ... u are the best
I think you have to do process.env.PROCESS || 5000; because if you are deploying... It will find PORT in env variable and then set it to app.. What you did will always set it to 5000 no matter the env has PORT or not
It depends, if any of you're core dependencies has already defined port, then it will use that else the other defined port
use this code I gave blow instead of -> "new createWorker();"
const { createWorker } = require('tesseract.js');
const worker = createWorker({
});
Thanks, it worked
Such a good and useful tutorial!
Lol the toothpick :) great work
Cannot read properties of undefined (reading 'transfer-encoding') Getting this error 17:05
Coolest Programmer on RUclips 😛🤣😜🤩🤩
Dev Ed you're the best channel for tech and sports!!!
U always get me with the thumbnail😂
Amazing tutorial! After poking around with newer Tesseract syntax I got it working wow. If you are stuck, you'd want to search for the documentation on your version of Tesseract.
Hi! I've been trying to make the code work with the current version of Tesseract and I just can't seem to make it work, how did you make it work exactly? Thanks!
ohhh my gggod thats what im looking for thanks ed your great potato ! :)
Can you make a PWA please!!
PWA is lame. just do native
@@midsummerstation3345 how can i start native i don't have sufficient knowledge of native.
@@mustafaaur4019 learn react-native or svelte-native. It's not that hard
@@mustafaaur4019 Instagram is built on react-native yet the performance is good and it's successful
arigatou sensei !!! 🙏
I like the magic 😂😂😂
Thanks ED!
it will be always port 5000, because it's always true, doesn't it?
Yes, he put it the wrong way around. :-)
Thumbs up for magic trick! Even with funny fail!
I still get the tesseract error not being a object:( after uninstalling and installing the its npm
Same
Still getting the TesseractWorker is not a constructor on both versions :(
Looking for what changed now
github.com/naptha/tesseract.js
I've been looking at issues about the constructor error on github too.
Did you ever figure it out?
Fix:
github.com/naptha/tesseract.js/issues/346
I'm on mobile so no correct syntax but
Changing to "tesseract.js" : "2.0.0.alpha.13",
And
tesseract-js-core : 2.0.0-beta.11
^ Add those to package.json
Plain `npm install` for dependant
Remove any "^"'s from the package . json so it takes both versions (I think that's how you do it? Someone smarter than me can correct:) )
Changing those in package.json seemed to get the app working.
Ily
Awesome Ed it is great:)
I have been looking for this for a long time
Nice video as always Ed ! But how abt my Bar Chart Race tutorial in D3.js 🤔
Just wanted to let you know you are awesome.
Anyone know what his visual studio code theme is? love it
Material Theme Palenight High Contrast
Oceanic Next (dimmed bg)
You the best ! Appreciate dat
According to the GitHub repo of tesseract , TesseractWorker has been depreciated and it's alternative is createWorker but it's too not working can any one help me with that ..I am unable to use both the key words also I have tried different versions of tesseract..
use this:
---------------------------------------------------------------
const { createWorker } = require("tesseract.js");
const worker = createWorker({});
------------------------------------------------------------------
i just removed the new keyword that was behind createWorker({})
Dev that’s really helpful ! Can we do this I. App script to execute in google sheet?
Which theme u are using??
Can you do a flutter app next?
Something which you would like to use daily, like the anti-nail-biting hand detection project that you did.
watch thenetninja flutter tutorials
@@AmineAmine-qw4xx Not asking for a tutorial. Some complex but useful UI and backend desgin.
Nice work bro .. Please always continue to make more videos to develop tools :)
Hey bruv!....Worker.progress throws an error "worker.progress is not a function".Any solution? And also for worker.then
Hey Ed, Which theme of visual studio you use?
Pleeeeease make a Bootstrap Tutorial!!!! And also first to comment!!!! 😁😁 Love your videos, keep it up! Edit : Looks like I was not first 🙁
NO
After I click Convert and it the OCR does it thing and redirects, I'm getting "Cannot GET /download". It doesn't seem to be creating the ocr-result.pdf file. I had to rewrite the worker since the newer version of tesseractjs doesn't like how it's done in the video.
const { createWorker } = require('tesseract.js'); // OCR
const worker = createWorker({
logger: m => console.log(m),
});
app.post('/upload', (request, response) => {
upload(request, response, err => {
console.log(request.file);
fs.readFile(`./uploads/${request.file.originalname}`, (error, data) => {
if (error) return console.log('ERROR: ', error);
(async () => {
await worker.load();
await worker.loadLanguage('eng');
await worker.initialize('eng');
const { data: { text } } = await worker.recognize(data);
//console.log(text);
response.redirect('/download');
await worker.terminate();
})();
});
});
});
yeah same error
super!!🤩
The Google API for OCR worked better for me plus there are some paid ones that are very powerful. I was using them to get results from virtual greyhounds straight from the live stream. :)
I challenge you to create a photoshop-style app (online in javascript), where we can do small manipulations on images and save them.
can you put a link for this project?
Can we extract text from scanned PDF(PDF of images) using OCR?
Instead of using saved image can we use camera of device to dynamically convert image to text?
How do you remember all of this?
You'd probably run rings around people who have been doing this for 10 years.
strong grasp on fundamentals, planning and preparations beforehand, googling when running into problems
Good prep on anything. Especially when you're on camera
He also is looking off to the side and retyping stuff.
@@DF999 Yeah I think these guys prepare a draft version and then retype it and add in some stuff to spice it up a bit.
Brad Traversy in his channel once said that mostly his tutorials are scripted and well prepared. That's what good tutor does
Nice work bro. Can you pls create passport scanner app. Which scans the passport and extract all the information.
Came for the magic trick, stayed for the tutorial..
Ed, can you share the code with us please ?🙃
please build like more small vanilla js app.. Thank you for all ur work Big fan from India
when i click to convert, its pointing this error:
"TypeError: Cannot read property '_malloc' of undefined"
I am getting an Error: TypeError: Cannot read property '_malloc' of undefined. How to overcome this error? I am using tesseract: 2.1.4 and using cretaeworker line
Is there any better reason to make some OCR tool on TensorFlow and Python that talks to a web app?
"Organge, Cucumbers, and Raspberries" hahaha
I have complex tables in my PDF file, will the text output of the OCR deliver the text content in the same format and representation as in the table cell contents of the PDF
which tesseract version to install
Hello can you make a video on search with node js
Is it possible to get only the first name and last name on the ID card?
Hi, will it work even the image has dot matrix characters ?
Which theme you used for vs code
Meat and the potatoes!! lol🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣
This is so fucking cool.
Buen video wey!
Hi bro, can you tell me, best way to extract text from invoice, please do reply, it will help me lot
Can you make a video about wordpress for beginners and even with some web development knowlegde!
RuntimeError: abort(TypeError: Failed to parse URL from /home/bashar/Desktop/project/ocr/node_modules/tesseract.js-core/tesseract-core.wasm). Build with -s ASSERTIONS=1 for more info.
i got the same thing, any fix?
do you msybe know of anything similar which also works for handwriting?
TypeError: worker.recognize(...).progress is not a function
solution please
I have the same error.
Hey i fixed it by replacing the
*
worker
.recognize(data, "eng")
.progress(progress => {
console.log(progress);
})
.then(result => {
res.send(result.text);
})
.finally(() => worker.terminate());
*
with:
*
(async () => {
await worker.load();
await worker.loadLanguage('eng');
await worker.initialize('eng');
const { data: { text } } = await worker.recognize(data);
console.log(text);
await worker.terminate();
res.send(text);
})();
*
(Just remove the * they are just there to distinguish different parts)
@@enemyyellow8979 I used your code but I got this error: UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'load' of undefined.
Can anyone tell me the course where I can learn whole express , like file uploads, videos.
thank you. can we hv the source code plz?
Please make a deploying app tutorial :)
Can someone explain to me what is the difference between ComSci and IT?
ComSci would be more theoretical ( covers concepts that are more abstract that IT ) but IT would have less theoretical concepts and I think IT would cover more of the Technology concepts like maybe IT would have more networking and other technology related concepts that may not be as abstract. I think :) but you can google it too.
@@JORDIFUNGULA if I want to focus more on programming, I should choose ComSci?
@@riodacayana7823 I honestly think you would need to decide that for yourself. But in terms of focusing only on programming (with a focus on the theoretical underlying knowledge and concepts to write ad understand software and solve those problems ) Yes, probably CompSci. However, there are so many overlaps and it does not always mean that IT students do not have the experience or knowledge required to do the same thing. CompSci though is less common than IT though ( a lot of people are doing IT but, then again IT and Tech is broad ) and same with CompSci because now there are so many different filed within CompSci( AI, ML, Web Dev, Software , Robotics) and probably many other future related type stuff... I would choice CompSci but I would not turn down or look down on IT too. :)
Hope that helps
It helps a lot thanks
I am getting an error when i am using pdf file to ocr...
Error. Tesseract can't recognize pdf file
constructor error. This solved the issue ->
const worker = createWorker({
logger: m => console.log(m)
});
More magic tricks Daddy
Cucumbers 🤣
i come for the magic tricks 0:42
Kanye stop touching my hard disk.
Where is the source code of this OCR app?
Hi, I got an error: TypeError: TesseractWorker is not a constructor. Does anybody know how to fix this?
Thanks
I tried this and it worked:
const Tesseract = require('tesseract.js')
const worker = Tesseract.createWorker({
logger: m => console.log(m)
});
@@iqaznili Thanks bro!!
what kind of syntax is const upload= multer({storage:storage}) ? (i don 't get what does the storage:storage do)
thanks you if you will reply
You set the property "storage" of the object to the previously defined variable "storage", while here they have the same name its not necessary
This video is great, I'm tried to create the proyect but I have this error TypeError: worker.progress is not a function, any idea How I can resolve this issue, Thanks
:::?????????:(
This helped me, along the comments of others (do what they say + this)
Inside the "fs.readFile(`./uploads/${req.file.originalname}`, (err, test) => {" part of the code, replace everything with
(async () => {
const worker = createWorker();
await worker.load();
await worker.loadLanguage('eng');
await worker.initialize('eng');
const { data: { text } } = await worker.recognize(image);
console.log(text);
const { data } = await worker.getPDF('Tesseract OCR Result');
fs.writeFileSync('tesseract-ocr-result.pdf', Buffer.from(data));
console.log('Generate PDF: tesseract-ocr-result.pdf');
await worker.terminate();
})();
replace "image" with whatever you're calling the file in the app.post function's parameters (but don't make it "data")
hope this helped
@@paulogodoyp Hi, I have a question. What do you mean by 'changing "image" with whatever you're calling the file in the app.post'? What should I change it to?
@@paulogodoyp I finally realized what you mean, in the line of 'const { data: { text } } = await worker.recognize(image);'
we replace the parameter inside function worker.recognize() with `./upload/${req.file.originalname}`
so basically it is now const { data: { text } } = await worker.recognize(`./upload/${req.file.originalname}`);'
To anyone reading this, please do note to use backtick ` ` instead of apostrophe ' ' when filling in the field in the await worker.recognize() parameter.
How to make this web app on online? What webhosting sites should i use
try deploy using heroku
Hello, when i'm trying to convert a jpg or npg file, it send me this error: " TypeError: worker.recognize(...).progress is not a function " and localhost didn't send any data
Can someone help me ?
could you solve it?
im having the same error
.