Skip to content

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.

License

Notifications You must be signed in to change notification settings

shubanms/parking-lot-occupancy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚗 Parking Slot Occupancy Detection System

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.


🌟 Features

  • 🚘 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.

🔗 API Endpoints

1. 📤 Upload Parking Lot Image

  • 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"

2. 📊 Get Parking Lot State

  • 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"

🛠 Tech Stack

  • 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.

🚀 Setup Instructions

1. Clone the Repository

git clone https://github.com/shubanms/parking-lot-occupancy.git
cd parking-lot-occupancy

2. Install Dependencies

Ensure Python 3.11+ is installed. Use the following command:

pip install -r requirements.txt

3. Configure Azure Blob Storage

Update src/blob/blob_manager.py with your Azure Blob Storage credentials and container information.

4. Start the FastAPI Server

uvicorn main:app --host 0.0.0.0 --port 8000

Access the server at http://127.0.0.1:8000. 🚀


☁️ Deployment on Azure

Steps for Deployment:

  1. Prepare Application:

    • Use Docker or upload your code directly to Azure App Service.
    • Set necessary environment variables for Azure Blob Storage.
  2. 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"
  3. Access the Application:

    • The app is live at: https://<your-app-name>.azurewebsites.net

🔄 Sample Workflow

  1. Upload a parking lot image via /upload_image/.
  2. Get the slot occupancy map using /get_parking_lot_state/.
  3. View a JSON response showing occupied and free slots. ✅

🚧 Future Enhancements

  • 🎞 Add video stream support for real-time parking lot monitoring.
  • ⚙️ Optimize PSAT for higher accuracy under full capacity.
  • 🌟 Deploy with Kubernetes for auto-scaling.

✨ Contributors

  • Shuban M S
  • Contributions and feedback are welcome! 🙌

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages