Giter Club home page Giter Club logo

traffic_detection's Introduction

Team 03:

Thành Viên:

  • Đoàn Phú Đức
  • Dat Tran
  • Duong Le Tuong Khang
  • Quang Long Nguyen

Pipeline:

  1. Treo colab để chạy videoXX.mp4 ra thành các frame ảnh và nén thành 1 file .zip để tiện xử lý
  2. Dùng file zip ở trên và pretrained EfficientDetD4 để inference các bbox có trên từng frame rồi lưu vào 1 file txt
  3. Chạy DeepSort đọc thông tin từ file cam_XX.txt để lấy thông tin các bbox của từng video. Sau đó áp dụng tracking rồi đưa ra kq ở file tracking_cam_XX.txt
  4. Chạy file counting.py trên github mình đề cập dưới đây để tạo ra result_Cam_xX.txt từ file tracking
  5. Merge các file result_cam_XX.txt thành 1 file duy nhất rồi nộp bài.

Stage 1: Detection

Colab: Baseline_EfficientDet

  • Sử dụng pretrained model Efficientdet-d4 để thực hiện detection

Nhận xét:

  • Model detect khá tốt car, bus, truck. Tuy vậy lại bỏ qua khá nhiều motor, điều này ảnh hưởng đến việc tracking ở bước tiếp theo.
  • Ở cam 09 và cam 10 ( 2 cam tối), model detect kém, bỏ qua khá nhiêu xe và bị nhiễu khá nhiều. Vì vậy nhóm đã quyết định thực hiện lại việc label dữ liệu, train lại model để cải thiện khả năng detect ở cam 09 và cam 10, đồng thời tăng detect xe máy.

Colab: train_efficientdet

  • Train model với dữ liệu được gán nhãn
  • Dữ liệu được gán nhãn ở cam 01, cam 02, cam 03, cam 04, cam 09 và cam 10. Các nhãn được gán là: Bicycle, Motor, Truck, Bus, Car và ở bước detection được chuyển thành 4 class như yêu cầu ở cuộc thi HCMcity AI Challenges.
  • Link dataset cam 10, fullcam(cam 01 + cam 02 + cam 03 + cam 04 + cam 09 + 1 phần cam 10 (khoảng 2000 tấm): https://drive.google.com/drive/folders/1GGI2TXdGIdsCXGqaMl1IvT6ETytQTDyK?usp=sharing

Training:

Nhận xét:

  • Sau khi thực hiện train lại, model đã có thể detect tốt hơn ở cam 09 và cam 10 ( cải thiện score sau khi thực hiện train lại).
  • Tuy vậy, điểm số cải thiện không nhiều. Điều này có thể do việc thực hiện fine-tuning không tốt, ảnh hưởng đến weight ban đầu của model.

Stage 2: Tracking

Sử lý từng camera và in ra files tracking_{cam_num}.txt theo thứ tự sau:

  1. Đọc dữ liệu detections từ file {cam_num}.txt, file json và file zip chứa các frame ảnh.
  2. Khởi tạo model DeepSort với weight pretrained đã được download ở trên
  3. Mỗi frame, đưa mỗi box vào tracking để update tracking rồi in ra file txt theo định dạng: {track_id, x_min, y_min, x_max, y_max, frame_id, label} có nghĩa: id của tracking, {x_min, y_min, x_max, y_max} là box của tracking, id của frame và label của box tracking đấy.
  4. Sau đó, chạy file moi_counting.py ở github được đề cập ở trên (https://github.com/wan2000/DeepSORT/tree/master/deep_sort) để lấy files result_{cam_num}.txt là kết quả cho camera thứ cam_num:

traffic_detection's People

Contributors

tuongkhangg avatar

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.