forked from dusty-nv/jetson-inference
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetectNet.cpp
54 lines (37 loc) · 949 Bytes
/
detectNet.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* http://github.com/dusty-nv/jetson-inference
*/
#include "detectNet.h"
#include "cudaMappedMemory.h"
#include "cudaResize.h"
// constructor
detectNet::detectNet()
{
}
// destructor
detectNet::~detectNet()
{
}
// Create
detectNet* detectNet::Create( const char* prototxt, const char* model, const char* mean_binary, const char* input_blob, const char* output_blob )
{
detectNet* net = new detectNet();
if( !net )
return NULL;
if( !net->LoadNetwork(prototxt, model, mean_binary, input_blob, output_blob) )
{
printf("detectNet -- failed to initialize.\n");
return NULL;
}
return net;
}
// Detect
int detectNet::Detect( float* rgba, uint32_t width, uint32_t height, float* confidence )
{
if( !rgba || width == 0 || height == 0 )
{
printf("detectNet::Detect( 0x%p, %u, %u ) -> invalid parameters\n", rgba, width, height);
return -1;
}
return 0;
}