A service to detect if a given image of palm is ripe or not. A R&D initiated for Swopt

Dr-Swopt 0832da840f updates il y a 4 jours
.gitignore ebcabef0d7 basic setup and trained data il y a 4 jours
README.md 0832da840f updates il y a 4 jours
Streamlit.md ebcabef0d7 basic setup and trained data il y a 4 jours
best.pt ebcabef0d7 basic setup and trained data il y a 4 jours
demo_app.py ebcabef0d7 basic setup and trained data il y a 4 jours
main.py 0832da840f updates il y a 4 jours
test_model.py ebcabef0d7 basic setup and trained data il y a 4 jours
train_script.py 6dc23e13aa simple setup il y a 4 jours
yolov8n.pt 6dc23e13aa simple setup il y a 4 jours

README.md

✅ Updated README.md (Copy/Paste this)

🌴 Palm Oil Ripeness Agent (n8n + YOLOv8)

This project uses a custom-trained YOLOv8 model to detect the ripeness of Palm Oil Fresh Fruit Bunches (FFB). It features a local Python FastAPI server and a Streamlit Dashboard, both integrated into an agentic n8n workflow.

🚀 Project Overview

  1. Vision Engine: YOLOv8 Nano (Custom-trained on MPOB-standard datasets).
  2. Inference Server: FastAPI (Python) for n8n integration.
  3. Demo Dashboard: Streamlit UI for drag-and-drop batch testing.
  4. Intelligence: MongoDB Atlas Vector Search for similarity-based reasoning.

🛠 Prerequisites

  • Python 3.10+
  • n8n (Desktop or Self-hosted)
  • MongoDB Atlas Account (with Vector Search index enabled)

📦 Setup Instructions

1. Environment Setup

git clone <your-repo-url>
cd palm-oil-ai
python -m venv venv
# Windows: venv\Scripts\activate | Mac: source venv/bin/activate
pip install ultralytics fastapi uvicorn streamlit python-multipart pillow

2. Dataset & Training

  1. Download the dataset from Roboflow *Or you can also find your own separate source of datasets. Make sure the file/folder format structure is consistent, especially the .yaml file.
  2. Extract into /datasets.
  3. Train the model:

    python train_script.py
    
    
    1. Copy the resulting best.pt from runs/detect/train/weights/ to the project root.

    3. Running the Demo (Streamlit)

    To show the interactive dashboard to colleagues:

    streamlit run demo_app.py
    
    
  • Local URL: http://localhost:8501

4. Running the API for n8n

To connect your AI to n8n workflows:

python main.py

  • Endpoint: POST http://localhost:8000/detect
  • Payload: Form-data with key file.

📂 Repository Structure

├── datasets/           # Labeled images (Train/Valid/Test)
├── runs/               # YOLO training logs and output weights
├── main.py             # FastAPI Inference Server (for n8n)
├── demo_app.py         # Streamlit Dashboard (for demos)
├── train_script.py     # Throttled training configuration
├── best.pt             # THE BRAIN: The trained model weights
└── README.md           # Documentation