marcoslucianops / deepstream-yolo-pose Goto Github PK
View Code? Open in Web Editor NEWNVIDIA DeepStream SDK 6.3 / 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 application for YOLO-Pose models
License: MIT License
NVIDIA DeepStream SDK 6.3 / 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 application for YOLO-Pose models
License: MIT License
In some cases it may occur that theestimated joint keypoints provided by the model have negative coordinates.
In this case in the function parse_pose from_meta() the setting of the circle_params with xc and yc as well as the setting of the line_params with x1, y1,x2, y2 will throw a TypeError. Setting these params to negative values is not allowed.
My suggestion is to make sure, the given coordinates are not negative like:
xc = max(0, int((data[i * 3 + 0] - pad_x) / gain))
yc = max(0, int((data[i * 3 + 1] - pad_y) / gain))
instead of:
xc = int((data[i * 3 + 0] - pad_x) / gain)
yc = int((data[i * 3 + 1] - pad_y) / gain)
Same for the calculation of x1, x2, y1, y2.
Our organization had the issue that we use Yolov8n model, we use deepstream-yolo change it to onnx format. and we follow the https://github.com/marcoslucianops/DeepStream-Yolo-Pose/blob/master/docs/YOLOv8_Pose.md YOLOv8-Pose usage step to setup the deepstream. But only one class can detected.
Our process was:
Is it possible to save the output of deepstream.py to a video?
Is it possible to use web cam as source? It is possible in deepstream-yolo by changing a config file for deepstream-app as V4L2 CAMERA.. but I didt find this posibility in this project.
ile "deepstream.py", line 88, in parse_pose_from_meta
num_joints = int(obj_meta.mask_params.size / (sizeof(c_float) * 3))
TypeError: Unable to convert function return value to a Python type! The signature was
(self: pyds.NvDsObjectMeta) -> _NvOSD_MaskParams
In DeepStream-Yolo, I can add changes to deepstream_app_config.txt to add more sources. I don't know the same way to do it in python.
the run fails with these messages
thank you!
0:00:07.082318833 29 0xffff7cd19490 INFO nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1909> [UID = 1]: deserialized trt engine from :/model_b2_gpu0_fp32.engine
WARNING: [TRT]: The getMaxBatchSize() function should not be used with an engine built from a network created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag. This function will always return 1.
INFO: [Implicit Engine Info]: layers num: 4
0 INPUT kFLOAT input 3x640x640
1 OUTPUT kFLOAT boxes 25200x4
2 OUTPUT kFLOAT scores 25200x1
3 OUTPUT kFLOAT classes 25200x1
0:00:07.232329468 29 0xffff7cd19490 WARN nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::checkBackendParams() <nvdsinfer_context_impl.cpp:1841> [UID = 1]: Backend has maxBatchSize 1 whereas 2 has been requested
0:00:07.234135304 29 0xffff7cd19490 WARN nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2018> [UID = 1]: deserialized backend context :/model_b2_gpu0_fp32.engine failed to match config params, trying rebuild
0:00:07.287486636 29 0xffff7cd19490 INFO nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1923> [UID = 1]: Trying to create engine from model files
WARNING: [TRT]: onnx2trt_utils.cpp:367: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
WARNING: [TRT]: onnx2trt_utils.cpp:395: One or more weights outside the range of INT32 was clamped
WARNING: [TRT]: Tensor DataType is determined at build time for tensors not marked as input or output.
Building the TensorRT Engine
1> run:
~/work/yolo_deepstream/DeepStream-Yolo-Pose$ ./deepstream -s file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 -c config_infer_primary_yoloV8_pose.txt
2> error logs:
SOURCE: file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
CONFIG_INFER: config_infer_primary_yoloV8_pose.txt
STREAMMUX_BATCH_SIZE: 1
STREAMMUX_WIDTH: 1920
STREAMMUX_HEIGHT: 1080
GPU_ID: 0
PERF_MEASUREMENT_INTERVAL_SEC: 5
JETSON: FALSE
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream/lib/libnvds_nvmultiobjecttracker.so
[NvMultiObjectTracker] Initialized
WARNING: ../nvdsinfer/nvdsinfer_model_builder.cpp:1487 Deserialize engine failed because file path: /home/work/yolo_deepstream/DeepStream-Yolo-Pose/yolov8s-pose.onnx_b1_gpu0_fp32.engine open error
0:00:03.835371860 17386 0x5629562a3600 WARN nvinfer gstnvinfer.cpp:679:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1976> [UID = 1]: deserialize engine from file :/home/work/yolo_deepstream/DeepStream-Yolo-Pose/yolov8s-pose.onnx_b1_gpu0_fp32.engine failed
0:00:03.836187181 17386 0x5629562a3600 WARN nvinfer gstnvinfer.cpp:679:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2081> [UID = 1]: deserialize backend context from engine from file :/home/work/yolo_deepstream/DeepStream-Yolo-Pose/yolov8s-pose.onnx_b1_gpu0_fp32.engine failed, try rebuild
0:00:03.836206038 17386 0x5629562a3600 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2002> [UID = 1]: Trying to create engine from model files
WARNING: [TRT]: onnx2trt_utils.cpp:369: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
WARNING: [TRT]: The getMaxBatchSize() function should not be used with an engine built from a network created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag. This function will always return 1.
WARNING: [TRT]: The getMaxBatchSize() function should not be used with an engine built from a network created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag. This function will always return 1.
0:01:19.504473333 17386 0x5629562a3600 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2034> [UID = 1]: serialize cuda engine to file: /home/work/yolo_deepstream/DeepStream-Yolo-Pose/yolov8s-pose.onnx_b1_gpu0_fp32.engine successfully
WARNING: [TRT]: The getMaxBatchSize() function should not be used with an engine built from a network created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag. This function will always return 1.
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 2
0 INPUT kFLOAT images 3x640x640
1 OUTPUT kFLOAT output0 56x8400
0:01:19.513500180 17386 0x5629562a3600 INFO nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus: [UID 1]: Load new model:config_infer_primary_yoloV8_pose.txt sucessfully
DEBUG: FPS of stream 1: 0.00 (0.00)
ERROR: decodebin did not pick NVIDIA decoder plugin
DEBUG: FPS of stream 1: 0.00 (0.00)
DEBUG: FPS of stream 1: 0.00 (0.00)
Traceback (most recent call last):
File "deepstream.py", line 178, in tracker_src_pad_buffer_probe
parse_pose_from_meta(frame_meta, obj_meta)
File "deepstream.py", line 129, in parse_pose_from_meta
x1 = int((data[(skeleton[i][0] - 1) * 3 + 0] - pad_x) / gain)
IndexError: index 45 is out of bounds for axis 0 with size 0
I'm trying to use this moddel for multiple classes. However I get core dumped.
When I tested it on a model with only one class it works.
What changes are needed in oirder to be able to work with more thatn one classs?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.