OCR reader in reactjs - reactjs

I am new in reactjs and I have a task in hand. I need to be build and application which is capable to scan a mykad(Malaysian ID card) through camera. Details like name, address, image can be extracted. I googled a bit about open source tesseract but it is not giving me the right information and also some of the informations are misspelled. If anyone can guide me in the right direction.
Eventually I will develop a PWA and deploy in mobiles as well

If you're looking for a free solution, Tesseract.js is your way to go: https://tesseract.projectnaptha.com
You need to be aware that reading data from MyKads will not only require OCR component, but also specifying semantics for the document. Meaning, you'll need to tell tesseract where the name is, where the address is, etc.
Also, tesseract will not be able to detect the document on the image. For this you'll need to use a different tool.
Disclaimer: I'm working at Microblink where we develop commercial OCR products, including one for reading data from IDs. For PWAs we have an JavaScript / TypeScript component which uses WASM to process the IDs. It supports not only MyKads but more than 500 document types in the world.
Github link: https://github.com/BlinkID/blinkid-in-browser

Related

Will CodenameOne ever support saving images and / or files to a place users can access outside the app?

I've read a few threads where this is discussed. Shai's response has always been that files can only be read, but not written into shared locations
Perhaps saving other type of files isn't so simple but shouldn't there be an option for saving pictures in CN1?
I haven't seen the Whatsapp Clone code, but if it truly is a clone shouldn't it have the option to share pictures (and possibly files). Or is it a simple text chat that perhaps shares pictures that can never be saved outside the app?
I also read somewhere (6 months ago) that Shai said that this should be a feature of CameraKit. Does this mean that this feature is in development? If so, that would be great. But having an ETA would also be great to align with our own devs
If it isn't being developed, can I at least know if this is something I can develop natively within CN1?
We expose the full file system so you can write to any place the native App can write to. Native apps don't have write access to the gallery directory and need to explicitly request it to put a file there. This can be accomplished easily in any external cn1lib (e.g. we could do it in camera kit) but haven't done it for camera kit or the whatsapp clone.
AFAIK there's no RFE open on this feature so I can't even tell you if it's assigned to a specific milestone.

How easy is it to convert AMP-HTML to MIP-HTML?

All the documentation for MIP pages seems to be in Chinese so really not sure how it works, however some sources claim it is basically a clone of AMP.
Has anyone got any experience of converting a full AMP build into MIP pages? Is it a case of swapping out like for like code or is it more of a complete rebuild?
It was forked from AMP a long time ago, and has specific components that cater to the China market (e.g. mip-appdl, a component for downloading apps, and supports multiple Android app store download sources).
If you are mostly using basic components and extensions, you might be able to get pretty far by just regex replacing "amp-" with "mip-" and the AMP runtime with "https://c.mipcdn.com/static/v1/mip.js".

Virtual Assistants knowledge

I am studying about artificial intelligence
How did the virtual assistants analyze questions?
Example: when I said "Way from New York City to Washington DC" , va opened google map?
If I would develop that stuff myself I'd probably would use pattern like
If ({a} {linker} {b}) where a and b are in list of cities on map or something related to that and linker is word like "from" or "to" i would run google maps with, also if any of remaining words would signal that it is map related stuff, like "location", "map", "route" and so on...
Just a guess but I think this should work like that
I don't have any idea that which programming language will you prefer to develop this project but I highly recommend Python. It is object-oriented, high level and extensive support libraries. Moreover, I don't know what is your targeted OS for this project, you unfortunately have not specified it and maybe you will choose Android OS(for mobile application you may use Python) so Python may not be a good option for you. But I supposed that you will develop a desktop application so I will propose my opinions under the motivation that you will choose Python to develop this project.
First of all, you can use speech recogition library for speech to text. After getting text from speech, we can jump to next step which is analyzing the questions.
At the present time, deep learning is the state of the art and Tensorflow is the great technology to take advantage of deep learning.
This is an amazing chatbot framework to build a conversational model for your custom chat bot. You should edit this JSON file to create your conversational intents, after the editing JSON file, you can analyze the questions of user (i.e. your program can understand what user said, the program will parse the question and get the location which is requested by user). When you get the location from question, the program can open browser (for example GoogleMaps) via executing an Ubuntu terminal command in Python.
As a summary, when user says "Way from New York City to Washington DC" the program will run respectively;
Get text from user speech
The program will analyze text via trained system and it can understand that what user said
The program can get the destination and current location which is specified by user (many kind of information can get from user request) by using the structure of this JSON[I recommend this way], or may be NLP or using any kind of string operations
The program will start to load Google maps URL via (for example) Ubuntu terminal command for these location information

Export content from an ecommerce site without using the Backend

I have a site that I'm looking to transfer to Volusion. Importing tabled content into Volusion's a breeze, it's getting it tabled that's an issue. The old site has no real ability to export, nor do I know how to get at it's database. I'm thinking there must be some sort of script I can write to take the content from the frontend and download it in some sort of list that I can put into a CSV, and put into Volusion.
www.twincitygreetings.com
Any suggestions? I'm hoping to get in the image directory as well and download all them for upload to the new site.
You are going to need at the very least a file with product code, product name, weight and price.
Looking at the URL you provided it doesn't appear that the products their follow any type of orderly structure where you can target the images folder or products based on a known piece of information like a products code. Unless the back-end has some type of product export function you may have no choice but to recreate it from scratch.
I don't know if you solved this yet or not, but I would suggest scraping the data providing you have the information on the old site currently. This can be done easily using vbscript and excel, or if you aren't very savvy at coding you could look at a piece of software called mozenda. There are a whole variety of methods that can be used to scrape data, all of them pretty easy to learn with a bit of research. Basically you write a script that will crawl your dom and extract the data (to xml works best in my experience)
Hope this helps.

How to scrape logos from websites?

First off, this is not a question about how to scrape websites. I am fully aware of the tools available to me to scrape (css_parser, nokogiri, etc. I'm using Ruby to do the scraping).
This is more of an overarching question on the best possible solution to scrape the logo of a website starting with nothing but a website address.
The two solutions I've begun to create are these:
Use Google AJAX APIs to do an image search that is scoped to the site in question, with the query "logo", and grab the first result. This gets the logo, I'd say, about 30% of the time.
The problem with the above is that Google doesn't really seem to care about CSS image replaced logos (ie. H1 text that is image replaced with the logo). The solution I've tentatively come up with is to pull down all CSS files, scan for url() declarations, and then look for the words header or logo in the file names.
Solution two is problematic because of the many idiosyncrasies of all the people who write CSS for websites. They use Header instead of logo in the file name. Sometimes the file name is random, saying nothing about a logo. Other times, it's just the wrong image.
I realize I might be able to do something with some sort of machine learning, but I'm on a bit of a deadline for a client and need something fairly capable soon.
So with all that said, if anyone has any "out of the box" thinking on this one, I'd love to hear it. If I can create a solution that works well enough, I plan on open-sourcing the library for any other interested parties :)
Thanks!
Check this API by Clearbit. It's super simple to use:
Just send a query to:
https://logo.clearbit.com/[enter-domain-here]
For example:
https://logo.clearbit.com/www.stackoverflow.com
and get back the logo image!
More about it here
I had to find logos for ~10K websites for a previous project and tried the same technique you mentioned of extracting the image with "logo" in the URL. My variation was I loaded each webpage in webkit so that all images were loaded from CSS or JavaScript. This technique gave me logos for ~40% of websites.
Then I considered creating an app like Nick suggested to manually select the logo for the remaining websites, however I realized it was more cost effective to just give these to someone cheap (who I found via Elance) to do the work manually.
So I suggest don't bother solving this properly with a fully technical solution - outsource the manual labour.
Creating an application will definetely help you, but I believe in the end there will some manual work involved. Here's what I would do.
Have your application store in a database a link to all images on a website that are larger than a specified dimension so that you can weed out small icons.
Then you can setup a form to access these results. You may want to setup the database table to store the website url and relationship between the url and image links.
Even if it we're possible to write an application to truly figure out if it was a logo or not seems like it would be a massive amount of code. In the end, it would probably weed out even more than the above, but you have to take into account it could be faster for human to visually parse the results then the time it took for you to write and test the complex code.
Yet another simple way to solve this problem is to get all leaf nodes and get the first
<a><img src="http://example.com/a/file.png" /></a>
you can lookup for projects to get html leaf nodes on the net or use regular expressions to get all html tags.
I used C# console app with HtmlAgilityPack nuget package to scrape logos from over 600+ sites.
Algorithm is that you get all images that have "logo" in url.
The challenges you will face with during such extraction are:
Relative images
Base url is CDN HTTP/HTTPS (if you don't know
protocol before you make a request)
Images have ? or & with query
string at the end
With that things in mind I got approximately 70% of success but some images were not actual logos.

Resources