NVIDIA DeepStream Occupancy Analytics

repository·master·Indexed 42 days ago

https://github.com/nvidia-ai-iot/deepstream-occupancy-analytics

A sample application for real-time people counting (entry/exit) using the NVIDIA DeepStream SDK and Transfer Learning Toolkit (TLT). It utilizes the PeopleNet model and NvDsAnalytics to detect people crossing a tripwire and streams the resulting metadata to Apache Kafka.

Tokens
748
Snippets
4
Records
6
Agent score
4%

What's inside DeepStream Occupancy Analytics

  1. Prerequisites for Occupancy Analytics

    master

    To use this application, you must have the following components installed and configured:

    1. NVIDIA DeepStream SDK: The core framework for the application.
    2. PeopleNet Model: Download the pre-trained model from the NVIDIA NGC Catalog.
    3. Apache Kafka: Used for sending analytics data to the cloud or microservices. You must create a Kafka topic named quickstart-events to follow the default setup.
  2. Set up Apache Kafka

    master

    Follow these steps to initialize a local Kafka instance and create the required topic for analytics data:

    1. Extract the Kafka archive.
    2. Start the Zookeeper server.
    3. Start the Kafka server.
    4. Create the quickstart-events topic.
    tar -xzf kafka_2.13-3.5.0.tgz
    cd kafka_2.13-3.5.0
    bin/zookeeper-server-start.sh config/zookeeper.properties
    bin/kafka-server-start.sh config/server.properties
    bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092
  3. Run the Occupancy Analytics Application

    master

    Execute the compiled binary using the provided configuration file. To verify that the analytics data (entry/exit counts) is being sent correctly, run a Kafka console consumer in a separate terminal.

    # Run the application
    ./deepstream-test5-analytics -c config/dstest_occupancy_analytics.txt
    
    # In another terminal, monitor Kafka messages
    bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092
  4. Configure the Kafka Message Converter Library

    master

    You must specify the correct platform-specific message converter library in the configuration file config/dstest_occupancy_analytics.txt. Locate the [sink1] group and set the msg-conv-msg2p-lib key.

    For Jetson: msg-conv-msg2p-lib=$DEEPSTREAM_SDK_PATH/deepstream-occupancy-analytics/bin/jetson/libnvds_msgconv.so

    For x86: msg-conv-msg2p-lib=$DEEPSTREAM_SDK_PATH/deepstream-occupancy-analytics/bin/x86/libnvds_msgconv.so