Doubt: how to use python scripts for web?

Asked

Viewed 135 times

4

I want to make a web application that will read colors in RGB logos and create suggestions of color scales for websites.

The algorithm will be in python, using Opencv.

The client moves the image > the image is read by the algorithm > the server returns the results to the client.

My doubts:

  1. How do I communicate the client side with the algorithm? I really have no idea how to structure this.

  2. How do I include the Opencv module in Python on the server? I installed it on my machine, but I would need to install it on the server as well, right? (Consider the use of AWS)

  • 1

    You can already do the processing locally?

  • 1

    Use a framework like Django or flask, see this minimalist example with flask.

  • Python "out of the box" can’t connect to the Web like that. You can implement a web server with it or you can use a framework, just like @Sidon said. I particularly like Django.

  • Thanks! The example in Flask helps a lot, I will check Django also to see what pleases me most. Regarding the issue of Opencv when I publish the app on the web: how I include the module on the server?

1 answer

2

1 - I would advise you to use some WEB framework like Django, Flask something of the type, so you can program a "website" more easily to upload this image.

2 - Using AWS you can connect via ssh to the machine and install the required packages. It is a good practice to keep your dependencies in a file (Requirements.txt use the Pip Freeze > Requirements.txt command). Heroku for example looks for this file to install the dependencies of your project.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.