-1

I have got an object detection which reads an input image and runs the inference then it outputs the classIDs[] (class name) and confidence levels of the detected object confidences[].

moon
  • 11
  • 1
  • 5

1 Answers1

0

In case one has never worked with ZeroMQ,
one may here enjoy to first look at "ZeroMQ Principles in less than Five Seconds"
before diving into further details



Q : Could you please tell me how can I communicate the output ... from deep learning system?

May use a socket.send( pickle.dumps( [ classIDs[i], confidences[i], ] ) )

Both the first O/P-topic creeping comment, posted 15 minutes after this answer did answer the O/P-problem definition (and was deleted later) and also the second O/P-topic creeping comment, posted about an hour after a due answer was in-place, did not change the game :

whatever you try to pass over the ZeroMQ channel has to be SER/DES-handled. If willing to make things complex, ok, it still goes the same way :

socket.send( pickle.dumps( <whateverBLOBneeded> ) )

If starting to have new problems, due to SER/DES-collisions ( as object-instances and Class()-es have so often in attempts to have 'em pickle'd ), feel free to try to salvage the so often Exceptions "vomiting" pickle module with :
import dill as pickle a smarter SER/DES dill module from Mike McKerns
and,
again the rest goes the same way :

socket.send( pickle.dumps( <whateverBLOBneeded> ) )

A bonus part

May rather want to prototype with PUSH/PULL it does not block in a mutual deadlock as all REQ/REP do.

user3666197
  • 1
  • 6
  • 50
  • 92
  • StackOverflow strongly discourages to creep the original problem definition into another question and another ... and similar divergent or tangential moves. There was no such function in the O/P, so nobody on the Earth ( except the not yet published code-author ) can add a word on a feature, tangentially added but after the fair answer was provided. Feel free to open another Question, if having other topics and accept the best answer provided to the O/P original problem formulation. That's fair, isn't it? Btw. this is the Community Rule of Fair and Honest problem definition / problem solution. – user3666197 Feb 19 '20 at 21:05
  • The function : objectClassInference(filename): is introduced for object detection task. Actually I was thinking of introducing a function through this program. So that it can run and provides class name and confidence level as output. I already wrote the object detection part. I thought that would be too much code if I posted it. The detection code is very long. I wanted to define this function properly so that it grabs the output of the detection code and send it to the client. – moon Feb 19 '20 at 21:11
  • can you please look at this post as well? https://stackoverflow.com/questions/60309791/how-do-you-define-function-for-communicating-object-detection-output – moon Feb 19 '20 at 21:54