Skip to content

A desktop application that provides medicine information from an image of label on medicine blister packet (backside).

Notifications You must be signed in to change notification settings

ayyp1/Medicine-Label-analysis-NER

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💻 Minor-Project

  • A desktop application.
  • Upload image of backside of medicine blister packet (with label information printed).
  • Detailed information about medicine and it's consumption from reliable source.
  • Medicine collection from Nepalese Authority.

📋 Table of Contents


🛠️ Requirements

  • Tkinter
  • PaddleOCR
  • SpaCy
  • MySQL
  • OpenCV
  • Pillow
  • Matplotlib
pip install -r requirements.txt

📷 Snapshots

Image 1 Image 2

👉 How to Use

To run the notebooks locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/xaxm007/Minor-Project.git
    cd Minor-Project
  2. Install the required dependencies:

    Create a conda env:

    conda create -n <your-environment-name>
    pip install -r requirements.txt

    or create conda environment medsys using environment.yml file.

    conda env create -f environment.yml
  3. Setup MySQL database:

    1. Install MySQL Server on your local machine and start the server.

    2. Open MySQL with --local-infile enabled:

      mysql --local-infile=1 -u <your-username> -p
    3. Create Database and Load CSV file:

      CREATE DATABASE  <your-database-name>;
      USE <your-database-name>;
      CREATE TABLE <your-table-name> (
         ID INT PRIMARY KEY,
         DRUG_NAME TEXT,
         DOSAGE_FORM_AND_STRENGTH LONGTEXT,
         INDICATIONS LONGTEXT,
         CONTRAINDICATIONS_OR_PRECAUTIONS LONGTEXT,
         DOSAGE_SCHEDULE LONGTEXT,
         ADVERSE_EFFECTS LONGTEXT,
         DRUG_AND_FOOD_INTERACTIONS LONGTEXT
      );
      SHOW tables;
      DESCRIBE <your-table-name>;
      LOAD DATA LOCAL INFILE '/path/to/data.csv'
      INTO TABLE med_info
      FIELDS TERMINATED BY ','
      ENCLOSED BY '"'
      LINES TERMINATED BY '\n'
      IGNORE 1 ROWS;

      or create database medicine and table med-info using setup.sql file.

      Note: adjust the CSV file path if necessary

      cd Database/sql
      source setup_db.sql;

      or create same database as the actual implementation using database_copy.sql file.

      cd Database/sql
      source database_copy.sql
  4. Run Python Script:

    cd GUI/tkinter-app

    Note: Fill your username and password in line 181 in app.py to run the app.

    conda activate <your-environment-name>
    python app.py

    Citation: If you use our code or our dataset please cite us.

    @software{Medicine Label Extraction and Analysis  ,
    author = {Pokharel, A.K and  Maharjan, Saksham},
    month = {10},
    title = {{Medicine Label NER}},
    url = {https://github.com/ayyp1/Medicine-Label-analysis-NER},
    version = {1.0.1},
    year = {2023}

About

A desktop application that provides medicine information from an image of label on medicine blister packet (backside).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 98.9%
  • Python 1.1%