Python Forum
Improves performance on socket multi-threaded servers for object detection
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Improves performance on socket multi-threaded servers for object detection
#1
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?

Attached Files

Thumbnail(s)
   
Reply
#2
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using .pb saved model for object detection hobbyist 2 1,170 Aug-03-2022, 05:55 AM
Last Post: hobbyist
  (OpenCV) Help to improve code for object detection and finding center of it saoko 0 1,201 May-14-2022, 05:34 PM
Last Post: saoko
  how to manage crypto trading flooding data from exchange servers Mikeardy 0 1,232 Dec-26-2021, 08:31 PM
Last Post: Mikeardy
  Get return value from a threaded function Reverend_Jim 3 17,033 Mar-12-2021, 03:44 AM
Last Post: Reverend_Jim
  Object detection on ground via the use of geo/sat UAV images hobbyist 2 2,093 Jan-23-2021, 11:57 PM
Last Post: hobbyist
  Performance enhancement fimmu 0 1,611 Feb-12-2020, 02:42 PM
Last Post: fimmu
  object base multi threading maboobelahi93 0 1,427 Jan-29-2020, 11:21 AM
Last Post: maboobelahi93
  How to add audio to Tensorflow Object Detection API? kitkatz 1 2,269 Jan-05-2020, 09:37 AM
Last Post: Larz60+
  Simple mutli-threaded scheduler using sched - stuck Mzarour 2 6,117 Nov-12-2019, 07:44 PM
Last Post: Mzarour
  Create a directory structure across many servers metro17 1 1,743 Nov-05-2019, 03:35 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020