A service to detect if a given image of palm is ripe or not. A R&D initiated for Swopt
|
|
3 hari lalu | |
|---|---|---|
| src | 3 hari lalu | |
| .env | 3 hari lalu | |
| .gitignore | 4 hari lalu | |
| LICENSE | 3 hari lalu | |
| README.md | 3 hari lalu | |
| Streamlit.md | 4 hari lalu | |
| best.pt | 4 hari lalu | |
| demo_app.py | 4 hari lalu | |
| gemini-embedding-service-key.json | 3 hari lalu | |
| main.py | 3 hari lalu | |
| requirements.txt | 3 hari lalu | |
| test_model.py | 4 hari lalu | |
| train_script.py | 4 hari lalu | |
| yolov8n.pt | 4 hari lalu |
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 architected with Domain-Driven Design (DDD) for maximum flexibility and scalability in an agentic n8n workflow.
multimodalembedding@001).# Clone and enter the repository
git clone <your-repo-url>
cd palm-oil-ai
# Create and activate virtual environment
python -m venv venv
.\venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
.env)Ensure your .env file is populated with the following keys:
MONGO_URI: Your MongoDB Atlas connection string.PROJECT_ID: Your Google Cloud Project ID.LOCATION: Vertex AI location (e.g., us-central1).DB_NAME: MongoDB database name.COLLECTION_NAME: MongoDB collection name.GOOGLE_APPLICATION_CREDENTIALS: Path to your GCP service account JSON key.The API acts as the bridge for n8n or mobile integrations. You can start it using the root wrapper:
# Start the FastAPI server
python main.py
Alternatively, run as a module: python -m src.api.main
For manual testing and visual analysis:
# Start the Streamlit app
streamlit run demo_app.py
| Endpoint | Method | Description |
|---|---|---|
/detect |
POST |
Fast Inference: Returns YOLO detection results (JSON). |
/analyze |
POST |
Full Process: Detection + Vertex AI Vectorization + MongoDB Archival. |
/get_confidence |
GET |
Retrieve the current AI confidence threshold. |
/set_confidence |
POST |
Update the AI confidence threshold globally. |
├── src/
│ ├── api/ # FastAPI entry points & route handlers
│ ├── application/ # Use Cases & Orchestration logic
│ ├── domain/ # Business Logic, Entities, & Core models
│ └── infrastructure/ # External integrations (MongoDB, VertexAI)
├── datasets/ # Labeled images (Train/Valid/Test)
├── runs/ # YOLO training logs and output weights
├── best.pt # THE BRAIN: Trained model weights
├── requirements.txt # Python dependencies
├── .env # Configuration state
├── LICENSE # MIT License
└── README.md # You are here
This project is licensed under the MIT License - see the LICENSE file for details.