You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
  1. #ifndef __CORTEX_DETECTION_LAYER_HEADER__
  2. #define __CORTEX_DETECTION_LAYER_HEADER__
  3. #include "../base/basicLayer.h"
  4. class detectionLayer: public cortexLayer{
  5. private:
  6. //uint32_t m_nClasses;
  7. //uint32_t m_nCoords;
  8. //uint32_t m_nRescore;
  9. //uint32_t m_nSide;
  10. //float m_fCost;
  11. //float m_fNoObjectScale;
  12. //float m_fObjectScale;
  13. //float m_fClassScale;
  14. //float m_fCoordScale;
  15. //bool m_bSoftMax;
  16. //bool m_bSQRT;
  17. //bool m_bForced;
  18. //bool m_bRandom;
  19. //bool m_bRescore;
  20. public:
  21. explicit detectionLayer(bool useGPU = true);
  22. virtual ~detectionLayer();
  23. bool create(uint32_t batch, uint32_t inputs, uint32_t n, uint32_t side, uint32_t classes, uint32_t coords, uint32_t rescore);
  24. virtual void forward(cortexSTATE state);
  25. virtual void backward(cortexSTATE state);
  26. //virtual void update(int batch, float learning_rate, float momentum, float decay);
  27. //virtual void resize(uint32_t w, uint32_t h);
  28. void getDetectionBoxes(uint32_t w, uint32_t h, float thresh, float **probs, cortexBOXLABEL *boxes, bool only_objectness);
  29. uint32_t getBoxesCount(void);
  30. uint32_t getClassesCount(void);
  31. friend class gpuCUDA;
  32. friend class cpuHOST;
  33. friend class cortexLayersFactory;
  34. };
  35. #endif