This script utilizes YOLO object detection to identify open parking spots in a video feed. It leverages a custom YOLOv8 weight trained on the model car, ROSMASTER R2, developed by Yahboom Technologies. This specialized weight enables YOLO to effectively detect the model car used in this application, enabling real-time identification of occupied parking spots. The script then determines the availability of parking spaces, which are subsequently published to a ROS2 topic. These data are utilized by the avp.py
node, available here, enabling autonomous parking in open spots.
-
Install Packages: Create a virtual environment, activate it and install the packages from the requirements file.
python3 -m venv <your_venv> source <your_venv>/bin/activate pip install -r requirements.txt
-
Start the Parking Spot Detection: Run the following script to detect open parking spots.
python parking_spot_detection.py
To use the script in your own environment, you'll need to follow these steps:
- Mapping Parking Spaces: Use the
parking_spot_coordinate_mapper.py
script on your live feed or recorded video to identify parking spaces. - Define Coordinates: Manually mark the coordinates of each parking spot by dragging the mouse over each corner and recording the coordinates in this order:
Top Left, Top Right, Bottom Right, Bottom Left
. - Update Parking Space Variables: Update the area variables at the start of
parking_spot_detection.py
with each coordinate.