I want to make pseudo-verification api in python that works with images(ID of a worker). It is supposed to be based on certain patterns in image like(circles squares etc. like in snapchat famous system). How do i run python script whenever image is sent from user using normal html input file form? I mean like user sends photo to server, it runs script in python and gives verdict? Thanks in advance.
I tried looking up problem on the internet. I didn’t find any solutions. It seems like it’s really expensive operation and probably suboptimatl, but neverthelles I want to do it that way.
2
Answers
You could try by setting up a web server using Flask. By using it, you can next handle the file uploads from the HTML form, so, when an image is uploaded you can process it using a Python script to detect patterns like circles and squares.
Finally, you should send the result back to the user.
To resume:
Hope this helps.
You can create that solution, using a combination of PHP+Python, there are several libraries that can operate images to get to a desired result, in case of employee ID verification, the python script should be capable of recognizing what is looking at, for this example let’s there is a colleague in the company and a camera device or similar takes a picture of the ID:
Client side application will require constant read of the camera or a picture, here is the code for a camera and a local saved picture:
Python Bar code reader: (Involving Numpy is a good idea to enhance the cv2 bar code recognition)
Server side application (PHP):
Client side (The user who is visiting your website or webapp):
Result:
To test this, you can install XAMPP or a similar tool to locally run a PHP server and test it offline without cloud or you can use a public hosting compatible with PHP and test it.