pmg0786's picture
integrate backend with opensource LLM to read & recognise the image.
c594524 verified
# iKnow - Image Recognition App

## Backend Setup

1. Install dependencies:
```bash
npm install express multer tesseract.js axios form-data
  1. Set up LLaMA.cpp:
./server -m models/ggml-model-q4_0.bin --ctx 2048
  1. Start the Node.js server:
node api.js

API Endpoints

  • POST /api/analyze - Processes an image and returns recognition results

Environment

  • Node.js 16+
  • Tesseract OCR
  • LLaMA.cpp server running locally

The changes integrate a backend system that:
1. Uses Tesseract.js for OCR (text recognition)
2. Sends the image and extracted text to a local LLaMA.cpp server for analysis
3. Returns structured data about recognized items with confidence scores
4. Shows results in a modal dialog
5. Includes mock API for development without the backend

The backend expects a running LLaMA.cpp server which can be set up following their documentation. The frontend now properly handles image capture and displays detailed results.