How gopi514-chand/smart-parking-and-vehicle-occupancy-system works
Purpose and Entry Points
The repository combines a computer-vision parking-occupancy detector with an Android smart-parking client. The documented primary entry point is app.py, which processes surveillance imagery to count and visualize available versus occupied spaces. Android launches through activity classes declared around SplashActivity.java, LoginActivity.java, and MainActivity.java.
Vision Detection Pipeline
The Python detection workflow is coordinate-driven: parking-space rectangles are labeled, persisted as parking-position data, then individually processed to classify availability. car_park_coordiante_generator copy.py is the interactive coordinate-labeling stage; app.py is the runtime detection and annotated-result stage. This boundary separates lot calibration from repeated image analysis.
Parking-State Data and Simulation
Supporting Python scripts indicate a Firebase-backed or remotely synchronized parking-state workflow. monitor_firebase.py appears to observe backend changes, while simulate_remote_booking.py supplies remote booking/state simulation. snapshot.py likely captures state or imagery for processing. The precise schema is not visible, but these scripts form the bridge between computer-vision occupancy signals and application-facing parking availability.
Android Client Flow
The Android application provides authentication, parking discovery, location, and payment-oriented screens. SplashActivity.java initializes the client flow; LoginActivity.java and RegisterActivity.java handle account entry; MainActivity.java is the primary authenticated experience. LocationActivity.java and PaymentActivity.java represent location selection/navigation and payment completion boundaries.
Parking Domain and Presentation Model
Parking entities and RecyclerView adapters separate parking data from UI rendering. ParkingLot.java represents lots, ParkingBox.java represents individual parking units or displayable spot state, and ParkingLotAdapter.java / ParkingSpotAdapter.java render these structures. NearbyParkingAdapter.java supports a distinct nearby-lot listing. Corresponding layouts such as item_nearby_parking.xml and item_parking_spot.xml define the list/spot presentation boundary.
Booking, Status, and UI States
The client has dedicated dialogs for booking and detailed spot interaction: dialog_book_now.xml, dialog_spot_details.xml, and dialog_search.xml. Parking-state drawable resources encode the core availability vocabulary—parking_spot_available.xml, parking_spot_occupied.xml, and parking_spot_reserved.xml—allowing backend or vision-derived status to map directly into UI state.
Runtime and Infrastructure
The vision subsystem is Python/OpenCV-based, as documented in README.md, with an interactive desktop GUI for labeling and result visualization. The mobile subsystem is a Gradle Android application (build.gradle, settings.gradle) using Firebase configuration (google-services.json, firebase.json). Android platform configuration begins at AndroidManifest.xml; Firebase is the material external-service integration suggested by the repository artifacts.
Main entry points: MainActivity.java Parking Home · firebase.json Firebase · ParkingLot.java Parking Domain Models · app.py Occupancy Detector
Components 17
Vision Pipeline
Python/OpenCV parking occupancy workflow.
- Lot Coordinate Labeler · Interactively labels parking-space rectangles.
car_park_coordiante_generator copy.py - Parking Position Data · Persisted rectangles used for repeated detection.
- Occupancy Detector · Classifies spots and renders annotated availability results.
app.py - Snapshot Capture · Supplies imagery or state for processing.
snapshot.py
Android Client
Smart-parking application flow and presentation.
- Android App Configuration · Declares the client application and activities.
AndroidManifest.xml - Splash Screen · Initializes the client flow.
SplashActivity.java - Authentication · Login and registration account entry.
LoginActivity.java - Parking Home · Primary authenticated parking experience.
MainActivity.java - Parking Domain Models · ParkingLot and ParkingBox represent lots and individual spots.
ParkingLot.java - Parking Lists · Renders lots, spots, and nearby parking listings.
ParkingLotAdapter.java - Location Selection · Location and navigation boundary.
LocationActivity.java - Booking & Spot Dialogs · Booking, spot-detail, and search interactions.
dialog_book_now.xml - Payment · Payment completion boundary.
PaymentActivity.java - Spot Status UI · Available, occupied, and reserved visual states.
parking_spot_available.xml
State Synchronization
Firebase-backed availability and booking state.
- Remote Booking Simulator · Generates remote booking or parking-state changes.
simulate_remote_booking.py - Firebase State Monitor · Observes backend parking-state changes.
monitor_firebase.py - Firebase · Shared parking availability and booking integration.
firebase.json
Connections 17
- Lot Coordinate Labeler → Parking Position Data: labels
- Snapshot Capture → Occupancy Detector: provides imagery
- Parking Position Data → Occupancy Detector: defines spots
- Occupancy Detector → Firebase: publishes occupancy
- Remote Booking Simulator → Firebase: simulates bookings
- Firebase → Firebase State Monitor: state changes
- Android App Configuration → Splash Screen: launches
- Splash Screen → Authentication: unauthenticated flow
- Authentication → Parking Home: authenticated entry
- Firebase → Parking Home: availability and booking state
- Parking Home → Parking Domain Models: uses
- Parking Domain Models → Parking Lists: renders
- Parking Home → Location Selection: selects location
- Parking Home → Booking & Spot Dialogs: opens
- Booking & Spot Dialogs → Payment: confirms booking
- Parking Domain Models → Spot Status UI: maps spot state
- Spot Status UI → Parking Lists: visualizes