Skip to content

Provides a powerful medicine pack analysis using ML and NLP to achieve accurate recognition of active ingredients and brand names

License

Notifications You must be signed in to change notification settings

SPerekrestova/MedsRecognition

Repository files navigation

MedsRecognition

MedsRecognition is a Django-based application designed to extract text from uploaded images using EasyOCR and identify active ingredients in medications by querying public APIs such as RxNav and OpenFDA. The application also integrates with Supabase for efficient data storage and management.

⚠️ Note: This project is a work in progress. Some features may not yet be fully implemented or finalized.


Table of Contents

  1. Features
  2. Prerequisites
  3. Installation
  4. How It Works
  5. APIs and Integrations
  6. Usage
  7. License
  8. Contact

Features

  • Upload images to extract text seamlessly.
  • Supports multiple image formats (e.g., JPEG, PNG).
  • Utilizes EasyOCR for highly accurate text recognition.
  • Matches recognized text with active ingredients using RxNav and OpenFDA APIs.
  • Integrates with Supabase for centralized storage and data management.

Prerequisites

  • Python 3.8+
  • Pip (Python package manager)
  • Supabase account and project configuration

Installation

  1. Clone the Repository:

    git clone https://github.com/SPerekrestova/MedsRecognition.git
    cd MedsRecognition
  2. Install Dependencies:

    pip install -r requirements.txt
  3. Set Up Supabase:

    • Create a Supabase project here.
    • Note your API key and project URL from the Supabase dashboard.
    • Add these values to your .env file:
      SUPABASE_URL=<your-supabase-url>
      SUPABASE_API_KEY=<your-supabase-api-key>
  4. Apply Migrations (if applicable):

    python manage.py migrate
  5. Run the Django Server:

    python manage.py runserver

How It Works

1. Upload Image

  • Users upload images containing text via the web interface. Supported formats include JPEG, PNG, and more.

2. Text Recognition

  • The uploaded image is processed using EasyOCR, which extracts text with support for multiple languages.

3. Database Matching

  • Extracted text is matched against a list of active ingredients fetched in real-time using the RxNav API and OpenFDA API.

4. Supabase Integration

  • Recognized text, extracted active ingredients, and associated metadata are securely stored in a Supabase database.
  • This allows for centralized data management and retrieval for analytics or future use.

5. Results Display

  • Matched active ingredients are displayed in a user-friendly interface, allowing for easy review and further use.

APIs and Integrations

1. Public APIs Queried:

  • RxNav API:

    • Provides a comprehensive database of active ingredients in medications.
    • Official documentation: RxNav API.
  • OpenFDA API:

    • Offers access to FDA drug, device, and food databases for additional validation and matching.
    • Official documentation: OpenFDA API.

2. Supabase Integration:

  • Supabase is used to store:
    • Uploaded image metadata
    • Recognized text
    • Matched active ingredients
    • User interaction history (optional)
  • Learn more: Supabase Documentation.

Usage

  1. Start the Django server:

    python manage.py runserver
  2. Open your web browser and navigate to:

    http://localhost:8000/
    
  3. Upload an image containing text.

  4. View the extracted text, matched active ingredients, and metadata.


License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.


Contact

Author: Svetlana Perekrestova
Email: [email protected]

Feel free to reach out with questions, suggestions, or feedback!

About

Provides a powerful medicine pack analysis using ML and NLP to achieve accurate recognition of active ingredients and brand names

Topics

Resources

License

Stars

Watchers

Forks