Parking AI system for Eafit univercity
pip install -r requieriments.txt
python main.py
add go to
linear pipeline for training and deploying a YOLO model for parking slot detection:
- Download a dataset or create it, (We can mix both thecniques for learning prouses)
- PKLot
- CNRPark-EXT
- Kaggle Parking Dataset
- Kaggle Parking Dataset2
- If needed, manually annotate images using LabelImg or Roboflow.
- Ensure data is in YOLO format (bounding box labels in
.txt
files).
- Structure dataset:
/dataset ├── images │ ├── train (Training images) │ ├── val (Validation images) │ ├── test (Test images) ├── labels │ ├── train (Bounding boxes for training) │ ├── val (Bounding boxes for validation) │ ├── test (Bounding boxes for test) ├── data.yaml
- Create
data.yaml
:train: dataset/images/train val: dataset/images/val test: dataset/images/test nc: 1 # Number of classes names: ['parking_slot']
Our yolo model https://huggingface.co/smartinezg/Yolo_parking/tree/main
- Install dependencies:
pip install ultralytics
- Train the model:
from ultralytics import YOLO model = YOLO("yolov8n.pt") # Load pre-trained YOLOv8 model model.train(data="data.yaml", epochs=50, imgsz=640, batch=8)
- Save the trained model:
model.export(format="onnx") # Convert for deployment
- Run inference on a test image:
results = model("test.jpg", save=True, conf=0.5)
- Visualize predictions:
model.predict(source="dataset/images/test", show=True, conf=0.5)
- Run real-time detection using a webcam:
model.predict(source=0, show=True, conf=0.5)
- Integrate with FastAPI for a web service.
- Deploy to Raspberry Pi in a web interface
https://www.youtube.com/watch?v=VZXdkOo3xNI
https://www.youtube.com/watch?v=F-884J2mnOY
no so imortant, but elegant
https://www.youtube.com/watch?v=MeSeuzBhq2E