12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #ifndef DATA_HPP__
- #define DATA_HPP__
- #include <string>
- #include <vector>
- #include <map>
- #include <iostream>
- 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<Point> 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<Box>;
- } // namespace data
- #endif // DATA_HPP__
|