--- title: Brain Tumour Detection emoji: 🦀 colorFrom: gray colorTo: red sdk: gradio sdk_version: 5.16.0 app_file: app.py pinned: false license: mit --- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference # 🧠 Brain Tumor Detection using YOLOv8 🎯 ## 🚀 Overview This **Hugging Face Space** allows users to **upload MRI scan images** and detect the presence of a **brain tumor** using the **YOLOv8** object detection model. The model processes the uploaded image and provides an annotated output indicating whether a tumor is detected. 🔹 **Built with:** `YOLOv8` | `Gradio` | `PyTorch` | `OpenCV` 🔹 **Live on Hugging Face Spaces!** ✅ ## ✨ Features ✔️ **Upload MRI scan images** 🏥 ✔️ **YOLOv8-powered brain tumor detection** 🧠 ✔️ **Annotated image output with tumor detection** 📸 ✔️ **Real-time diagnosis message** ⏳ ✔️ **Simple & intuitive UI powered by Gradio** 🎨 --- ## 🛠 How to Use 1️⃣ **Upload an MRI image** by clicking the "Upload MRI Image" button. 2️⃣ **Click "Submit"** to analyze the image. 3️⃣ **View the results**: - The uploaded MRI image with **bounding boxes** (if a tumor is detected). - A **diagnosis message** ("Tumor Detected" or "No Tumor Detected"). ✅ **No installation required!** Just visit the Hugging Face Space and start detecting brain tumors instantly. --- ## 📁 Model Details This app uses **YOLOv8**, an advanced object detection model fine-tuned for **brain tumor detection**. - **Default model:** `yolov8n.pt` (Replace with `best.pt` for custom-trained model). - **Bounding box output** with confidence score. - **Fast & accurate inference** using PyTorch. --- ## 🏗 Deployment on Hugging Face Spaces ### **1️⃣ Create a New Hugging Face Space** Go to **[Hugging Face Spaces](https://huggingface.co/spaces)** and create a new **Gradio** Space. ### **2️⃣ Upload the following files:** - **`app.py`** (Main Gradio app) - **`requirements.txt`** (Dependencies) - **`model/best.pt`** (Your trained YOLOv8 model) ### **3️⃣ Run the Space!** Hugging Face will **automatically install dependencies** and deploy the app. --- ## 📜 Dependencies (Auto-installed in Hugging Face) ```text gradio torch torchvision ultralytics opencv-python numpy