15 namespace DeepLearning
93#ifndef BUILD_INFERNCE_CLIENT
148#ifndef BUILD_INFERENCE_CLIENT
184#ifndef BUILD_INFERENCE_CLIENT
261 std::shared_ptr<uint8_t[]> data_ptr;
272 Mask(
const Image& image,
const Box& location,
const int& image_height,
const int& image_width);
288 std::vector<Image> image_data;
289 std::vector<Box> locations;
296 Mask(
const std::string& base64_image_data);
297 Mask(
const std::vector<Polygon> polygon_data);
300 std::unique_ptr<std::vector<Polygon>> polygon_data;
301 std::unique_ptr<std::string> base64_image_data;
#define DAOAI_API
Definition API_EXPORT.h:13
DAOAI_API Polygon toPolygon() const
Convert to polygon type considering box angle.
Type type
Definition common.h:181
DAOAI_API std::string toString() const
DAOAI_API float h() const
Bounding box height.
std::vector< float > data
Definition common.h:180
DAOAI_API float x1() const
The x coordinate of top-left corner.
Type
Definition common.h:66
DAOAI_API bool contains(const Box &box) const
Check if this box contains another box.
DAOAI_API float w() const
Bounding box width.
DAOAI_API Box intersect(const Box &box) const
Calculate insection box.
DAOAI_API float area() const
The area of the box.
DAOAI_API float iou(const Box &box) const
Calculate iou with a box.
DAOAI_API Box()
Construct a empty box.
DAOAI_API Box toType(const Type &type) const
Convert to different box type.
friend DAOAI_API std::ostream & operator<<(std::ostream &ss, const Box &box)
DAOAI_API float x2() const
The x coordinate of bottom-right corner.
DAOAI_API Box merge(const Box &box) const
Calculate union box.
DAOAI_API float angle() const
The rotate angle of he bounding box.
DAOAI_API Box(const Point &p1, const Point &p2, const float &angle=NAN)
Construct a box given the top-left and right-bottom points.
DAOAI_API float y2() const
The y coordinate of bottom-right corner.
DAOAI_API Box(const float &a1, const float &a2, const float &a3, const float &a4, const float &angle=NAN, const Type &type=Type::XYXY)
Construct a box given the coordinates of top-left and bottom-right points.
friend DAOAI_API std::stringstream & operator<<(std::stringstream &ss, const Box &box)
DAOAI_API float y1() const
The y coordinate of top-left corner.
DAOAI_API uint8_t * getData() const
Get the data buffer of the image.
DAOAI_API Image()
Default constructor for Image object.
DAOAI_API Image clone() const
Clone the image.
Type type
Definition common.h:258
DAOAI_API Image(const int &image_height, const int &image_width, const Image::Type &type, void *data)
Construct image from data buffer.
Type
Definition common.h:189
DAOAI_API bool empty() const
Check if the image is empty.
DAOAI_API Image toType(const Image::Type &type) const
Convert image to different type.
virtual DAOAI_API ~Image()
DAOAI_API Image(const std::string &file_path)
Construct image from file path.
int height
Definition common.h:257
DAOAI_API void save(const std::string &file_path) const
Save the image to a file.
int width
Definition common.h:257
DAOAI_API Image(const int &image_height, const int &image_width, const Image::Type &type, std::shared_ptr< uint8_t[]> data_ptr)
Construct image from data buffer.
DAOAI_API Mask(const Image &image)
DAOAI_API long long area() const
Mask(const Image &image, const Box &location, const int &image_height, const int &image_width)
int height
Definition common.h:286
DAOAI_API Mask merge(const Mask &mask) const
DAOAI_API std::vector< Polygon > toPolygons() const
DAOAI_API Image toImage() const
int width
Definition common.h:286
DAOAI_API bool empty() const
DAOAI_API Point operator-(const Point &point) const
friend DAOAI_API std::ostream & operator<<(std::ostream &ss, const Point &point)
DAOAI_API Point(const float &x, const float &y, const std::string &label)
std::string label
Definition common.h:42
DAOAI_API Point operator+(const Point &point) const
DAOAI_API Point(const float &x, const float &y, const float &confidence=0, const std::string &label="")
float x
Definition common.h:41
float y
Definition common.h:41
float confidence
Definition common.h:41
DAOAI_API Polygon(const std::vector< Point > &points)
friend DAOAI_API std::stringstream & operator<<(std::stringstream &ss, const Polygon &polygon)
std::vector< Point > points
Definition common.h:58
friend DAOAI_API std::ostream & operator<<(std::ostream &ss, const Polygon &polygon)
DeviceType
Definition common.h:18
DetectionLevel
Definition common.h:23