Python Forum

Full Version: Improves performance on socket multi-threaded servers for object detection
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to create an object detection program through a multi-thread socket server.
[Image: attachment.php?aid=1243]
When request a stream to a socket, the server attempts to detect objects from the thread that generated the thread.

When detect an object in a thread, get a slow screen, not a live screen.

The thread performance is not good, so if I use object detection using Subprocess, the performance is good. However, I am worried that GPU memory is increasing according to N requests.

Is it possible to detect images without delay, objects through Socket?
see: https://python-socketio.readthedocs.io/e...lient.html

It explains how to use events to trigger processes which is what you require.
Events can be used to trigger other processes, like your image process.

Rather than using threading, You can use multiprocessing: https://docs.python.org/3/library/multiprocessing.html for concurrent processing,
or asyncio: https://docs.python.org/3/library/asyncio.html.