From c505eb90a977195a74776a32cb54cc505a2a288f Mon Sep 17 00:00:00 2001 From: nicorossini Date: Thu, 25 Jan 2024 09:58:19 +0100 Subject: [PATCH] README file --- ImageRecognition/README.md | 24 ++++++++++++++++++++++++ ImageRecognition/requirements.txt | 3 ++- ImageRecognition/send_frame.py | 3 +-- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 ImageRecognition/README.md diff --git a/ImageRecognition/README.md b/ImageRecognition/README.md new file mode 100644 index 0000000..ba06a19 --- /dev/null +++ b/ImageRecognition/README.md @@ -0,0 +1,24 @@ +## Technology +

+ Ultralytics Yolo +

+ +Ultralytics YOLO for building accurate and efficient object detection models. + +## Running the app +First, open the terminal and move to the ImageRecognition directiory. +Run send_frame.py for sending camera frames: + +```bash +python send_frame.py +``` + +To start the object detection function move to the src directory and run ObjectDetectionYOLO.py: + +```bash +python ObjectDetectionYOLO.py +``` + +## Learn More +To learn more about YOLO architecture, take a look at the following resource: +- [YOLO Documentation](https://docs.ultralytics.com). diff --git a/ImageRecognition/requirements.txt b/ImageRecognition/requirements.txt index 248c2ec..0113573 100644 --- a/ImageRecognition/requirements.txt +++ b/ImageRecognition/requirements.txt @@ -1,4 +1,5 @@ opencv-python~=4.8.1.78 numpy~=1.26.1 ping3~=4.0.4 -ffmpeg-python~=0.2.0 \ No newline at end of file +python>=3.8 +PyTorch>=1.8 \ No newline at end of file diff --git a/ImageRecognition/send_frame.py b/ImageRecognition/send_frame.py index ec68298..8a9f135 100644 --- a/ImageRecognition/send_frame.py +++ b/ImageRecognition/send_frame.py @@ -1,6 +1,5 @@ import cv2 import socketio -import base64 import threading #cameras data @@ -40,7 +39,7 @@ def send_frames(camera_id, capture, interval=0.1): for camera_id, camera_url in cameras.items(): capture = cv2.VideoCapture(camera_url) if not capture.isOpened(): - print(f"Errore nell'apertura della telecamera {camera_id}") + print(f"Error stream with camera {camera_id}") continue threading.Thread(target=send_frames, args=(camera_id, capture)).start()