This project utilizes computer vision techniques and deep learning to detect and classify free parking spots in a given video.
The system processes a video feed of a parking lot, identifying whether each parking spot is occupied or vacant. It employs a Convolutional Neural Network (CNN) trained on labeled images of parking spots to make predictions in real-time.
- Video Input: Supports any video file where parking spots need to be analyzed.
- Real-time Classification: Each frame of the video is analyzed to determine the status of each parking spot.
- Output Video Generation: An annotated video is generated showing identified occupied and vacant spots.
- Evaluation Metrics: Provides metrics such as accuracy, precision, recall, and F1 score to evaluate the model's performance.
- Python 3.x
- OpenCV (
pip install opencv-python
) - TensorFlow (
pip install tensorflow
) - Scikit-image (
pip install scikit-image
)
-
Clone the repository:
git clone https://github.com/adrianna-d/Parking_detection.git cd parking_project
-
Install dependencies:
pip install -r requirements.txt
-
Download or configure the video and mask file paths in your code (
video_path
andmask_path
variables).
-
Ensure the video and mask are correctly set up.
-
Run the main script:
python parking_spot_detection.py
-
The program will process the video, classify parking spots, and generate an annotated output video.
-
The CNN model is trained using images from two directories:
empty_folder_path
: Images of empty parking spots.occupied_folder_path
: Images of occupied parking spots.
-
The model architecture includes convolutional layers with max-pooling, fully connected layers, and dropout to prevent overfitting.
- parking_spot_detection.py: Main script for detecting and classifying parking spots.
- requirements.txt: List of Python dependencies.
- parking_1920_1080.mp4: Example input video
- mask_1920_1080 - Mask for the project
- project_presentation - .pdf of what was done for the project
This project is licensed under the MIT License - see the LICENSE file for details.
- This project was developed as part of IronHack bootcamp project on computer vision.
- @sofiaggoncalves is a co-author of the project.