DaoAI World Inference Client Industrial 2.24.7.0
Loading...
Searching...
No Matches
model.h
Go to the documentation of this file.
1#pragma once
2#include "API_EXPORT.h"
3#include "common.h"
4#include "prediction.h"
5#include <filesystem>
6#include "config.h"
7namespace DaoAI
8{
9 namespace DeepLearning
10 {
11 class Model
12 {
13 public:
14 DAOAI_API Model(const std::string& model_type, const std::filesystem::path& model_file_path, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
15 DAOAI_API virtual ~Model();
16
17 DAOAI_API std::string inference(const std::string& image);
18
19 private:
20 std::string model_name;
21 };
22
23 namespace Vision
24 {
25 class ObjectDetection final : public Model
26 {
27 public:
28 DAOAI_API ObjectDetection(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
29 DAOAI_API ObjectDetectionResult inference(const std::string& image);
30 };
31 class InstanceSegmentation final : public Model
32 {
33 public:
34 DAOAI_API InstanceSegmentation(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
36 };
37 class KeypointDetection final : public Model
38 {
39 public:
40 DAOAI_API KeypointDetection(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
41 DAOAI_API KeypointDetectionResult inference(const std::string& image);
42 };
43 class OCR final : public Model
44 {
45 public:
46 DAOAI_API OCR(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
47 DAOAI_API OCRResult inference(const std::string& image);
48 };
49 class SemanticSegmentation final : public Model
50 {
51 public:
52 DAOAI_API SemanticSegmentation(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
54 };
55 class Classification final : public Model
56 {
57 public:
58 DAOAI_API Classification(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
59 DAOAI_API ClassificationResult inference(const std::string& image);
60 };
62 {
63 public:
64 DAOAI_API SupervisedDefectSegmentation(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
66 };
67#ifdef INDUSTRIAL
69 {
70 public:
71 DAOAI_API UnsupervisedDefectSegmentation(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
73 };
74
75 class PresenceChecking final : public Model
76 {
77 public:
78 DAOAI_API PresenceChecking(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
79 DAOAI_API PresenceCheckingResult inference(const std::string& image);
80 };
81
82 class Positioning final : public Model
83 {
84 public:
85 DAOAI_API Positioning(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
86 DAOAI_API PositioningResult inference(const std::string& image);
87 };
88#endif // INDUSTRIAL
89 }
90 }
91}
#define DAOAI_API
Definition API_EXPORT.h:6
Definition model.h:12
DAOAI_API std::string inference(const std::string &image)
virtual DAOAI_API ~Model()
DAOAI_API Model(const std::string &model_type, const std::filesystem::path &model_file_path, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API ClassificationResult inference(const std::string &image)
DAOAI_API Classification(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API InstanceSegmentation(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API InstanceSegmentationResult inference(const std::string &image)
DAOAI_API KeypointDetectionResult inference(const std::string &image)
DAOAI_API KeypointDetection(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API OCR(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API OCRResult inference(const std::string &image)
Definition prediction.h:108
DAOAI_API ObjectDetection(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API ObjectDetectionResult inference(const std::string &image)
DAOAI_API Positioning(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API PositioningResult inference(const std::string &image)
DAOAI_API PresenceChecking(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API PresenceCheckingResult inference(const std::string &image)
DAOAI_API SemanticSegmentationResult inference(const std::string &image)
DAOAI_API SemanticSegmentation(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API SupervisedDefectSegmentation(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API SupervisedDefectSegmentationResult inference(const std::string &image)
DAOAI_API UnsupervisedDefectSegmentation(const std::filesystem::path &model_file, const DeviceType &device=DeviceType::GPU, const int &device_idx=-1)
DAOAI_API UnsupervisedDefectSegmentationResult inference(const std::string &image)
DeviceType
Definition common.h:11
Definition common.h:7