DaoAI World Inference Client C++ INDUSTRIAL 0.0.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);
35 DAOAI_API InstanceSegmentationResult inference(const std::string& image);
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 Classification final : public Model
50 {
51 public:
52 DAOAI_API Classification(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
53 DAOAI_API ClassificationResult inference(const std::string& image);
54 };
56 {
57 public:
58 DAOAI_API SupervisedDefectSegmentation(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
59 DAOAI_API SupervisedDefectSegmentationResult inference(const std::string& image);
60 };
61#ifdef INDUSTRIAL
62
63 class PresenceChecking final : public Model
64 {
65 public:
66 DAOAI_API PresenceChecking(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
67 DAOAI_API PresenceCheckingResult inference(const std::string& image);
68 };
69
70 class Positioning final : public Model
71 {
72 public:
73 DAOAI_API Positioning(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
74 DAOAI_API PositioningResult inference(const std::string& image);
75 };
76
78 {
79 public:
80 DAOAI_API UnsupervisedDefectSegmentation(const std::filesystem::path& model_file, const DeviceType& device = DeviceType::GPU, const int& device_idx = -1);
81 DAOAI_API UnsupervisedDefectSegmentationResult inference(const std::string& image);
82 };
83#endif // INDUSTRIAL
84 }
85 }
86}
Definition model.h:12
DAOAI_API std::string inference(const std::string &image)
Definition model.cpp:36
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)
Definition model.cpp:9
virtual DAOAI_API ~Model()
Definition model.cpp:48
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)
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 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)
Definition model.cpp:6