Reference for ultralytics/solutions/parking_management.py
Note
This file is available at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/solutions/parking_management.py. If you spot a problem please help fix it by contributing a Pull Request 🛠️. Thank you 🙏!
ultralytics.solutions.parking_management.ParkingPtsSelection
Class for selecting and managing parking zone points on images using a Tkinter-based UI.
Source code in ultralytics/solutions/parking_management.py
on_canvas_click
Handle mouse clicks on canvas to create points for bounding boxes.
Source code in ultralytics/solutions/parking_management.py
remove_last_bounding_box
Remove the last drawn bounding box from canvas.
Source code in ultralytics/solutions/parking_management.py
save_to_json
Saves rescaled bounding boxes to 'bounding_boxes.json' based on image-to-canvas size ratio.
Source code in ultralytics/solutions/parking_management.py
upload_image
Upload an image and resize it to fit canvas.
Source code in ultralytics/solutions/parking_management.py
ultralytics.solutions.parking_management.ParkingManagement
ParkingManagement(model, json_file, occupied_region_color=(0, 0, 255), available_region_color=(0, 255, 0))
Manages parking occupancy and availability using YOLOv8 for real-time monitoring and visualization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
str
|
Path to the YOLOv8 model. |
required |
json_file
|
str
|
file that have all parking slot points data |
required |
occupied_region_color
|
tuple
|
RGB color tuple for occupied regions. |
(0, 0, 255)
|
available_region_color
|
tuple
|
RGB color tuple for available regions. |
(0, 255, 0)
|
Source code in ultralytics/solutions/parking_management.py
display_frames
Display frame.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
im0
|
ndarray
|
inference image |
required |
Source code in ultralytics/solutions/parking_management.py
process_data
Process the model data for parking lot management.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
im0
|
ndarray
|
inference image |
required |