GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - morsetechlab/Vehicle-Entry-Exit-Counter: A real-time vehicle counting system using YOLOv11 and ByteTrack, designed to detect vehicle movement through custom IN/OUT lines inside a defined polygon area—ideal for parking lots and one-way checkpoints.

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.en.md
README.en.md
 
 
README.md
README.md
 
 
count_vehicle.py
count_vehicle.py
 
 
frame_100.jpg
frame_100.jpg
 
 
get_frame.py
get_frame.py
 
 
output.gif
output.gif
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

📘 English version available here

Task: Vehicle Entry-Exit Counting Model: YOLOv11 + ByteTrack Framework: OpenCV Real-time Ready


ระบบนับจำนวนรถเข้า-ออกด้วย YOLOv11 + ByteTrack

ระบบตรวจจับและติดตามยานพาหนะแบบเรียลไทม์ โดยใช้ YOLOv11 สำหรับการตรวจจับ และ ByteTrack สำหรับการติดตามวัตถุ พร้อมวิเคราะห์การเคลื่อนผ่านเส้น IN/OUT ภายในพื้นที่ที่กำหนด เหมาะสำหรับลานจอดรถ ระบบ IoT และอุปกรณ์ Edge

ระบบนี้ใช้เทคนิค Object Detection และ Object Tracking เพื่อนับจำนวนวัตถุที่เคลื่อนผ่านเส้นทางเข้า/ออกภายใน Polygon ROI จากวิดีโอหรือกล้องแบบเรียลไทม์ โดยสามารถติดตามวัตถุด้วย Track ID อย่างแม่นยำแม้ในกรณีที่มีการบดบัง (Occlusion) และรองรับการแสดงผล overlay เช่น IN / OUT / FPS บนวิดีโอที่ประมวลผลแล้ว


โครงสร้างโปรเจกต์

.
├── count_vehicle.py        # สคริปต์หลักสำหรับนับจำนวนรถ
├── get_frame.py            # สคริปต์ดึงเฟรมจากวิดีโอเพื่อใช้วาด Polygon บน Roboflow PolygonZone
├── videos/                 # วิดีโอต้นฉบับ
├── weights/                # ไฟล์โมเดล YOLOv11 (.pt) 
├── outputs/                # ไฟล์วิดีโอหรือภาพผลลัพธ์
├── README.md               # เอกสารประกอบนี้
├── requirements.txt        # รายการไลบรารีที่จำเป็น

🎯 จุดเด่นของระบบ

  • ตรวจจับยานพาหนะ (รถยนต์ รถกระบะ ฯลฯ) ด้วย YOLOv11
  • ติดตามวัตถุด้วย ByteTrack โดยใช้ Track ID เดิมแม้จะมี Occlusion
  • ครอบพื้นที่สนใจด้วย Polygon และตรวจจับเฉพาะในพื้นที่นั้น
  • นับเฉพาะวัตถุที่เคลื่อน “ผ่านเส้น” IN/OUT
  • แสดง overlay แบบ real-time ได้แก่ IN / OUT / FPS

ตัวอย่างการทำงานของระบบ

ภาพ GIF ด้านล่างแสดงให้เห็นการทำงานของระบบนับรถเข้า-ออกแบบเรียลไทม์ โดยตรวจจับยานพาหนะที่เคลื่อนผ่านเส้น IN/OUT ภายในพื้นที่ Polygon ROI

Vehicle Counting Demo

▶️ ชมวิดีโอสาธิตแบบเต็ม ได้ที่ YouTube


วิธีใช้งาน (How to use)

  1. วางวิดีโอไว้ในโฟลเดอร์ videos/
  2. วางโมเดล YOLOv11 (yolo11x.pt) ไว้ในโฟลเดอร์ weights/ หากไม่มีโมเดลจะถูกโหลดอัตโนมัติเมื่อรันสคริปต์
  3. แก้ไขบรรทัดใน count_vehicle.py ให้ตรงกับชื่อไฟล์ของคุณ:
video_name = "parking.mp4"
model_name = "yolo11x.pt"

🔗 Download: parking.mp4

  1. รันโปรแกรม:
python count_vehicle.py
  1. กด q เพื่อหยุดการทำงาน วิดีโอที่ผ่านการประมวลผลจะถูกบันทึกไว้ในโฟลเดอร์ outputs/

Polygon ROI and IN/OUT Line

สามารถใช้ get_frame.py เพื่อดึงเฟรมจากวิดีโอเพื่อไปวาด ROI บนเว็บไซต์ https://polygonzone.roboflow.com

python get_frame.py  # ดึงเฟรมที่ 100 (สามารถเปลี่ยนเลขในสคริปต์ได้)

ผลลัพธ์จะถูกเก็บไว้ใน outputs/frame_100.jpg


Requirements

numpy
torch
opencv-python
ultralytics
supervision

ติดตั้งไลบรารี:

pip install -r requirements.txt

💡 ตัวอย่างการนำไปใช้งาน Real-World Application

  • ตรวจนับรถเข้า-ออกในลานจอดรถ
  • วิเคราะห์ความแออัดของถนนในเขตเมือง
  • ใช้กับกล้องบนอุปกรณ์ IoT หรือ Edge Device เพื่อประมวลผลแบบ local

Attribution

  • Open source computer vision library OpenCV
  • YOLOv11 Ultralytics
  • พัฒนาโดย MorseTech Lab

🛡️ License

Project นี้เผยแพร่ภายใต้ GNU Affero General Public License v3.0 (AGPLv3) เพื่อให้สอดคล้องกับเงื่อนไขการใช้งานของไลบรารีที่เกี่ยวข้อง

About

A real-time vehicle counting system using YOLOv11 and ByteTrack, designed to detect vehicle movement through custom IN/OUT lines inside a defined polygon area—ideal for parking lots and one-way checkpoints.

www.morsetechlab.com/

Resources

Readme
AGPL-3.0 license
Activity

Stars

5 stars

Watchers

1 watching

Forks

3 forks
Report repository

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.