0

I trained a deep learning-based detection network to detect and locate some objects. I also trained a deep learning-based classification network to classify the color of the detected objects. Now I want to combine these two networks to detect the object and also classify color. I have some problems with combining these two networks and running them together. How do I call classification while running detection?

They are in two different frameworks: the classifier is based on the Keras and TensorFlow backend, the detection is based on opencv DNN module.

nikki
  • 365
  • 4
  • 20
  • which framework are you using, `tensorflow` or `pytorch` (or something else?). Can you provide some code of what you have already tried? – Frederik Bode Jun 24 '20 at 07:09
  • the classifier is based on the Keras and TensorFlow backend, the detection is based on DNN module. – nikki Jun 24 '20 at 07:11

1 Answers1

0

I have read your question and from that, I can infer that your classification network takes the input from the output of your first network(object locator). i.e the located object from your first network is passed to the second network which in turn classifies them into different colors. The entire Pipeline you are using seems to be a sequential one. Your best bet is to first supply input to the first network, get its output, apply some trigger to activate the second network, feed the output of the first net into the second net, and lastly get the output of the second net. You can run both of these networks in separate GPUs.

The Trigger that calls the second function can be something as simple as cropping the located object in local storage and have a function running that checks for any changes in the file structure(adding a new file). If this function returns true you can grab that cropped object and run the network with this image as input.

Ishan Dixit
  • 379
  • 1
  • 3
  • 11
  • you are right, but my question is how do I trigger the second network(classifier)? – nikki Jun 24 '20 at 07:17
  • @programmer it could be something as simple as checking whether an object is detected, so an if else test on your first network's output, and if it has indeed been detected, feed in the output to the second network – Ayush Jun 24 '20 at 07:21
  • You can crop the located object in local storage and have a function continue running a function that checks for any changes in the file structure(adding of a new file). If this function return true you can grab that cropped object and run the network with this image as input. – Ishan Dixit Jun 24 '20 at 07:25
  • Might as well accept the answer if you think it to solve your doubt. – Ishan Dixit Jun 30 '20 at 13:51