first commit
This commit is contained in:
25
third_party/trt_yolov8/samples/trt_yolov8_det_test.cpp
vendored
Normal file
25
third_party/trt_yolov8/samples/trt_yolov8_det_test.cpp
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
#include "../trt_yolov8_detector.h"
|
||||
|
||||
int main() {
|
||||
trt_yolov8::trt_yolov8_detector detector("./vp_data/models/trt/others/yolov8s_v8.5.engine");
|
||||
|
||||
cv::VideoCapture cap("./vp_data/test_video/face2.mp4");
|
||||
cv::Mat frame;
|
||||
while (true) {
|
||||
if (!cap.read(frame)) {
|
||||
cap.set(cv::CAP_PROP_POS_FRAMES, 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
std::vector<std::vector<Detection>> detections;
|
||||
std::vector<cv::Mat> frames = {frame};
|
||||
detector.detect(frames, detections);
|
||||
|
||||
draw_bbox(frames, detections);
|
||||
cv::imshow("detect", frame);
|
||||
cv::waitKey(40);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user