Perfect πŸ‘ thanks for clarifying β€” let’s keep it **venv only**. I’ll adjust the README so your teammates can just follow **one clean workflow** with `python -m venv`. --- # πŸ› οΈ CityPulse Backend – Hackathon Prototype Smart citizen-driven urban maintenance platform powered by **Computer Vision + Generative AI**. This backend runs fully **locally** (no cloud required). --- ## πŸš€ Features * Citizen submits an image of an issue (pothole, streetlight, trash, signage). * AI auto-classifies the issue + assigns severity. * Ticket saved in local SQLite DB. * API endpoints for citizens (report/status) and admins (tickets/analytics). * Supports both **CPU-only** (safe) and **GPU-accelerated** (NVIDIA CUDA). --- ## πŸ“¦ Requirements * Python **3.11+** (works on 3.8–3.12) * `venv` for virtual environment * (Optional) NVIDIA GPU with CUDA 11.8 or 12.1 drivers --- ## βš™οΈ Setup Instructions ### 1. Clone repository ```bash git clone https://github.com/yourteam/fixmate-backend.git cd fixmate-backend ``` ### 2. Create & activate virtual environment ```bash python -m venv venv ``` **Windows (PowerShell):** ```bash venv\Scripts\activate ``` **Linux/macOS:** ```bash source venv/bin/activate ``` --- ### 3. Install dependencies #### Option A – CPU only (safe for all laptops) ```bash pip install -r requirements.txt pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu ``` #### Option B – GPU (if you have NVIDIA + CUDA) Check your driver version: ```bash nvidia-smi ``` * If CUDA 12.1: ```bash pip install -r requirements.txt pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 ``` * If CUDA 11.8: ```bash pip install -r requirements.txt pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 ``` --- ## πŸ§ͺ Verify Setup Run the PyTorch check script: ```bash python Backend/test/check_torch.py ``` Expected output: * CPU build: ``` πŸ”₯ PyTorch version: 2.8.0+cpu πŸ–₯️ CUDA available: False ``` * GPU build: ``` πŸ”₯ PyTorch version: 2.8.0 πŸ–₯️ CUDA available: True -> GPU name: NVIDIA GeForce RTX 3060 ``` --- ## ▢️ Run Backend Server ```bash uvicorn app.main:app --reload ``` Open Swagger API docs at: πŸ‘‰ [http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs) --- ## πŸ“· Test ML Detection Run detection test on a sample image: ```bash python Backend/test/test_detect.py --image ./test_images/pothole.jpg ``` Outputs: * If YOLO model works β†’ JSON with detections. * If fallback β†’ Heuristic result (pothole-like / dark-image). --- ## πŸ“‚ Project Structure ``` fixmate-backend/ │── README.md │── requirements.txt │── models/ # YOLO weights (downloaded here) │── data/ # SQLite DB + sample images │── app/ β”‚ β”œβ”€β”€ main.py # FastAPI entrypoint β”‚ β”œβ”€β”€ models.py # SQLAlchemy models β”‚ β”œβ”€β”€ schemas.py # Pydantic schemas β”‚ β”œβ”€β”€ database.py # DB connection (SQLite) β”‚ β”œβ”€β”€ routes/ # API routes β”‚ └── services/ # AI + ticket logic │── Backend/test/ β”‚ β”œβ”€β”€ check_torch.py # Verify torch GPU/CPU β”‚ └── test_detect.py # Run YOLO/heuristic on image ``` --- ## πŸ‘₯ Team Notes * First run may take time (downloads YOLO weights into `./models/`). * Keep everything local (SQLite + images) for hackathon. * If no GPU available, always use CPU build. --- # References 1) https://pyimagesearch.com/2025/07/21/training-yolov12-for-detecting-pothole-severity-using-a-custom-dataset/?utm_source=chatgpt.com 2) https://universe.roboflow.com/aegis/pothole-detection-i00zy/dataset/2# πŸ‘‰ Do you want me to now also generate the **`requirements.txt`** file that matches this README so you don’t have to guess the dependencies?