N
N
Nikolai Chuprik2018-09-09 22:02:04
Web development
Nikolai Chuprik, 2018-09-09 22:02:04

Where to perform complex matrix math: in the frontend or in the backend?

There is a task of recognition of images on the image. Without AI and any training there, but simply using the Canny method, the Hough transform, etc. Those. no data other than the image itself is required.
The algorithms operate on bitmaps in large nested (up to 4 levels) loops. So far I have done this analysis on PHP on the server side (middle-class shared hosting). But maybe it will be more cheerful to write on the client side? It is clear that everything depends on the performance of the server and the client PC. But still, what is the right way to do such things? Understanding convention, I will ask: what is faster JS or PHP? In addition, on the server side, such a thing does not scale with increasing loads.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
synapse_people, 2018-09-09
@synapse_people

I would do it on the server, because it will be possible to separate the api separately and not be tied to the browser api, or you can also implement mobile clients, for example...

D
D', 2018-09-10
@Denormalization

A few years ago, the answer would have been unequivocally "On the server".
But now, with the advent of WebGL and all sorts of newfangled things, all this can be done on the client's video card.
Look at TensorFlow.js for example , they just use "complex matrix calculations" on the client.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question