Simple Web UI for MedImageInsight: Open-Source Medical Image Embedding Model

This repository is a (somewhat) clone of Lion AI MedImageInsights and shows how easily you can create a simple Web UI for the Model. I added some less CORS restriction to the fast api server and MPS Support (it was only CUDA before) for the medimageinsightmodel.py.

CUDA (Compute Unified Device Architecture) and MPS (Metal Performance Shaders) are two frameworks that enable GPU acceleration, but they are platform-specific:

  • CUDA is a parallel computing platform developed by NVIDIA. It provides tools and libraries specifically designed to utilize NVIDIA GPUs for intensive computations, making it a preferred choice for deep learning and AI on systems with NVIDIA hardware.

  • MPS (Metal Performance Shaders) is Apple’s framework for GPU-accelerated processing on macOS and iOS. It provides GPU support for Metal-compatible devices, including Apple's own hardware (like M1/M2 chips). Using MPS allows machine learning models to run on Apple hardware without needing an NVIDIA GPU.

In this Web UI, MPS support has been added to make the tool accessible on Apple devices with Metal-compatible GPUs, not just on NVIDIA GPUs with CUDA.

Long story short: If you are on a Mac, you might get better performance with MPS. After running the Fast API you see "Using MPS backend for model execution." if its supported by our machine.

Known Issues

In the UI, selecting an URL does not always work due to CORS issues. Take local images to be save.

Screenshot

image/png image/png

General

Check out Lion AI MedImageInsights for further details.

Usage

  1. Clone the repository and navigate to the project directory.

Make sure you have git-lfs installed (https://git-lfs.com)

git lfs install
git clone https://huggingface.co/frappierer/Simple_MedImageInsights_Web_UI
  1. Install the required dependencies We are using uv package manager to simplify the installation. Also check out the UV Docs on how to setup UV.

  2. Run Fast API Server (My Simple Web UI will query against that server)

FYI:I had to add a CORS middleware to the API Server, so API request from localhost dont get blocked.

cd Simple_MedImageInsights_Web_UI

then run

uv run fastapi_app.py

That will take some time and you will see:

image/png

Optionally: Go to localhost:8000/docs to see the swagger API Doc.

  1. Open the index.html.

In the "Images" Folder I added some examples I found online.

Have fun.

Extend Labels

To Show more labels in the UI just edit the labels in script.js // Define your labels

const medicalLabels = [
...

Then refresh the index.html
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support