Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Camera & Vision Modules

Crowd Counting with YOLO on Jetson Nano: India Use Case

Crowd Counting with YOLO on Jetson Nano: India Use Case

March 11, 2026 /Posted byJayesh Jain / 0

Crowd counting with computer vision is increasingly relevant for India’s public infrastructure – railway stations, temples, stadiums, and government offices regularly see large gatherings requiring safety monitoring. Running crowd counting with YOLO on Jetson Nano enables real-time people detection at the edge without cloud dependency. This tutorial covers YOLO deployment on Jetson Nano, TensorRT optimisation for faster inference, and building a crowd density monitoring system for India use cases.

Table of Contents

  • Crowd Counting Approaches
  • YOLO on Jetson Nano Setup
  • TensorRT Optimisation
  • People Detection Inference Code
  • Zone-Based Crowd Density
  • India-Specific Use Cases
  • Alert System Integration
  • FAQ

Crowd Counting Approaches

Three main approaches for crowd counting:

  1. Detection-based (YOLO): Detect each person with bounding box. Accurate for sparse/medium crowds. Fails in very dense crowds where individuals overlap. Jetson Nano can run YOLOv8n at 8-15 FPS.
  2. Density map estimation (CSRNet, MCNN): Predicts a density map and integrates it. Works for very dense crowds (Kumbh Mela scale). Requires GPU, runs at 5-10 FPS on Jetson Nano.
  3. Regression models: Directly predict a count number from image features. Fast but less spatial information. Good for quick estimates.

For India station/temple crowd monitoring with counts under 200 people in frame, YOLO detection is the most practical approach.

YOLO on Jetson Nano Setup

# Install YOLOv8 on Jetson Nano (JetPack 4.6)
sudo apt update
sudo apt install -y python3-pip

# Install PyTorch for Jetson (specific ARM build)
wget https://nvidia.box.com/shared/static/p57jwntv436lfrd78inwl7iml6p13fzh.whl 
     -O torch-2.1.0-cp38-cp38m-linux_aarch64.whl
pip3 install torch-2.1.0-cp38-cp38m-linux_aarch64.whl

# Install Ultralytics YOLOv8
pip3 install ultralytics

# Test basic detection
python3 -c "from ultralytics import YOLO; m=YOLO('yolov8n.pt'); print('YOLO OK')"

TensorRT Optimisation

TensorRT converts PyTorch models to optimised engine files for Jetson’s GPU. This dramatically improves inference speed:

from ultralytics import YOLO

# Export to TensorRT (run once, takes 5-10 minutes)
model = YOLO('yolov8n.pt')
model.export(format='engine', device=0, half=True)  # FP16 for faster inference

# Load TensorRT model for inference (much faster than PyTorch)
model_trt = YOLO('yolov8n.engine')

# Benchmark
results = model_trt.benchmark(data='coco8.yaml', imgsz=640, half=True)

Performance comparison on Jetson Nano (640×640 input):

  • YOLOv8n PyTorch: ~4 FPS
  • YOLOv8n TensorRT FP16: ~12-15 FPS
  • YOLOv8n TensorRT INT8: ~18-22 FPS

Waveshare IMX219-160 Wide Angle Camera for Jetson

160-degree FOV IMX219 camera compatible with Jetson Nano. Wide angle coverage essential for crowd monitoring – captures large areas without panning. Works out of the box with JetPack drivers.

View Product

People Detection Inference Code

from ultralytics import YOLO
import cv2
import jetson.utils  # For CSI camera
import numpy as np

model = YOLO('yolov8n.engine')  # TensorRT model

# Open CSI camera via GStreamer
gst_pipeline = (
    'nvarguscamerasrc sensor-id=0 ! '
    'video/x-raw(memory:NVMM),width=1280,height=720,framerate=30/1 ! '
    'nvvidconv ! video/x-raw,format=BGRx ! '
    'videoconvert ! video/x-raw,format=BGR ! appsink'
)
cap = cv2.VideoCapture(gst_pipeline, cv2.CAP_GSTREAMER)

while True:
    ret, frame = cap.read()
    if not ret: break
    # Run YOLO inference - filter class 0 (person)
    results = model(frame, classes=[0], conf=0.4, verbose=False)
    person_count = len(results[0].boxes)
    # Draw bounding boxes
    annotated = results[0].plot()
    # Overlay count
    cv2.putText(annotated, f'People Count: {person_count}',
               (10, 40), cv2.FONT_HERSHEY_SIMPLEX, 1.2, (0,255,0), 2)
    cv2.imshow('Crowd Counter', annotated)
    print(f'Count: {person_count}', end='r')
    if cv2.waitKey(1) & 0xFF == ord('q'): break
cap.release()

Zone-Based Crowd Density

def get_zone_density(boxes, frame_shape, zones):
    h, w = frame_shape[:2]
    zone_counts = {name: 0 for name, _ in zones.items()}
    for box in boxes:
        # Get person centre point
        x1, y1, x2, y2 = map(int, box.xyxy[0])
        px, py = (x1+x2)//2, (y1+y2)//2
        for name, (rx, ry, rw, rh) in zones.items():
            if rx <= px <= rx+rw and ry <= py = ALERT_THRESHOLD[zone]:
        print(f'ALERT: {zone} overcrowded ({count} people)')

India-Specific Use Cases

Railway stations (Indian Railways): Platform crowd monitoring during peak hours. Alert station master when platform exceeds safe density. Particularly relevant for Mumbai local rail stations and Delhi Metro feeder buses.

Temple entrances (Tirupati, Vaishno Devi, Siddhivinayak): Queue length estimation and crowd flow monitoring. Temples already use digital token systems – integrate camera-based counting for accurate wait time estimation.

Election booths: Monitor queue lengths at polling stations for resource allocation. Works well with wide-angle cameras covering the entire queue area.

Market areas: Real-time crowd density in weekly bazaars and shopping centres. Connect to dynamic parking guidance or entry control systems.

Waveshare IMX219-77 Camera Module

77-degree FOV IMX219 compatible with Jetson Nano. Good balance of coverage area and resolution for crowd monitoring applications. Driver included in JetPack 4.6+.

View Product

Alert System Integration

import requests, time

BOT_TOKEN = 'YOUR_TELEGRAM_BOT_TOKEN'
CHAT_ID = 'YOUR_CHAT_ID'

last_alert_time = {}
ALERT_COOLDOWN = 300  # 5 minute cooldown between alerts

def send_crowd_alert(zone, count, frame):
    now = time.time()
    if now - last_alert_time.get(zone, 0) < ALERT_COOLDOWN:
        return  # Still in cooldown
    msg = f'CROWD ALERT: {zone} has {count} people (threshold exceeded)'
    # Save frame to temp file and send
    cv2.imwrite('/tmp/crowd_alert.jpg', frame)
    with open('/tmp/crowd_alert.jpg', 'rb') as f:
        requests.post(
            f'https://api.telegram.org/bot{BOT_TOKEN}/sendPhoto',
            data={'chat_id': CHAT_ID, 'caption': msg},
            files={'photo': f}
        )
    last_alert_time[zone] = now

FAQ

How accurate is YOLO for crowd counting in India?

YOLOv8n achieves ~85% recall for well-separated people. In dense crowds where people overlap, accuracy drops to 60-70%. For dense crowds (more than 5 people per square metre), use CSRNet density estimation instead.

Can I run crowd counting on Raspberry Pi 5?

YOLOv8n on Pi 5 runs at approximately 3-5 FPS without GPU acceleration. For outdoor deployment where Jetson Nano heat management is a concern, Pi 5 with active cooling is a viable alternative for moderate crowd densities.

What is the legal position for CCTV crowd counting in India?

Counting people in public spaces is generally permitted for safety purposes. The IT Act and surveillance guidelines apply if you store identifiable images. For crowd counting that only logs counts (not images), there are minimal regulatory concerns. Consult DPDP (Digital Personal Data Protection Act 2023) for your specific use case.

Shop Camera & Vision Modules

Tags: crowd counting YOLO, crowd monitoring India, Jetson Nano crowd detection, TensorRT Jetson inference, YOLOv8 people counting
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Smart Beehive Monitor: Tempera...
blog smart beehive monitor temperature weight and humidity 599685
blog relay module in robotics switching high voltage peripherals 599691
Relay Module in Robotics: Swit...

Related posts

Svg%3E
Read more

Endoscope Camera Module: PCB Inspection and Industrial Use

April 1, 2026 0
An endoscope camera module is an invaluable tool for PCB inspection, industrial equipment maintenance, and quality control tasks where direct... Continue reading
Svg%3E
Read more

Number Plate Recognition System: ESP32-CAM ANPR Project India

April 1, 2026 0
Building a number plate recognition system with ESP32-CAM is an affordable approach to automatic number plate recognition (ANPR) for Indian... Continue reading
Svg%3E
Read more

Machine Vision with OpenCV: Raspberry Pi Object Detection Guide

April 1, 2026 0
Running OpenCV on a Raspberry Pi for object detection opens up countless applications, from industrial quality inspection to smart doorbell... Continue reading
Svg%3E
Read more

Arducam vs Raspberry Pi Camera: Which Camera Module to Choose

April 1, 2026 0
Choosing between Arducam and Raspberry Pi camera modules is one of the first decisions for any vision project. Both connect... Continue reading
Svg%3E
Read more

360-Degree Camera Stitching Project with OpenCV and Pi

March 11, 2026 0
Creating a 360-degree camera using OpenCV image stitching with Raspberry Pi is an ambitious computer vision project that combines multiple... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now