Skip to content

Imtiaz-khoso/tracko_python_flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 Tracko - Real-Time Object Tracking Application

πŸ“– Overview

Tracko is a powerful, cutting-edge mobile application that performs real-time object detection and tracking using advanced AI technology. Built with Flutter for the mobile frontend and Python FastAPI for the backend, Tracko combines state-of-the-art YOLO (You Only Look Once) deep learning models with an intuitive user interface to track objects in real-time through your device camera.


πŸŽ“ Why This App Was Made

Problem Statement

Traditional object recognition systems are either:

  • Too complex - Requiring technical expertise to operate
  • Not real-time - Processing videos after recording
  • Limited features - Only detecting without tracking or analytics
  • Platform-specific - No cross-platform support

Solution: Tracko

Tracko was created to provide:

  1. Accessibility - Anyone can use professional-grade object tracking
  2. Real-time performance - Instant detection and tracking at 10-12 FPS
  3. Comprehensive features - Detection + tracking + analytics + recording
  4. Cross-platform - Works on Android/iOS with one codebase
  5. Multilingual - Supports English, Urdu, and Sindhi

πŸ’‘ Why This App Is Useful

Real-World Applications

1. Security & Surveillance

  • Monitor public spaces for specific objects
  • Count people entering/exiting areas
  • Track abandoned objects
  • Detect unauthorized items

2. Retail & Business

  • Customer traffic analysis (footfall counting)
  • Product placement optimization
  • Queue management
  • Inventory monitoring

3. Smart Cities

  • Traffic flow analysis
  • Vehicle counting and classification
  • Pedestrian safety monitoring
  • Urban planning data collection

4. Research & Education

  • Wildlife behavior studies
  • Sports performance analysis
  • Classroom activity monitoring
  • Laboratory experiment tracking

5. Personal Use

  • Pet monitoring and activity tracking
  • Home security
  • Package delivery detection
  • Parking space monitoring

πŸ› οΈ Technology Stack

Frontend: Flutter

What is Flutter?

  • Google's UI toolkit for building natively compiled applications
  • Single codebase for iOS, Android, web, and desktop
  • Fast development with hot reload
  • Beautiful, customizable UI components

Why Flutter?

  • βœ… Cross-platform - One code for all platforms
  • βœ… Performance - Compiled to native code (60+ FPS)
  • βœ… Rich UI - Material Design & Cupertino widgets
  • βœ… Fast development - Hot reload in milliseconds
  • βœ… Strong ecosystem - 25,000+ packages

Flutter Packages Used:

  • camera - Camera access and preview
  • http - API communication
  • provider - State management
  • permission_handler - Runtime permissions
  • path_provider - File system access
  • flutter_localizations - Multi-language support

Backend: Python FastAPI

What is FastAPI?

  • Modern, fast web framework for building APIs with Python
  • Automatic API documentation (Swagger UI)
  • Type hints and validation
  • High performance (comparable to NodeJS and Go)

Why FastAPI?

  • βœ… Fast - One of the fastest Python frameworks
  • βœ… Easy to use - Intuitive and Pythonic
  • βœ… Automatic docs - Interactive API documentation
  • βœ… Type safety - Built-in validation
  • βœ… Async support - Non-blocking operations

Python Libraries Used:

  • ultralytics - YOLOv8 implementation
  • opencv-python - Image processing
  • torch (PyTorch) - Deep learning framework
  • numpy - Numerical computations
  • pillow - Image handling

AI Engine: YOLOv8

What is YOLO?

  • "You Only Look Once" - Real-time object detection algorithm
  • Latest version: YOLOv8 (2023)
  • State-of-the-art accuracy and speed
  • Detects 80 different object classes (COCO dataset)

Why YOLOv8?

  • βœ… Real-time - Processes 30-60 frames per second
  • βœ… Accurate - 50%+ mean Average Precision (mAP)
  • βœ… Versatile - Detects people, vehicles, animals, objects
  • βœ… Efficient - Runs on CPU (no GPU required)
  • βœ… Pre-trained - Ready to use out of the box

Model Variants:

  • yolov8n - Nano (fastest, 3MB)
  • yolov8s - Small (balanced)
  • yolov8m - Medium
  • yolov8l - Large
  • yolov8x - Extra-large (most accurate)

🌟 What This App Can Do

Core Features

1. Real-Time Object Detection 🎯

  • Detects 75+ object types instantly
  • Live bounding boxes with labels
  • Confidence scores (accuracy percentage)
  • Distance estimation for detected objects

2. Object Tracking πŸ“

  • Assigns unique IDs to objects
  • Tracks movement across frames
  • Maintains tracking even with occlusion
  • Speed calculation (pixels/second)

3. Screenshot Capture πŸ“Έ

  • Capture frames with detection overlays
  • Save to device storage
  • Automatic timestamping
  • Quick access via floating button

4. Session History πŸ“‹

  • Records all tracking sessions
  • Shows total detections, duration, FPS
  • Object breakdown per session
  • Persistent local storage

5. Data Export πŸ’Ύ

  • Export to JSON (detailed data)
  • Export to CSV (spreadsheet format)
  • Includes timestamps, object counts
  • Ready for data analysis

6. Analytics & Insights πŸ“Š

  • Total detection counter
  • Most frequently detected objects
  • Average speed calculations
  • Dwell time (how long objects stay)
  • Confidence statistics

7. Multilingual Support 🌍

  • English (International)
  • Urdu (اردو)
  • Sindhi (Ψ³Ω†ΪŒΩŠ)
  • Easy language switching

8. Performance Optimizations ⚑

  • 10-12 FPS real-time tracking
  • 80ms processing interval
  • Optimized camera resolution
  • Efficient battery usage

9. Customization 🎨

  • Flash control (Off/On/Auto)
  • Camera switching (front/back)
  • Transparent UI elements
  • Adjustable display settings

πŸ†š Tracko vs Other Applications

Advantages Over Competitors

Feature Tracko Google Lens Other Apps
Real-time tracking βœ… Yes (10-12 FPS) ❌ No (single image) ⚠️ Some
Offline mode βœ… Local processing ❌ Requires internet ❌ Cloud only
Multi-language βœ… 3 languages βœ… 100+ languages ⚠️ Limited
Analytics βœ… Comprehensive ❌ No ❌ Basic
Session history βœ… Full tracking ❌ No ❌ Limited
Data export βœ… JSON + CSV ❌ No ❌ No
Free & open βœ… Completely free ⚠️ Free but data collected πŸ’° Paid
Privacy βœ… All local ❌ Cloud processing ❌ Data uploaded
Custom models βœ… Switchable ❌ Fixed ❌ Fixed
Distance calc βœ… Yes ❌ No ❌ No

What Makes Tracko Unique

1. Complete Local Processing

  • No internet required after setup
  • All data stays on your device
  • No privacy concerns
  • No data collection

2. Professional-Grade Features

  • Session management
  • Detailed analytics
  • Data export capabilities
  • Speed and dwell time metrics

3. Built for Extension

  • Modular architecture
  • Easy to add new features
  • Customizable models
  • Developer-friendly

4. Educational Value

  • Learn about AI/ML
  • Understand object detection
  • Practical computer vision examples
  • Open source code

πŸ“Š Technical Specifications

Performance Metrics

  • FPS: 10-12 frames per second
  • Latency: 80ms per frame
  • Accuracy: 50-70% mAP (model dependent)
  • Objects: 75+ types supported
  • Distance: Estimated via focal length calculation

System Requirements

Mobile Device:

  • Android 6.0+ or iOS 11.0+
  • 2GB RAM minimum (3GB+ recommended)
  • Camera (any resolution)
  • 100MB free storage

Backend Server:

  • Python 3.10+
  • 2GB RAM (4GB+ recommended)
  • CPU (GPU optional for faster processing)
  • ~500MB for dependencies

πŸ—οΈ Architecture

System Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      HTTP/REST     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 β”‚ ◄─────────────────► β”‚                  β”‚
β”‚  Flutter App    β”‚   80ms intervals   β”‚  FastAPI Server  β”‚
β”‚  (Frontend)     β”‚   Image + Response β”‚  (Backend)       β”‚
β”‚                 β”‚                     β”‚                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                                       β”‚
         β”‚ Camera Feed                           β”‚ Processing
         β”‚ User Input                            β”‚ YOLO Model
         β”‚ Display                               β”‚ Detection
         β”‚                                       β”‚
         β–Ό                                       β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚  Device  β”‚                           β”‚ YOLOv8   β”‚
   β”‚  Camera  β”‚                           β”‚  Model   β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow

  1. Camera captures frame
  2. Frontend sends image to backend
  3. Backend processes with YOLO
  4. Model detects objects and returns coordinates
  5. Backend sends detection data
  6. Frontend displays bounding boxes
  7. Analytics update in real-time

πŸ“ Project Structure

tracko/
β”œβ”€β”€ lib/                              # Flutter frontend
β”‚   β”œβ”€β”€ features/
β”‚   β”‚   └── object_tracking/
β”‚   β”‚       β”œβ”€β”€ controllers/         # Business logic
β”‚   β”‚       β”œβ”€β”€ models/              # Data structures
β”‚   β”‚       β”œβ”€β”€ screens/             # UI screens
β”‚   β”‚       β”œβ”€β”€ widgets/             # Reusable components
β”‚   β”‚       β”œβ”€β”€ services/            # API & storage
β”‚   β”‚       └── utils/               # Helper functions
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ constants/               # Colors, themes
β”‚   β”‚   β”œβ”€β”€ services/                # Global services
β”‚   β”‚   └── utils/                   # Localization
β”‚   └── common/
β”‚       └── widgets/                 # Shared widgets
β”œβ”€β”€ backend/                          # Python backend
β”‚   β”œβ”€β”€ main.py                      # FastAPI server
β”‚   β”œβ”€β”€ requirements.txt             # Dependencies
β”‚   └── yolov8n.pt                   # YOLO model
└── assets/
    └── translations/                # Language files

πŸš€ Getting Started

Prerequisites

# Install Flutter
flutter --version # Should be 3.10.0+

# Install Python
python3 --version # Should be 3.10+

Backend Setup

cd backend
pip3 install -r requirements.txt
python3 -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload

Frontend Setup

flutter pub get
flutter run

πŸ“ˆ Future Enhancements

Planned Features:

  • Video recording with overlays
  • Heat map visualization
  • Zone-based detection
  • Path tracking (movement trails)
  • Object filtering
  • Custom object training
  • Cloud sync (optional)
  • Social sharing

🀝 Contributing

Tracko is designed to be educational and extensible. Contributions are welcome!

Areas for contribution:

  • New detection models
  • UI improvements
  • Performance optimizations
  • Additional languages
  • Bug fixes

πŸ“„ License

This project is for educational purposes. The YOLO model follows Ultralytics AGPL-3.0 License.


πŸ‘¨β€πŸ’» Developer

Built with ❀️ using Flutter & FastAPI

Technologies:

  • Frontend: Flutter 3.10+
  • Backend: Python 3.10+ with FastAPI
  • AI: YOLOv8 by Ultralytics
  • State Management: Provider
  • Languages: Dart, Python

πŸ“ž Support

For issues, questions, or feature requests, please refer to the project documentation.


Tracko - Making professional object tracking accessible to everyone! 🎯

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published