This repository hosts the implementation of a real-time Parking Slot Occupancy Detection System powered by YOLOv8 and the Parking Slot Alignment Transformation (PSAT) algorithm. The application leverages FastAPI for API endpoints and is deployed on Azure for cloud scalability. 🎉
Access our research paper here.
- 🚘 Detect and map cars to virtual parking slots using YOLOv8 and PSAT.
- ⚡ FastAPI-based RESTful API for seamless interaction.
- 🌐 Scalable deployment on Azure.
- 🎥 Handles angled camera views and dynamic parking layouts effortlessly.
- Endpoint:
/upload_image/
- Method:
POST
- Description: Uploads an image of the parking lot for processing.
- Payload:
file
- The parking lot image file.
Example Request:
curl -X POST "http://127.0.0.1:8000/upload_image/" -F "file=@parking_lot_image.jpg"
- Endpoint:
/get_parking_lot_state/
- Method:
GET
- Description: Retrieves the parking lot's slot occupancy status based on the uploaded image.
- Query Parameter:
model_version
(default:v8
) - Specify the YOLO model version.
Example Request:
curl -X GET "http://127.0.0.1:8000/get_parking_lot_state/?model_version=v8"
- FastAPI: For building robust APIs.
- YOLOv8: Cutting-edge object detection for vehicles.
- PSAT Algorithm: Smart parking slot mapping.
- Azure Blob Storage: Efficient image storage and retrieval.
- Azure Deployment: Reliable cloud-hosted service.
git clone https://github.com/shubanms/parking-lot-occupancy.git
cd parking-lot-occupancy
Ensure Python 3.11+ is installed. Use the following command:
pip install -r requirements.txt
Update src/blob/blob_manager.py
with your Azure Blob Storage credentials and container information.
uvicorn main:app --host 0.0.0.0 --port 8000
Access the server at http://127.0.0.1:8000
. 🚀
-
Prepare Application:
- Use Docker or upload your code directly to Azure App Service.
- Set necessary environment variables for Azure Blob Storage.
-
Deploy Using Azure CLI:
az group create --name ParkingAppGroup --location <your-region> az appservice plan create --name ParkingAppPlan --resource-group ParkingAppGroup --sku B1 --is-linux az webapp up --name ParkingApp --resource-group ParkingAppGroup --runtime "PYTHON|3.11"
-
Access the Application:
- The app is live at:
https://<your-app-name>.azurewebsites.net
- The app is live at:
- Upload a parking lot image via
/upload_image/
. - Get the slot occupancy map using
/get_parking_lot_state/
. - View a JSON response showing occupied and free slots. ✅
- 🎞 Add video stream support for real-time parking lot monitoring.
- ⚙️ Optimize PSAT for higher accuracy under full capacity.
- 🌟 Deploy with Kubernetes for auto-scaling.
- Shuban M S
- Contributions and feedback are welcome! 🙌