“c387fba08ce8face590793018b9950379120c40e”上不存在“doc/getstarted/build_and_install/index_en.html”
提交 0f30000f 编写于 作者: J jack

add comments in results.h

上级 d8fe85c4
...@@ -20,9 +20,15 @@ ...@@ -20,9 +20,15 @@
namespace PaddleX { namespace PaddleX {
/*
* @brief
* This class represents mask in instance segmentation tasks.
* */
template <class T> template <class T>
struct Mask { struct Mask {
// raw data of mask
std::vector<T> data; std::vector<T> data;
// the shape of mask
std::vector<int> shape; std::vector<int> shape;
void clear() { void clear() {
data.clear(); data.clear();
...@@ -30,19 +36,34 @@ struct Mask { ...@@ -30,19 +36,34 @@ struct Mask {
} }
}; };
/*
* @brief
* This class represents target box in detection or instance segmentation tasks.
* */
struct Box { struct Box {
int category_id; int category_id;
// category label this box belongs to
std::string category; std::string category;
// confidence score
float score; float score;
std::vector<float> coordinate; std::vector<float> coordinate;
Mask<float> mask; Mask<float> mask;
}; };
/*
* @brief
* This class is prediction result based class.
* */
class BaseResult { class BaseResult {
public: public:
// model type
std::string type = "base"; std::string type = "base";
}; };
/*
* @brief
* This class represent classification result.
* */
class ClsResult : public BaseResult { class ClsResult : public BaseResult {
public: public:
int category_id; int category_id;
...@@ -51,17 +72,28 @@ class ClsResult : public BaseResult { ...@@ -51,17 +72,28 @@ class ClsResult : public BaseResult {
std::string type = "cls"; std::string type = "cls";
}; };
/*
* @brief
* This class represent detection or instance segmentation result.
* */
class DetResult : public BaseResult { class DetResult : public BaseResult {
public: public:
// target boxes
std::vector<Box> boxes; std::vector<Box> boxes;
int mask_resolution; int mask_resolution;
std::string type = "det"; std::string type = "det";
void clear() { boxes.clear(); } void clear() { boxes.clear(); }
}; };
/*
* @brief
* This class represent segmentation result.
* */
class SegResult : public BaseResult { class SegResult : public BaseResult {
public: public:
// represent label of each pixel on image matrix
Mask<int64_t> label_map; Mask<int64_t> label_map;
// represent score of each pixel on image matrix
Mask<float> score_map; Mask<float> score_map;
std::string type = "seg"; std::string type = "seg";
void clear() { void clear() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册