Skip to main content

Deploy and access image and data processing models via HTTPS.

Project description

Nahual: Deploy and access image and data processing models across environments/processes.

Note that this is early work in progress.

This tool aims to provide a one-stop-shop source for multiple models to process imaging data or their derivatives. You can think of it as a much simpler ollama but for biological analyses, deep learning-based or otherwise.

Implemented tools

By default, the models and tools are deployable using Nix.

  • Baby: Segmentation, tracking and lineage assignment for budding yeast.

WIP tools

  • trackastra: Transformer-based models trained on a multitude of datasets.
  • DINOv2: Generalistic self-supervised model to obtain visual features.

Minimal example for FastAPI-based server+client

Any model requires a thin layer that communicates using [[https://github.com/nanomsg/nng][nng]].

This is the server side

import numpy
import orjson
from fastapi import FastAPI, Request, Response

app = FastAPI()

@app.post("/process")
async def process(request: Request):
    # Convert list to numpy array
    array = numpy.asarray(orjson.loads(await request.body()))
    # Example processing, here is where processing is performed
    result = array * 2
    return Response(
        orjson.dumps(result, option=orjson.OPT_SERIALIZE_NUMPY),
    )

This is the client side

import numpy
import orjson
import requests

# Serialize a numpy array using orjson (faster json serialization)
serial_numpy = orjson.dumps(
    numpy.array([[1, 2], [3, 4]]),
    option=orjson.OPT_SERIALIZE_NUMPY,
)
response = requests.post(
    "http://localhost:8000/process",
    serial_numpy,
)
print(orjson.loads(response.content))
# [[2, 4], [6, 8]]

Why nahual?

logo

In Mesoamerican folklore, a Nahual is a shaman able to transform into different animals.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nahual-0.0.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nahual-0.0.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file nahual-0.0.1.tar.gz.

File metadata

  • Download URL: nahual-0.0.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.30

File hashes

Hashes for nahual-0.0.1.tar.gz
Algorithm Hash digest
SHA256 961bf42a6e82297764211f2dda07a3a000d7389beb365228aeb30ce7d3936d36
MD5 ffa529913452b81db00862132ca7831f
BLAKE2b-256 a2c022b6d48ee959278785f202ac3718fdfb0da0d756efbf9fb8a661608a851c

See more details on using hashes here.

File details

Details for the file nahual-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: nahual-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.30

File hashes

Hashes for nahual-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e842cc053b7c6cddb75310e128f5c9fd2fb77941f39a3735344cc7c69253bc0e
MD5 d52a13c811997bb5401fc82f8f057e9f
BLAKE2b-256 10f8266b370626710291bd3bdf17a37e29f79b128071811e6db83230b255a3de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page