#ifndef DATA_HPP__ #define DATA_HPP__ #include #include #include #include namespace data { struct Point { float x; float y; float score; Point() : x(0), y(0), score(0) {} Point(float x, float y, float score) : x(x), y(y), score(score) {} Point(const Point& p) : x(p.x), y(p.y), score(p.score) {} Point& operator=(const Point& p) { x = p.x; y = p.y; score = p.score; return *this; } }; struct Box { float left; float top; float right; float bottom; float score; std::string label; // 是否需要二次分类 bool need_classification; std::vector points; Box() : left(0), top(0), right(0), bottom(0), score(0), label(""), need_classification(false) {} Box(float left, float top, float right, float bottom, float score, const std::string& label, bool need_classification = false) : left(left), top(top), right(right), bottom(bottom), score(score), label(label), need_classification(need_classification) {} Box(const Box& b) : left(b.left), top(b.top), right(b.right), bottom(b.bottom), score(b.score), label(b.label), need_classification(b.need_classification), points(b.points) {} Box(const Box&& b) : left(b.left), top(b.top), right(b.right), bottom(b.bottom), score(b.score), label(b.label), need_classification(b.need_classification), points(b.points) {} Box& operator=(const Box& b) { left = b.left; top = b.top; right = b.right; bottom = b.bottom; score = b.score; label = b.label; need_classification = b.need_classification; points = b.points; return *this; } }; using BoxArray = std::vector; } // namespace data #endif // DATA_HPP__