mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-25 04:26:17 +08:00
Added possibility of getting any intermediate blob with thrifty memory management
This commit is contained in:
committed by
Maksim Shabunin
parent
b18e35793a
commit
aa0d8060de
@@ -119,16 +119,14 @@ int main(int argc, char **argv)
|
||||
//! [Prepare blob]
|
||||
|
||||
//! [Set input blob]
|
||||
net.setBlob(".data", inputBlob); //set the network input
|
||||
net.setInput(inputBlob, "data"); //set the network input
|
||||
//! [Set input blob]
|
||||
|
||||
//! [Make forward pass]
|
||||
net.forward(); //compute output
|
||||
Mat prob = net.forward("prob"); //compute output
|
||||
//! [Make forward pass]
|
||||
|
||||
//! [Gather output]
|
||||
Mat prob = net.getBlob("prob"); //gather output of "prob" layer
|
||||
|
||||
int classId;
|
||||
double classProb;
|
||||
getMaxClass(prob, &classId, &classProb);//find the best class
|
||||
|
||||
Reference in New Issue
Block a user