Skip to content

Add VINO Factory, simplely test passed #294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4961a9e
Merge pull request #234 from huangjiafengx/dev_hjf
LewisLiuPub Sep 23, 2022
7fca4fb
Adding the jenkinsfile for galactic branch
huangjiafengx Sep 23, 2022
ebcdc60
Updating the Jenkinsfile for PR test
huangjiafengx Sep 26, 2022
5cbe980
Merge pull request #235 from huangjiafengx/dev_hjf
LewisLiuPub Sep 26, 2022
4df6af5
Enable environment information for email.
huangjiafengx Sep 29, 2022
472c8d6
Merge pull request #236 from huangjiafengx/dev_hjf_env
LewisLiuPub Sep 29, 2022
65346db
Upgrade Code to support OpenVINO API2.0 (ver 2022.1/2)
fantao015 Nov 16, 2022
3f3a62a
add dockerfile and instruction (#247)
ChloeWu1 Dec 6, 2022
526c61b
Add the pipeline of segmentation_maskrcnn (#249)
ChloeWu1 Dec 6, 2022
3403405
Update ros2 doc for quick start (#248)
ChloeWu1 Dec 6, 2022
00d9a63
fix vehicle attribs and license plate (#252)
fantao015 Dec 13, 2022
53e7200
Enable klocwork checking for Jenkins CI (#250)
huangjiafengx Dec 13, 2022
ccd1aed
Update Documents and related build files (#253)
ChloeWu1 Dec 22, 2022
ea62fa6
Support yolov5n (#256)
ChloeWu1 Dec 31, 2022
3f2a295
Fixing the bug of conflict resources for Jenkins CI (#257)
huangjiafengx Dec 31, 2022
ee8709a
rename package for release
ChloeWu1 Jan 3, 2023
77dedc1
rename to openvino_node
ChloeWu1 Jan 5, 2023
c336e63
disable face reidentification pipeline
ChloeWu1 Feb 6, 2023
69245bf
rename package for release (#258)
ChloeWu1 Feb 14, 2023
b6ddd46
fix merging errors after renaming package.
LewisLiuPub Feb 14, 2023
e98846e
Merge branch 'ChloeWu1-disable_face_reidentification_pipeline' into ros2
LewisLiuPub Feb 14, 2023
fdaeafe
Update the openvino2022.1 to 2022.3 for the docker (#264)
huangjiafengx Feb 15, 2023
065b5f1
Enable GitHub action ci (#267)
huangjiafengx Mar 8, 2023
8e68092
Setting the version for XTestRunner update. (#268)
huangjiafengx Mar 10, 2023
a072b84
Fix segmentation (#269)
LewisLiuPub Mar 10, 2023
94f5111
Use object_msgs instead of openvino_people_msgs (#265)
LewisLiuPub Mar 21, 2023
c1dd0a7
Enable segmentation and yolov5 for github action. (#271)
huangjiafengx Mar 22, 2023
8fab6bc
Update the Document for openvino version (#272)
huangjiafengx Mar 27, 2023
eb31758
fix merge issues master-->ros2
LewisLiuPub Mar 28, 2023
58a51c4
Enable ci for master (#274)
LewisLiuPub Apr 6, 2023
994c2fe
Removing the picture no using. (#277)
huangjiafengx Apr 21, 2023
e70d5f5
Merge pull request #2 from intel/master
Corsair-cxs May 4, 2023
cccf0e2
Merge pull request #3 from intel/ros2
Corsair-cxs May 4, 2023
1c4c957
Modify inference module:
Corsair-cxs May 11, 2023
fdc7518
Modify model module:
Corsair-cxs May 11, 2023
9e743b5
Modify input module:
Corsair-cxs May 11, 2023
9fc56fb
Modify output module:
Corsair-cxs May 11, 2023
52375c2
Add VINO factory, compile pass
Corsair-cxs May 11, 2023
9a4f290
CMake packages generating compile_commands.json
Corsair-cxs May 11, 2023
96c4041
Reg factory worked
Corsair-cxs May 12, 2023
10eb89c
REG_MODEL_TYPE worked
Corsair-cxs May 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions openvino_param_lib/src/param_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ void operator>>(const YAML::Node & node, ParamManager::InferenceRawData & infer)
YAML_PARSE(node, "batch", infer.batch)
YAML_PARSE(node, "confidence_threshold", infer.confidence_threshold)
YAML_PARSE(node, "enable_roi_constraint", infer.enable_roi_constraint)
if (infer.model_type.size() == 0) {
infer.model_type = "SSD";
}
// if (infer.model_type.size() == 0) {
// infer.model_type = "SSD";
// }
slog::info << "Inference Params:name=" << infer.name << slog::endl;
}

Expand Down
1 change: 1 addition & 0 deletions openvino_wrapper_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ project(openvino_wrapper_lib)
## to use C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}")
####################################

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ class AgeGenderDetection : public BaseInference
{
public:
using Result = openvino_wrapper_lib::AgeGenderResult;
AgeGenderDetection();
~AgeGenderDetection() override;
AgeGenderDetection() {};
~AgeGenderDetection() override {};

/**
* @brief Load the age gender detection model.
*/
void loadNetwork(std::shared_ptr<Models::AgeGenderDetectionModel>);
void loadNetwork(const std::shared_ptr<Models::BaseModel>) override;
/**
* @brief Enqueue a frame to this class.
* The frame will be buffered but not infered yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#include <memory>
#include <string>
#include <vector>
#include "openvino_param_lib/param_manager.hpp"
#include "openvino_wrapper_lib/engines/engine.hpp"
#include "openvino_wrapper_lib/engines/engine_manager.hpp"
#include "openvino_wrapper_lib/models/base_model.hpp"
#include "openvino_wrapper_lib/slog.hpp"
#include "openvino/openvino.hpp"
Expand Down Expand Up @@ -93,13 +95,21 @@ class Result
class BaseInference
{
public:
BaseInference();
virtual ~BaseInference();
BaseInference() {};
virtual ~BaseInference() {};

virtual void init(const Params::ParamManager::InferenceRawData &val) {};
/**
* @brief load the Engine instance that contains the request for
* running netwrok on target calculation device.
*/
void loadEngine(std::shared_ptr<Engines::Engine> engine);

/**
* @brief Load the face detection model.
*/
virtual void loadNetwork(const std::shared_ptr<Models::BaseModel>) = 0;

/**
* @brief Get the loaded Engine instance.
* @return The loaded Engine instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ class EmotionsDetection : public BaseInference
{
public:
using Result = openvino_wrapper_lib::EmotionsResult;
EmotionsDetection();
~EmotionsDetection() override;
EmotionsDetection() {};
~EmotionsDetection() override {};
/**
* @brief Load the emotin detection model.
*/
void loadNetwork(std::shared_ptr<Models::EmotionDetectionModel>);
void loadNetwork(const std::shared_ptr<Models::BaseModel>) override;
/**
* @brief Enqueue a frame to this class.
* The frame will be buffered but not infered yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class FaceDetectionResult : public ObjectDetectionResult
class FaceDetection : public ObjectDetection
{
public:
explicit FaceDetection(bool, double);
FaceDetection() : ObjectDetection() {};
~FaceDetection() override {};
};
} // namespace openvino_wrapper_lib
#endif // OPENVINO_WRAPPER_LIB__INFERENCES__FACE_DETECTION_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,18 @@ class FaceReidentification : public BaseInference
{
public:
using Result = openvino_wrapper_lib::FaceReidentificationResult;
explicit FaceReidentification(double);
~FaceReidentification() override;
FaceReidentification() {};
~FaceReidentification() override {};

/**
* @brief initialize params
*/
void init(const Params::ParamManager::InferenceRawData &val) override;

/**
* @brief Load the face reidentification model.
*/
void loadNetwork(std::shared_ptr<Models::FaceReidentificationModel>);
void loadNetwork(const std::shared_ptr<Models::BaseModel>) override;
/**
* @brief Enqueue a frame to this class.
* The frame will be buffered but not infered yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ class HeadPoseDetection : public BaseInference
{
public:
using Result = openvino_wrapper_lib::HeadPoseResult;
HeadPoseDetection();
~HeadPoseDetection() override;
HeadPoseDetection() {};
~HeadPoseDetection() override {};

/**
* @brief Load the headpose detection model.
*/
void loadNetwork(std::shared_ptr<Models::HeadPoseDetectionModel>);
void loadNetwork(const std::shared_ptr<Models::BaseModel>) override;
/**
* @brief Enqueue a frame to this class.
* The frame will be buffered but not infered yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ class LandmarksDetection : public BaseInference
{
public:
using Result = openvino_wrapper_lib::LandmarksDetectionResult;
LandmarksDetection();
~LandmarksDetection() override;
LandmarksDetection() {};
~LandmarksDetection() override {};
/**
* @brief Load the landmarks detection model.
*/
void loadNetwork(std::shared_ptr<Models::LandmarksDetectionModel>);
void loadNetwork(const std::shared_ptr<Models::BaseModel>) override;
/**
* @brief Enqueue a frame to this class.
* The frame will be buffered but not infered yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ class LicensePlateDetection : public BaseInference
{
public:
using Result = openvino_wrapper_lib::LicensePlateDetectionResult;
LicensePlateDetection();
~LicensePlateDetection() override;
LicensePlateDetection() {};
~LicensePlateDetection() override {};
/**
* @brief Load the license plate detection model.
*/
void loadNetwork(std::shared_ptr<Models::LicensePlateDetectionModel>);
void loadNetwork(const std::shared_ptr<Models::BaseModel>) override;
/**
* @brief Enqueue a frame to this class.
* The frame will be buffered but not infered yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ObjectDetectionResult : public Result
return this->confidence_ > s2.confidence_;
}

private:
protected:
std::string label_ = "";
float confidence_ = -1;
};
Expand Down Expand Up @@ -103,7 +103,7 @@ class ObjectDetectionResultFilter : public BaseFilter
*/
std::vector<cv::Rect> getFilteredLocations() override;

private:
protected:
/**
* @brief Decide whether a result is valid for label filter condition.
* @param[in] Result to be decided, filter operator, target label value.
Expand Down Expand Up @@ -142,12 +142,17 @@ class ObjectDetection : public BaseInference
public:
using Result = openvino_wrapper_lib::ObjectDetectionResult;
using Filter = openvino_wrapper_lib::ObjectDetectionResultFilter;
explicit ObjectDetection(bool, double);
~ObjectDetection() override;
ObjectDetection() {};
~ObjectDetection() override {};

/**
* @brief initialize params
*/
void init(const Params::ParamManager::InferenceRawData &val) override;
/**
* @brief Load the face detection model.
*/
void loadNetwork(std::shared_ptr<Models::ObjectDetectionModel>);
void loadNetwork(const std::shared_ptr<Models::BaseModel>) override;
/**
* @brief Enqueue a frame to this class.
* The frame will be buffered but not infered yet.
Expand Down Expand Up @@ -195,7 +200,7 @@ class ObjectDetection : public BaseInference
*/
static double calcIoU(const cv::Rect & box_1, const cv::Rect & box_2);

private:
protected:
std::shared_ptr<Models::ObjectDetectionModel> valid_model_;
std::shared_ptr<Filter> result_filter_;
std::vector<Result> results_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,17 @@ class ObjectSegmentation : public BaseInference
{
public:
using Result = openvino_wrapper_lib::ObjectSegmentationResult;
explicit ObjectSegmentation(double);
~ObjectSegmentation() override;
ObjectSegmentation() {};
~ObjectSegmentation() override {};

/**
* @brief initialize params
*/
void init(const Params::ParamManager::InferenceRawData &val) override;
/**
* @brief Load the object segmentation model.
*/
void loadNetwork(std::shared_ptr<Models::ObjectSegmentationModel>);
void loadNetwork(const std::shared_ptr<Models::BaseModel>) override;
/**
* @brief Enqueue a frame to this class.
* The frame will be buffered but not infered yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,17 @@ class ObjectSegmentationMaskrcnn : public BaseInference
{
public:
using Result = openvino_wrapper_lib::ObjectSegmentationMaskrcnnResult;
explicit ObjectSegmentationMaskrcnn(double);
~ObjectSegmentationMaskrcnn() override;
ObjectSegmentationMaskrcnn() {};
~ObjectSegmentationMaskrcnn() override {};

/**
* @brief initialize params
*/
void init(const Params::ParamManager::InferenceRawData &val) override;
/**
* @brief Load the object segmentation model.
*/
void loadNetwork(std::shared_ptr<Models::ObjectSegmentationMaskrcnnModel>);
void loadNetwork(const std::shared_ptr<Models::BaseModel>) override;
/**
* @brief Enqueue a frame to this class.
* The frame will be buffered but not infered yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,17 @@ class PersonAttribsDetection : public BaseInference
{
public:
using Result = openvino_wrapper_lib::PersonAttribsDetectionResult;
explicit PersonAttribsDetection(double);
~PersonAttribsDetection() override;

PersonAttribsDetection() {};
~PersonAttribsDetection() override {}
/**
* @brief initialize params
*/
void init(const Params::ParamManager::InferenceRawData &val) override;
/**
* @brief Load the person attributes detection model.
*/
void loadNetwork(std::shared_ptr<Models::PersonAttribsDetectionModel>);
void loadNetwork(const std::shared_ptr<Models::BaseModel>) override;
/**
* @brief Enqueue a frame to this class.
* The frame will be buffered but not infered yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@ class PersonReidentification : public BaseInference
{
public:
using Result = openvino_wrapper_lib::PersonReidentificationResult;
explicit PersonReidentification(double);
~PersonReidentification() override;
PersonReidentification() {};
~PersonReidentification() override {}
/**
* @brief initialize params
*/
void init(const Params::ParamManager::InferenceRawData &val) override;
/**
* @brief Load the face detection model.
*/
void loadNetwork(std::shared_ptr<Models::PersonReidentificationModel>);
void loadNetwork(const std::shared_ptr<Models::BaseModel>) override;
/**
* @brief Enqueue a frame to this class.
* The frame will be buffered but not infered yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ class VehicleAttribsDetection : public BaseInference
{
public:
using Result = openvino_wrapper_lib::VehicleAttribsDetectionResult;
VehicleAttribsDetection();
~VehicleAttribsDetection() override;
VehicleAttribsDetection() {};
~VehicleAttribsDetection() override {};
/**
* @brief Load the vehicle attributes detection model.
*/
void loadNetwork(std::shared_ptr<Models::VehicleAttribsDetectionModel>);
void loadNetwork(const std::shared_ptr<Models::BaseModel>) override;
/**
* @brief Enqueue a frame to this class.
* The frame will be buffered but not infered yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,19 @@ struct Config
class BaseInputDevice : public Ros2Handler
{
public:
BaseInputDevice() = default;
/**
* @brief Initialize the input device,
* for cameras, it will turn the camera on and get ready to read frames,
* for videos, it will open a video file.
* @return Whether the input device is successfully turned on.
*/
virtual bool initialize() = 0;
/**
* @brief Initialize the input device,
* @return Whether the input device is successfully setup.
*/
virtual bool initialize(const std::string &str) = 0;
/**
* @brief Initialize the input device with given width and height.
* @return Whether the input device is successfully turned on.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,22 @@ namespace Input
class Image : public BaseInputDevice
{
public:
Image() {};
explicit Image(const std::string &);
/**
* @brief Read an image file from the file path.
* @param[in] An image file path.
* @return Whether the input device is successfully turned on.
*/
bool initialize() override;

/**
* @brief Read an image file from the file path.
* @param[in] An image file path.
* @return Whether the input device is successfully setup.
*/
bool initialize(const std::string &file) override {file_.assign(file); return initialize();};

/**
* @brief Initialize the input device with given width and height.
* No implementation for Image class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ namespace Input
class ImageTopic : public BaseInputDevice
{
public:
ImageTopic(rclcpp::Node::SharedPtr node = nullptr);
ImageTopic() {};
bool initialize() override;
bool initialize(const std::string &file) override { return initialize();};
bool initialize(size_t width, size_t height) override;
bool read(cv::Mat * frame) override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace Input
class IpCamera : public BaseInputDevice
{
public:
IpCamera() {};
explicit IpCamera(const std::string & ip_uri) : ip_uri_(ip_uri) {}
/**
* @brief Initialize the input device,
Expand All @@ -41,6 +42,13 @@ class IpCamera : public BaseInputDevice
* @return Whether the input device is successfully turned on.
*/
bool initialize() override;
/**
* @brief Initialize the input device,
* for cameras, it will turn the camera on and get ready to read frames,
* for videos, it will open a video file.
* @return Whether the input device is successfully setup.
*/
bool initialize(const std::string &ip_uri) override {ip_uri_.assign(ip_uri); return initialize();};
/**
* @brief Initialize the input device with given width and height.
* @return Whether the input device is successfully turned on.
Expand Down
Loading