Spaces:
Sleeping
Sleeping
metadata
title: PharmaScan AI Backend
emoji: π‘οΈ
colorFrom: blue
colorTo: indigo
sdk: docker
pinned: false
app_port: 7860
π‘οΈ PharmaScan AI β Vision-Based Fake Medicine Detection
PharmaScan AI is an advanced vision-based pharmaceutical safety platform that uses OCR (Tesseract), Computer Vision (OpenCV), and Deep Learning (PyTorch) to identify counterfeit medicines.
Check out the FastAPI REST API Documentation for mobile app integration.
π Key Features
- Vision Scanner: OCR-based text analysis for identifying spelling errors and missing label details.
- Counterfeit Detection: Heuristic analysis for image sharpness, color richness, and label density.
- Safety Badge: Downloadable HTML authenticity certificates for genuine products.
- Drug Interactions: (Optional) Integration with clinical drug interaction checkers.
- Admin Dashboard: Visual insights into scan hotspots and safety trends.
π οΈ Deployment on Hugging Face (Docker)
This Space is built using Docker to ensure Tesseract OCR and OpenCV are configured correctly in the cloud environment.
Local Setup
To run this backend locally:
pip install -r requirements.txt
streamlit run medicine.py
API Usage
The FastAPI backend runs alongside the dashboard. Use the following endpoint to scan images:
POST /scan: Upload an image to analyze medicine authenticity.
π¦ Tech Stack
- Dashboard: Streamlit
- API: FastAPI
- ML Engine: PyTorch (.pth model)
- Computer Vision: OpenCV + Tesseract OCR
- Database: SQLite (Stored in
pharmascan.db)
Disclaimer: This is an AI research prototype. Always consult a licensed pharmacist or doctor for official medical advice.