![]() |
Improves performance on socket multi-threaded servers for object detection - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Improves performance on socket multi-threaded servers for object detection (/thread-34774.html) |
Improves performance on socket multi-threaded servers for object detection - pennant - Aug-31-2021 I'm trying to create an object detection program through a multi-thread socket server. 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? RE: Improves performance on socket multi-threaded servers for object detection - Larz60+ - Aug-31-2021 see: https://python-socketio.readthedocs.io/en/latest/client.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. |