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 that integrates into an agentic n8n workflow, storing results and embeddings in MongoDB Atlas.
git clone <your-repo-url>
cd palm-oil-ai
python -m venv venv
# Windows: venv\Scripts\activate | Mac: source venv/bin/activate
pip install -r requirements.txt
/datasets folder.Ensure your data.yaml matches the local paths:
train: ../datasets/train/images
val: ../datasets/valid/images
To train locally without hanging your PC, use the throttled script:
python train_script.py
runs/detect/train/weights/best.pt.best.pt to the root directory for the server to use.python main.py
The server will start at http://localhost:8000.
POST /detectfile, Value: image.jpg)The n8n workflow follows this logic:
localhost:8000/detect.├── datasets/ # Labeled images from Roboflow
├── runs/ # YOLO training logs and weights
├── main.py # FastAPI Inference Server
├── train_script.py # Local training configuration
├── best.pt # The "Brain" (Trained Model)
├── requirements.txt # dependencies
└── README.md # You are here