Giter Club home page Giter Club logo

deepstream-yolo-face's Introduction

DeepStream-Yolo-Face

NVIDIA DeepStream SDK application for YOLO-Face models


YOLO objetct detection models and other infos: https://github.com/marcoslucianops/DeepStream-Yolo


Getting started

Supported models

Instructions

1. Download the DeepStream-Yolo-Face repo

git clone https://github.com/marcoslucianops/DeepStream-Yolo-Face.git
cd DeepStream-Yolo-Face

2. Compile the libs

Export the CUDA_VER env according to your DeepStream version and platform:

  • DeepStream 6.3 on x86 platform

    export CUDA_VER=12.1
    
  • DeepStream 6.2 on x86 platform

    export CUDA_VER=11.8
    
  • DeepStream 6.1.1 on x86 platform

    export CUDA_VER=11.7
    
  • DeepStream 6.1 on x86 platform

    export CUDA_VER=11.6
    
  • DeepStream 6.0.1 / 6.0 on x86 platform

    export CUDA_VER=11.4
    
  • DeepStream 6.3 / 6.2 / 6.1.1 / 6.1 on Jetson platform

    export CUDA_VER=11.4
    
  • DeepStream 6.0.1 / 6.0 on Jetson platform

    export CUDA_VER=10.2
    

Compile the libs

make -C nvdsinfer_custom_impl_Yolo_face
make

NOTE: To use the Python code, you need to install the DeepStream Python bindings.

Reference: https://github.com/NVIDIA-AI-IOT/deepstream_python_apps

  • x86 platform:

    wget https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/releases/download/v1.1.8/pyds-1.1.8-py3-none-linux_x86_64.whl
    pip3 install pyds-1.1.8-py3-none-linux_x86_64.whl
    
  • Jetson platform:

    wget https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/releases/download/v1.1.8/pyds-1.1.8-py3-none-linux_aarch64.whl
    pip3 install pyds-1.1.8-py3-none-linux_aarch64.whl
    

NOTE: It is recommended to use Python virtualenv.

NOTE: The steps above only work on DeepStream 6.3. For previous versions, please check the files on the NVIDIA-AI-IOT/deepstream_python_apps repo.

3. Run

  • C code

    ./deepstream -s file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 -c config_infer_primary_yoloV8_face.txt
    
  • Python code

    python3 deepstream.py -s file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 -c config_infer_primary_yoloV8_face.txt
    

NOTE: The TensorRT engine file may take a very long time to generate (sometimes more than 10 minutes).

NOTE: To change the source

-s file:// or rtsp:// or http://
--source file:// or rtsp:// or http://

NOTE: To change the config infer file (example for config_infer.txt file)

-c config_infer.txt
--config-infer config_infer.txt

NOTE: To change the nvstreammux batch-size (example for 2; default: 1)

-b 2
--streammux-batch-size 2

NOTE: To change the nvstreammux width (example for 1280; default: 1920)

-w 1280
--streammux-width 1280

NOTE: To change the nvstreammux height (example for 720; default: 1080)

-e 720
--streammux-height 720

NOTE: To change the GPU id (example for 1; default: 0)

-g 1
--gpu-id 1

NOTE: To change the FPS measurement interval (example for 10; default: 5)

-f 10
--fps-interval 10

NMS configuration

For now, the nms-iou-threshold is fixed to 0.45.

NOTE: Make sure to set cluster-mode=4 in the config_infer file.

Detection threshold configuration

[class-attrs-all]
pre-cluster-threshold=0.25
topk=300

My projects: https://www.youtube.com/MarcosLucianoTV

deepstream-yolo-face's People

Contributors

marcoslucianops avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

deepstream-yolo-face's Issues

Deep stream has face recognition

i want do a project with face recognition . i want use one shotlearning and use siamese network.
can use this face detection(with deepstream) and use pretrained model in deepstream for feature extraction and compare it ?
Thanku

Segmentation Fault ERROR

Hello.
I am trying to run the Python file from this repository using the given command: python3 deepstream.py -s file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 -c config_infer_primary_yoloV8_face.txt

Every time I run the command I'm getting Segmentation fault ERROR with a black screen, below is the log I get while running the file:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ubuntu@ubuntu-Blade-15-2022-RZ09-0421:~/Documents/DeepStream-Yolo-Face$ python3 deepstream.py -s file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 -c config_infer_primary_yoloV8_face.txt

SOURCE: file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
CONFIG_INFER: config_infer_primary_yoloV8_face.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
0:00:03.122840037 24409 0x3042a60 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1988> [UID = 1]: deserialized trt engine from :/home/ubuntu/Documents/DeepStream-Yolo-Face/yolov8n-face.onnx_b1_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: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 2
0 INPUT kFLOAT images 3x640x640
1 OUTPUT kFLOAT output0 5x8400

0:00:03.173926305 24409 0x3042a60 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2091> [UID = 1]: Use deserialized engine model: /home/ubuntu/Documents/DeepStream-Yolo-Face/yolov8n-face.onnx_b1_gpu0_fp32.engine
0:00:03.175549029 24409 0x3042a60 INFO nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus: [UID 1]: Load new model:config_infer_primary_yoloV8_face.txt sucessfully

Segmentation fault (core dumped)

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Please, I wonder if anyone could help me with this issue, how can I fix it?

DeepStream Version = 6.3
YOLO MODEL = Yolov8n-face
CUDA = 12.3
TensorRT = 8.5.3.1
NVIDIA GRAPHIC = GeForce RTX 3080 Ti
32GB RAM and 1TB SSD

Error While Running the python code

Hello.
I am trying to run the Python file from this repository using the given command: python3 deepstream.py -s file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 -c config_infer_primary_yoloV8_face.txt

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ubuntu@ubuntu-Blade-15-2022-RZ09-0421:~/Documents/DeepStream-Yolo-Face$ python3 deepstream.py -s file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 -c config_infer_primary_yoloV8_face.txt

SOURCE: file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
CONFIG_INFER: config_infer_primary_yoloV8_face.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
0:00:03.153337617 31142 0x2ae9860 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1988> [UID = 1]: deserialized trt engine from :/home/ubuntu/Documents/DeepStream-Yolo-Face/yolov8n-face.onnx_b1_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: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [Implicit Engine Info]: layers num: 4
0 INPUT kFLOAT input 3x640x640
1 OUTPUT kFLOAT boxes 8400x4
2 OUTPUT kFLOAT scores 8400x1
3 OUTPUT kFLOAT landmarks 8400x0

0:00:03.208580298 31142 0x2ae9860 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2091> [UID = 1]: Use deserialized engine model: /home/ubuntu/Documents/DeepStream-Yolo-Face/yolov8n-face.onnx_b1_gpu0_fp32.engine
python3: nvdsinfer_context_impl.cpp:1377: NvDsInferStatus nvdsinfer::NvDsInferContextImpl::resizeOutputBufferpool(uint32_t): Assertion `bindingDims.numElements > 0' failed.
Aborted (core dumped)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Please, I wonder if anyone could help me with this issue, how can I fix it?

DeepStream Version = 6.3
YOLO MODEL = Yolov8n-face
CUDA = 12.3
TensorRT = 8.5.3.1
NVIDIA GRAPHIC = GeForce RTX 3080 Ti
32GB RAM and 1TB SSD

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.