Multi-agent Copilot backend and user-friendly frontend for digital pathology.
651
I-viewer copilot is a comprehensive online framework designed to address the needs of collaborative pathology analysis while harnessing the power of AI. I-viewer deployed advanced real-time AI-agents for different tasks and relies on MLLM for information integration and Human-AI collaboration.
In order to use the I-Viewer frontend on your localhost or server, you may need to edit the following files after cloning the repository:
git clone https://github.com/DanniCQ/iviewer_laravel_copilot.git
and pull those pre-built images to save time
docker pull dannicq/iviewer_laravel_copilot:iviewer-nuclei
docker pull dannicq/iviewer_laravel_copilot:iviewer-hdyolo
docker pull dannicq/iviewer_laravel_copilot:iviewer-copilot
docker pull dannicq/iviewer_laravel_copilot:iviewer-annotation
docker pull dannicq/iviewer_laravel_copilot:iviewer-deepzoom
docker pull dannicq/iviewer_laravel_copilot:iviewer-ui
Before editing those files, you need to change the ownership of the laravel_smp folder to the user with ID 1004.
chown -R 1004 laravel_smp
.env FileLocation: Root of the downloaded folder (iviewer-copilot).
DB_DATABASE, DB_USERNAME, DB_PASSWORD: These are used to create the database in a container..env FileLocation: Inside the laravel_smp folder.
# Image_PATH. If you want the website to be accessible beyond localhost, change localhost to your IP address. If you have other services running on port 80, assign another port but ensure this port matches the port configured in the Nginx file (nginx/iviewer.config line 2 listen port;).IMAGE_PATH=http://localhost:5000/images/
# API to change the API_IP or service port. Ensure the port matches the one specified in each Dockerfile in the folders: deepzoom, annotation, nuclei, copilot.db/my.cnf). Ensure the port specified here matches the one in db/my.cnf so the Laravel website can find the MySQL service. Also, make sure the DB_DATABASE, DB_USERNAME, DB_PASSWORD are the same as in the main .env file to load and use the database.Location: db/my.cnf
Location: nginx/iviewer.config
Navigate to the iviewer-laravel-copilot folder:
cd iviewer-laravel-copilot
Edit the two .env files, mysql configure file and nginx configure file as described above.
Start the Docker containers:
docker compose up -d
Run the initialization script to generate the Laravel key and load default data such as the login user and default images:
./cmd.sh
Access the Application
Open your browser and go to http://localhost:port or http://ip:port.
Or view a demo by opening the ./templates/index.html
logging into iViewer Default login credentials: Admin login:
Admin privileges include access to additional options in the menu:
Regular user login:
Regular users can only view images.
cd iviewer-laravel-copilot/laravel_smp/public/images/original/
mkdir projectname
cd projectname
mkdir batchname
uuid (make it unique)sys_image_file_name (e.g., example.svs)project_codename (same as the project folder you created)dataset_codename (same as the batch folder you created)After your containers are running, it may take some time for the chat API to become available. If you encounter a 404 error, please close it and try again later.
User can add their own pipeline into I-Viewer with offline interface and online interface. Basically it takes three steps:
## Create a generator agent
class GeneratorAgent:
def prepare_inputs(self, requests):
request_params = decode(requests)
boxes = get_bbox(request_params)
roi_image = get_roi_tile(request_params)
...
return {'roi_image': roi_image, 'boxes': boxes, ...}
def analysis_offline(self, inputs):
serialized_item = serialize(inputs)
await redis_client.stream_push(registry, serialized_item)
def analysis_online(self, inputs):
outputs = agents.analysis_online(inputs)
return Response(outputs)
## Create a analysis agent
class AnalysisAgent:
def predict(self, inputs):
return pipeline(inputs)
def analysis_offline(self):
serialized_item = redis_client.stream_fetch(registry)
inputs = deserilize(serialized_item)
outputs = self.predict(inputs)
export_to_db(postprocess(outputs))
def analysis_online(self, inputs):
outputs = self.predict(inputs)
return postprocess(outputs)
## Register model and generator
MODEL_REGISTRY = ModelRegistry()
MODEL_REGISTRY.register("registry_name", "model", AnalysisAgent)
MODEL_REGISTRY.register("registry_name", "generator", GeneratorAgent)
Content type
Image
Digest
sha256:3344a8e50…
Size
340.9 MB
Last updated
over 2 years ago
docker pull dannicq/iviewer_laravel_copilot:iviewer-ui