P
P
ptvalx2020-10-15 11:17:56
Flask
ptvalx, 2020-10-15 11:17:56

How to do dynamic image segmentation with Tensorflow and Socket.IO?

Why do I need dynamic segmentation?
If I just run a Python script, it will take 7 seconds to initialize the neural network model, which is unacceptable.

It is necessary to make sure that the model of this network constantly hangs in memory and when data arrives for segmentation, it immediately loads the necessary weights and gives the result.

I tried to do this: in one script, the model is initialized and the Socket.IO (Flask) server is started. In the "connect" event, weights are loaded and segmentation takes place.
Due to the fact that Flask works asynchronously , incomprehensible errors from the neuron come out.

How to implement this task correctly? Will it work through streams? I watched how to make threads in python, I was a little shocked. In Sishka or Pascal, everything is easier.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
ptvalx, 2020-10-15
@ptvalx

I will do a data existence poll for segmentation in a loop with a slip and that's it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question