Тёмный

Real Time OCR Web App (React, NodeJS, Python and AWS) 

Code Engine
Подписаться 10 тыс.
Просмотров 18 тыс.
50% 1

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 88   
@r4ndomh3ro
@r4ndomh3ro 3 года назад
Thanks for the video. Just one hint for everyone having trouble with CORS towards the end: You need to "Enable CORS" on your OCR resource at the API gateway (like it was done during the initial API setup) and deploy the API again. You don't need the CORS plugin then.
@CodeEngine
@CodeEngine 3 года назад
You are very welcome! I am glad that you liked the video:) Best Siamak
@kenling1580
@kenling1580 4 года назад
This is nice video that you can learned, react, nodejs, python, aws's lambda, s3, api gateway etc... it's so much fun...
@CodeEngine
@CodeEngine 4 года назад
Hi Ken, Thanks for watching the video! I am glad that you enjoyed the video:) Best Siamak
@findingyou6905
@findingyou6905 4 года назад
Keep uploading man Great Work
@CodeEngine
@CodeEngine 4 года назад
Thank you for watching !
@tinypandas
@tinypandas 4 года назад
wow excellent work!! thank you so much for your efforts and time.
@CodeEngine
@CodeEngine 4 года назад
Hi Kams, Thank you! You are very welcome :) I am glad that you liked it. Best Siamak
@chidokaemeka8177
@chidokaemeka8177 3 года назад
Thank you so much...grateful
@CodeEngine
@CodeEngine 3 года назад
You are welcome! I am glad that you liked it Best Siamak
@equestriaquetzal854
@equestriaquetzal854 4 года назад
thank you very much for the excellent tutorial this is helping me a lot, although I have a question about how I could save the values ​​in a dynamodb table?
@CodeEngine
@CodeEngine 4 года назад
You are very welcome !! I am glad that it was helpful :) You need to make an API call (put request) and have your API gateway call a lambda function. You can use the following NodeJS lambda function. Please update the fields as needed. I hope this helps. Best Siamak 'use strict'; var querystring = require('querystring'); var AWS = require('aws-sdk'),documentClient = new AWS.DynamoDB.DocumentClient(); exports.writeInvoice = function(event, context, callback){ const params = querystring.parse(event.body); var record = { Item : { "Invoice" : params['Invoice'], "Amount" : params['Amount'], "Date" : params['Date'], "Id": params['Id'], "Vendor" : params['Vendor'], "Company" : params['Company'], "Description" : params['Description'] }, TableName : "myTable" }; documentClient.put(record, function(err, data){ callback(err, data); }); } Also Update the handler to : index.writeInvoice
@dileep2448
@dileep2448 3 года назад
very nice. But reg ex is a tricky part. It wont fit for all type of bills , need to tune this.
@CodeEngine
@CodeEngine 3 года назад
Hi Dileep, Thanks for watching the video. Yes that is correct. This can be commercialized after some adjustments and enhancements. This is just a POC :) Best Siamak
@creedon89
@creedon89 4 года назад
Hey! Thanks for the upload. Its really good to have some AWS dev videos for newbies. I have a question and a suggestion. Const UID is giving me an error saying "The const modifier can only be used in Typescript files". Any idea whats going on? Do i need typescript for this application? Two suggestions: 1) The video quality isnt great. Its super hard to see the code sometimes and the recording doesnt fill out the entire view screen of youtube. Also, the code in github has errors and spelling mistakes which aren't there in the actual video.
@creedon89
@creedon89 4 года назад
When i cloned your repo, it appears that const UID, var data, await fetch are all nested within async getFiles. Is this correct? Where I am stuck is at 1 hour 13 mins
@CodeEngine
@CodeEngine 4 года назад
Hi Richard, You are very welcome! Thanks for watching the video and I appreciate your feedback. UID belongs to the class. The error message tells me that you have the variable outside of a block. Please double check the code blocks. same with data, it belongs to the class. I hope this helps. Best Siamak
@creedon89
@creedon89 4 года назад
@@CodeEngine Thanks for the reply Siamak. I never actually comment on RU-vid videos for help, but noticed you replied to others so said I would try. Its much appreciated! Im not sure what exactly you mean by "belongs to the class". Do you mean to say it should not be nested within async getFiles? I have nested UID, data and await fetch within the getFiles block and it is now working for me. I am able to upload the image to s3 through this. However. "this.state.files[0].base64" did not work for me. This did. "this.state.files.base64" . Again, not sure if this is correct or not and will cause me issues later, but for now it is working. Please let me know if you think this is okay. Cheers Richard
@CodeEngine
@CodeEngine 4 года назад
Hi Richard, You are very welcome! I am glad to hear that you were able to get the project working. Sorry if my reply wasn't clear. It is definitely okay to use nested blocks as long as you have the proper opening and closing parenthesis. The reason I said "they belong to the class" is because of the scope of the variable. When you create a class and create a variable within the class you can use that variable anywhere inside the class. When you put the variable inside another block basically you are reducing the scope/visibility of that variable. There is no right or wrong answer to this situation you just need to think how your data is accessible in your component. I hope this helps Best Siamak
@creedon89
@creedon89 4 года назад
@@CodeEngine It does. Thanks very much Siamak!
@shahmirjadoon1322
@shahmirjadoon1322 4 года назад
Awesome tutorial, great explanation. Will you kindly inform, where did you place your AWS credentials inside React application? you use .env file?
@CodeEngine
@CodeEngine 4 года назад
Hi Shahmir, Thank you! I am glad that you liked it:) Yes you can store the secrets in .env file. Best Siamak
@shahmirjadoon1322
@shahmirjadoon1322 4 года назад
@@CodeEngine Please don't stop making such awesome videos. You are really a GEM
@CodeEngine
@CodeEngine 4 года назад
Thank you for your support Shahmir! I won't stop making videos as I enjoy sharing knowledge with others. Stay tuned! Best Siamak
@SniperGhost
@SniperGhost 3 года назад
The problem for me is, textract synchronous service doesn't support pdf
@creedon89
@creedon89 4 года назад
Hey Siamak. I have two design questions if you dont mind. Why did you choose node.js for the s3 lambda function and python for the textract function? Also, why did you have the api call begin on document upload rather than have a submit button? Cheers
@creedon89
@creedon89 4 года назад
One other thing aswell, why does it only allow for png/jpg and not pdf documents? Can pdf not be handled by textract?
@CodeEngine
@CodeEngine 4 года назад
Hi Richard, Thanks for watching the video! Great questions! Nodejs is faster than Python and it is a good candidate for uploading files (Node uses Chrome's V8 engine) but you can use Python as well. You can process the file after clicking the submit button however the idea is to upload the file and get the result instead of typing the numbers in the form and then save the invoice. I hope this helps Best Siamak
@CodeEngine
@CodeEngine 4 года назад
Hi Richard, You can process pdf files but you need to add the following method : textract.get_document_text_detection() For production you need to have a second Lambda function that processes your pdf files (you can detect the file extension in your react app) Best Siamak
@kamalalways
@kamalalways 3 года назад
Should it not return key value pairs for the label and value like Amount will be the label and its value will be the dollar amount. That way we don't have to use regular expression to extract the label and its value that we are trying to map on the UI fields.
@mekkaouinassim316
@mekkaouinassim316 3 года назад
Hi, thanks for the video. When i upload the image, i see precessing written above but the fields are always. The extraction doesn't work for me. What could be the problem please?!
@CodeEngine
@CodeEngine 3 года назад
Hi Mekkaoui, You are welcome! Thanks for watching the video. What do you see in your web browser console? You can go to the developer mode in Chrome and confirm that you are getting a proper response. You can also add a few console.log() statements to your code and print the values to the console. I hope this helps Best Siamak
@devaj655
@devaj655 4 года назад
Hi sir I am new in aws Thanks for this video it help me to understand follow also upload the image s3 by lembda... You mentioned in the video for Production we have to use presigned Url to upload in s3. I have one question I am building a chat app need to upload image in s3 and save image with the chat transscripts in ddb. How I can achieve this with this lembda function. can I use this process for production or use presigned url?
@CodeEngine
@CodeEngine 4 года назад
Hello, You are welcome! Yes you can definitely use this method. Presigned URL provides a link for user to upload an object to S3 without having AWS security credentials. Please note that presigned URLs have expiration date. I hope this helps Best Siamak
@devaj655
@devaj655 4 года назад
@@CodeEngine Thank you for your quick responce. I am going to use this method on proudction. can you please guid me how to save this image in ddb with user chat trans. and show in trans. real time. thank you so much
@CodeEngine
@CodeEngine 4 года назад
You are welcome! Insert the file name (path on S3), file type and all the information that you want to keep to your DynamoDB table. Basically you keep the file in S3 and metadata in DynamoDB. Best Siamak
@devaj655
@devaj655 4 года назад
@@CodeEngine Thank you so much. meanwhile I checked your other videos. your explaination is clear and awesome. I have one thing whenver you get time please make video on Amazon connect chat. in react. thanks
@CodeEngine
@CodeEngine 4 года назад
You are very welcome:) Thank you! I will add it to the list. Best Siamak
@dimitriosdesmos4699
@dimitriosdesmos4699 4 года назад
Hello, very interesting work.....I am trying to develop an app that reads from the web-browser or from the desktop in real time.. (like a traffic camera works on plates )..I am a python programmer,(intermediate level) any idea how to do this without a camera? Thank you.
@CodeEngine
@CodeEngine 4 года назад
Hi Dimitrios, Thank you! I am glad that you liked the video. Interesting project.. You can take a screenshot of users page using something like pyautogui with Python and then procces it on the fly and store the result in a database. This means you would have to build a data streaming pipeline over http to stream the screenshots with minimum bandwidth required. The second approach is to make a web browser scraper that is running in the background or as a plugin on a browser using beautiful soup in Python. I hope this helps Best Siamak
@itumeleng6729
@itumeleng6729 2 года назад
Hi, Thanks for the awesome video. How can I save the entries in a psql instead of a dynamodb?
@CodeEngine
@CodeEngine 2 года назад
Hi, you need to connect to your database server and insert the record.
@meitoli
@meitoli 2 года назад
Hi! Before diving in. Is this still a valid solution in 2022? I see a lot of comments telling me this has some bugs. Thank you. I know this was a great effort.
@yunus5949
@yunus5949 4 года назад
but this is not real-time OCR. This expression is used when making an OCR process on a video stream, not upload then convert process.
@CodeEngine
@CodeEngine 4 года назад
Thanks for your feedback! Best Siamak
@kunchanapallimanohar9247
@kunchanapallimanohar9247 4 года назад
Hi, Great work man. Can you just give a link of the sample images(invoices) you used. Thank you.
@CodeEngine
@CodeEngine 4 года назад
Hi Kunchanapalli, Thank you for watching the video! I am glad that you liked it :) I just uploaded the sample invoice (Sample.png). Please check the repository : github.com/CodeEngineTechnology/OCR_WebApp Best Siamak
@kunchanapallimanohar9247
@kunchanapallimanohar9247 4 года назад
@@CodeEngineAmazing. I have never seen any creator who replies so promptly. Great work Siamak. Thank you very much.
@CodeEngine
@CodeEngine 4 года назад
You are very welcome Kunchanapalli ! Thank you for your support :) Best Siamak
@kunchanapallimanohar9247
@kunchanapallimanohar9247 4 года назад
@@CodeEngine Hi again Siamak. I am encountering the CORS error on my web browser. I have enabled CORS extension, enabled CORS after building the POST method, and also selected while building the OCR resource. Yet it is throwing an error. I have also done the CORS configuration in the images bucket. The image is being uploaded to the S3 image bucket. Can you please help me out. Thanks :)
@kunchanapallimanohar9247
@kunchanapallimanohar9247 4 года назад
To be precise this is the error I am facing : Access to fetch at 'xxxxx.amazonaws.com/Production/ocr' from origin 'localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
@ajiteshpanda2645
@ajiteshpanda2645 4 года назад
Do the ocr api and hosting on amazon s3 is free ?
@CodeEngine
@CodeEngine 4 года назад
Hi Ajitesh, New customers can analyze up to 1,000 pages per month using the Detect Document Text API and up to 100 pages per month using the Analyze Document API, for the first three months. After that : First 1 million pages is 0.0015 per page ($1.5 per 1,000) I hope this helps Best Siamak
@manasasb536
@manasasb536 3 года назад
can i use firebase instead
@CodeEngine
@CodeEngine 3 года назад
Hi Manasa, Yes of course! Best Siamak
@sameerpatel3201
@sameerpatel3201 4 года назад
Do you have more examples of Bills which we can use for this project?
@CodeEngine
@CodeEngine 4 года назад
Hi Sameer, Unfortunately I don't. You can simply Google "invoice template" and test your app. Best Siamak
@lexuslawn
@lexuslawn 3 года назад
@ Code Engine, do you have any developers that can get this into a production application for me ?
@saikrishnachalavadi
@saikrishnachalavadi 2 года назад
hello siamak. i tried your code and the output text which you have received at 1:49:17 is from the OCR lamda function where you have mentioned "Sample.png" as the file path and not from the image which you have just uploaded. i came to know this after i tried other images and i was just getting the same sample.png output. i have replaced filePath= event to solve this. i want to try this with pdf's, need help.
@sameerpatel3201
@sameerpatel3201 4 года назад
Can i use the AWS services through AWS Educate pack from Student github pack for this project?
@CodeEngine
@CodeEngine 4 года назад
Hi Sameer, Yes you can sign up for AWS Educate and receive up to $100 in AWS Promotional Credit with an AWS Educate Starter Account. I hope this helps. Best Siamak
@sameerpatel3201
@sameerpatel3201 4 года назад
@@CodeEngine Thanks for the quick reply. I am getting the following error when i test the lamda function for OCR. Can you help me out with this error? { "errorMessage": "An error occurred (AccessDeniedException) when calling the DetectDocumentText operation: User: arn:aws:sts: is not authorized to perform: textract:DetectDocumentText with an explicit deny", "errorType": "AccessDeniedException", "stackTrace": [ " File \"/var/task/lambda_function.py\", line 20, in lambda_handler 'Name': documentName ", " File \"/var/runtime/botocore/client.py\", line 316, in _api_call return self._make_api_call(operation_name, kwargs) ", " File \"/var/runtime/botocore/client.py\", line 635, in _make_api_call raise error_class(parsed_response, operation_name) " ] }
@CodeEngine
@CodeEngine 4 года назад
Hi Sameer, Looks like you need to modify the I AM role as your lambda needs permission to make that API call. Best Siamak
@priyeshjain35
@priyeshjain35 4 года назад
Hi, I am new to aws and when in the video at 6:56 you told to configure something but that part is missing in it, the key ganaration can you tell me what we need to do there?
@CodeEngine
@CodeEngine 4 года назад
Hi, Thanks for watching the video! 1) Please download AWS CLI from : aws.amazon.com/cli/ 2) Then create an IAM user in your AWS account and download your access key. 3) at the end open your command prompt and type aws configure I hope this helps Best Siamak
@priyeshjain35
@priyeshjain35 4 года назад
@@CodeEngine Thanks for the immediate response and how did we connect our git repo to aws server?
@CodeEngine
@CodeEngine 4 года назад
You are welcome! please watch my code commit video Best Siamak
@ferbertransactions
@ferbertransactions 2 года назад
hello, love your video, you know your stuff and it shows that you are passionate through your video. The video sparked an idea, and I asked a developer to use your code as a starting point for something i have imagined up but he is claiming it couldnt be used for one reason or another. could you tell me why this could happen?
@CodeEngine
@CodeEngine 2 года назад
Hello, Thank you for watching the video and I am glad that you liked it. What was his reason?
@ferbertransactions
@ferbertransactions 2 года назад
Actually what you had shared with me youtube for that project It's source code not working at all Thats why it's delaying I have created all the project from scratch me: why? Because we can't create mail and subscription module with aws (actually I think we can) But it will too messy For managing software Thats why I have choosed node And aws sdk ** full disclaimer, i am doubting the developer i’m working with not you, i’m just trying to understand since my knowledge in dev is limited
@CodeEngine
@CodeEngine 2 года назад
Thanks for sharing this information. Yes you can pretty much build everythig. Although I am sure your developer is a telented engineer, his skillset might not be the perfect fit for this project. I hope this helps. Best Siamak
@ferbertransactions
@ferbertransactions 2 года назад
@@CodeEngine any recommendations on how i can find someone to work on a project ?
@joaooliveira8601
@joaooliveira8601 4 года назад
read pdf file ?
@CodeEngine
@CodeEngine 4 года назад
Hi Joao, Yes you can read and process pdf files using textract. Please look at the aws documentation. Best Siamak
@infoseppd1023
@infoseppd1023 4 года назад
make video a business developer
@CodeEngine
@CodeEngine 4 года назад
Sure. I will add it to the list ! Best Siamak
Далее
Docker on AWS (Spring Boot, ECS and Docker)
1:31:45
Просмотров 18 тыс.
Women’s Goalkeepers + Men’s 🤯🧤
00:20
Просмотров 1,4 млн
The Problem With Microservices
17:47
Просмотров 434 тыс.
AWS CDK With Typescript (DevOps)
46:08
Просмотров 37 тыс.
Extract Text From Images in Python (OCR)
29:24
Просмотров 282 тыс.
Realtime Chat App in React Native and AWS (Backend) 🔴
3:29:01