Blame view

src/VPT/snapshot_analysis/HumanFeatures.cppbk 802 Bytes
e30d6793   Zou XiKun   v0.0.1
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
  #include "HumanFeatures.h"
  #include <iostream>
  #include "sy_errorinfo.h"
  using namespace std;
  
  int human_features_init(void *&handle, char*dbpath, int gpuid)
  {
      hf_param params;
      params.gpuid = gpuid;
      params.mode = DEVICE_GPU;
  //    params.db_path = dbpath;
      if (hf_init(&handle, params) !=0)
      {
          cout << "Init HF Failed!" << endl;
  	return FAILED;
  
      }
      return SUCCESS;
  }
  
  int human_features_process(void * handle,  sy_img * batch_img, int batch_size, hf_result*& result)
  {
      for (int i = 0; i < batch_size; i++)
      {
  	if (batch_img[i].data_ == NULL)
  	    cout << i << " data null" << endl;
      }
      
      hf_feature_batch(handle, batch_img, batch_size, result);
      return SUCCESS;
  }
  
  int human_feature_release(void *& handle)
  {
  	hf_release(&handle);
  	return SUCCESS;
  }