Skip to content

Latest commit

 

History

History
86 lines (55 loc) · 2.19 KB

README.md

File metadata and controls

86 lines (55 loc) · 2.19 KB

CamStreamAndroidToPython

Project Description

This project demonstrates how to stream live camera footage from an Android device using RTSP and perform object detection on the stream using YOLO (You Only Look Once) in Python. The Android application captures the camera feed and streams it over RTSP, while the Python script processes this stream to detect objects using the YOLO model.

Features

  • Android Application:

    • Captures live camera feed.
    • Streams the camera feed via RTSP.
    • Uses CameraX for camera functionalities.
    • Implements ViewModel, LiveData, and Snackbar for error and success messages, following the MVVM architecture.
  • Python Script:

    • Connects to the RTSP stream from the Android application.
    • Uses YOLO for object detection.
    • Captures a 5-second GIF from the stream.
    • Displays real-time object detection with bounding boxes and labels.

Prerequisites

  • Android:

    • Android Studio
    • Minimum SDK version 21
    • Recommended target SDK version 34
  • Python:

    • Python 3.6 or higher
    • OpenCV
    • Ultralytics YOLO
    • PyTorch
    • imageio

Installation

Android

  1. Clone the repository:
git clone https://github.com/oaslananka/CamStreamAndroidToPython.git
cd CamStreamAndroidToPython/android/CameraXRTSPStreaming
  1. Open the project in Android Studio:

  2. Build the project:

  • Android Studio will automatically download the necessary dependencies.

Python

  1. Navigate to the Python project directory:
cd ../python/stream_processing
  1. Install the required Python packages:
pip install -r requirements.txt
  1. Run the Python script:
python main.pyxt

Acknowledgements