Can you please suggest how to replace this code with OpenCV's darknet implementation ?
Hi , I came across a code which uses custom YoLo model.
argv['LABELS'] = self.LABELS
argv['BATCH_SIZE'] = self.BATCH_SIZE * self.SEQUENCE_LENGTH
argv['IMAGE_H'] = self.IMAGE_H
argv['IMAGE_W'] = self.IMAGE_W
argv['GRID_H'] = self.GRID_H
argv['GRID_W'] = self.GRID_W
self.detector = KerasYOLO(argv)
self.model_detector = Model( inputs=self.detector.model.input[0],
outputs=[ self.detector.model.get_layer('conv_23').output,
self.detector.model.get_layer('conv_feat').output])
Now, I want to replace this self.detector
object with readNetFromDarknet
I could not find out functions, which could replace self.detector.model.input[0]
and self.detector.model.get_layer('<layer_id>').output
All I found out was this documented function [getLayerShapes
]. (https://docs.opencv.org/3.4/db/d30/cl...)
But , I am not able to use it. the functioin getLayerShapes
takes netInputShape
as parameter. How can I get that ?
Can anyone please help ?
Thanks in advance.
believe it or not, it's unclear, where the problem is. you don't understand, which params are needed, and what for ?
what about looking at the python sample ?
Hi @berak , thanks for reply. the functioin
getLayerShapes
takesnetInputShape
as parameter. How can I get that ?hey, you're probably looking at the wrong place in the c++ code (far too deep !)
again, if you're interested in doin that from python, you have to look at the python samples, and functions like
blobFromImage
(for the input) andgetUnconnectedLayers()
for the outputTry OpenCV's object detection sample first.