Этот репозиторий содержит код для выполнения обнаружения объектов с использованием модели YOLO (You Only Look Once) v2/v3. Для различных операций используются библиотеки OpenCV, NumPy и argparse.
Для начала работы выполните следующие шаги:
- Клонируйте репозиторий на свой компьютер.
- Установите необходимые библиотеки, выполнив следующую команду:
- Скачайте файлы конфигурации и весов модели YOLO. Разместите их в соответствующих каталогах:
- Файл конфигурации модели (
cfg/.cfg
) - Файл весов модели (
weights/.weights
)
- Запустите скрипт с помощью следующей команды:
Скрипт предоставляет два метода обнаружения объектов:
- Метод веб-камеры: Установите в переменную
method
значение0
, чтобы использовать веб-камеру в качестве источника видео. - Метод камеры телефона: Установите в переменную
method
значение1
и укажите IP-адрес и порт камеры телефона в переменныхip
иport
соответственно. Скрипт будет отображать результаты обнаружения объектов в режиме реального времени на экране. Нажмите клавишу 'q' для остановки выполнения.
Вы можете настроить скрипт в соответствии с вашими требованиями. Вы можете изменить порог уверенности и порог подавления немаксимальных значений, изменив переменные confidence_threshold
и nms_threshold
соответственно.
- Python 3.x
- OpenCV
- NumPy
- argparse
Этот проект лицензирован в соответствии с MIT License.
Пожалуйста, убедитесь, что у вас есть необходимые файлы и зависимости перед запуском скрипта. Если у вас возникнут вопросы или проблемы, не стесняйтесь задавать их в разделе Issues этого репозитория.
Примечание: Замените username/repository
на фактическое имя вашего репозитория в ссылке выше.
Приятного использования обнаружения объектов с помощью модели YOLO v2/v3!
This repository contains code for performing object detection using the YOLO (You Only Look Once) v2/v3 model. It utilizes the OpenCV, NumPy, and argparse libraries for various operations.
To get started, follow the steps below:
- Clone the repository to your local machine.
- Install the required libraries by running the following command:
- Download the YOLO model configuration and weights files. Place them in the appropriate directories:
- Model configuration file (
cfg/.cfg
) - Model weights file (
weights/.weights
)
- Run the script using the following command:
The script provides two methods for object detection:
- Webcam Method: Set in the
method
variable to0
to use the webcam as the video source. - Phone Camera Method: Set in the
method
variable to1
and provide the IP address and port of the phone camera in theip
andport
variables, respectively. The script will display the real-time object detection results on the screen. Press the 'q' key to stop the execution.
Feel free to customize the script as per your requirements. You can adjust the confidence threshold and non-maxima suppression threshold by modifying the confidence_threshold
and nms_threshold
variables, respectively.
- Python 3.x
- OpenCV
- NumPy
- argparse
This project is licensed under the MIT License.
Please make sure you have the necessary files and dependencies before running the script. If you encounter any issues, feel free to raise them in the Issues section of this repository.
Note: Remember to replace username/repository
with your actual repository name in the above link.
Enjoy object detection using YOLO v2/v3!