16 #define int64 opencv_broken_int
17 #define uint64 opencv_broken_uint
18 #include <opencv2/dnn.hpp>
19 #include <opencv2/opencv.hpp>
20 #include <opencv2/core.hpp>
39 std::vector<uint32_t>
rle;
54 std::vector<int> _classIds,
55 std::vector<float> _confidences,
56 std::vector<cv::Rect_<float>> _boxes,
58 std::vector<int> _objectIds,
59 std::vector<CVObjectMaskData> _masks = {})
71 std::vector<cv::Rect_<float>>
boxes;
73 std::vector<CVObjectMaskData>
masks;
86 std::vector<std::string> classNames;
87 float confThreshold, nmsThreshold;
89 std::string classesFile;
90 std::string modelPath;
91 std::string processingDevice;
92 std::string protobuf_data_path;
98 std::map<int, CVTrackedMaskData> recentObjectMasks;
110 void setProcessingDevice();
113 void DetectObjects(
const cv::Mat &frame,
size_t frame_number);
115 bool iou(cv::Rect pred_box, cv::Rect sort_box);
118 void postprocess(
const cv::Size &frameDims,
const std::vector<cv::Mat>& out,
size_t frame_number);
120 void NormalizeTrackedClasses();
123 std::vector<cv::String> getOutputsNames(
const cv::dnn::Net& net);
145 void SetJson(
const std::string value);
Header file for Clip class.
Header file for JSON class.
This is a message class for thread safe comunication between ClipProcessingJobs and OpenCV classes.
This class runs trought a clip to detect objects and returns the bounding boxes and its properties.
void SetJsonValue(const Json::Value root)
Load Json::Value into this object.
CVObjectDetection(std::string processInfoJson, ProcessingController &processingController)
bool _LoadObjDetectdData()
void detectObjectsClip(openshot::Clip &video, size_t start=0, size_t end=0, bool process_interval=false)
void AddFrameDataToProto(pb_objdetect::Frame *pbFrameData, CVDetectionData &dData)
CVDetectionData GetDetectionData(size_t frameId)
static std::string ValidateONNXModel(std::string modelPath)
std::map< size_t, CVDetectionData > detectionsData
void SetJson(const std::string value)
Load JSON string into this object.
bool SaveObjDetectedData()
Protobuf Save and Load methods.
This class represents a clip (used to arrange readers on the timeline)
This namespace is the default namespace for all code in the openshot library.
CVDetectionData(std::vector< int > _classIds, std::vector< float > _confidences, std::vector< cv::Rect_< float >> _boxes, size_t _frameId, std::vector< int > _objectIds, std::vector< CVObjectMaskData > _masks={})
std::vector< int > objectIds
std::vector< cv::Rect_< float > > boxes
std::vector< CVObjectMaskData > masks
std::vector< int > classIds
std::vector< float > confidences
std::vector< uint32_t > rle