Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

tool_box.hpp 1.2 KB

You have to be logged in to leave a comment. Sign In
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
  1. #ifndef tool_box_hpp
  2. #define tool_box_hpp
  3. #ifndef CPU_ONLY
  4. #define CPU_ONLY
  5. #endif
  6. #include <caffe/caffe.hpp>
  7. #include <map>
  8. #include "bounding_box.hpp"
  9. #include "data_transformer.hpp"
  10. /**
  11. * @Brief: Read the mean RGB values from mean.prototxt and use single
  12. * value for convenience
  13. *
  14. * @param std::string& mean.prototxt
  15. * @param int number of channels
  16. *
  17. * @return A vector of BGR values
  18. */
  19. std::vector<float> SetMean(const std::string&, int);
  20. /**
  21. * @Brief: Since the face extracted by face detection ignoring its hair
  22. * and other important features, which, is essential for gender
  23. * estimation and age estimation.
  24. *
  25. * @param BoundingBox& face bounding box area
  26. * @param int image height
  27. * @param int image width
  28. *
  29. * @return head bounding box area
  30. */
  31. BoundingBox extend_face_to_whole_head(const BoundingBox&, const int, const int);
  32. const int cellsize = 227;
  33. /**
  34. * @Brief: return the most N maximum value in the vector
  35. *
  36. * @param v vector
  37. * @param N the one user choose
  38. *
  39. * @return most N big values index
  40. */
  41. std::vector<int> Argmax(const std::vector<float>& v, int N);
  42. #endif /* tool_box_hpp */
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...