Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastapi model serving #53

Merged
merged 11 commits into from
Dec 4, 2024
Merged

Fastapi model serving #53

merged 11 commits into from
Dec 4, 2024

Conversation

metazool
Copy link
Collaborator

A rough prototype for an API which returns embeddings and classification from a choice of endpoints, each for a different model.

See #52 for notes on the thinking around adding this to one or more pipelines. Definitely an unsophisticated prototype, reusing existing functions plus small parts of https://github.com/alan-turing-institute/ViT-LASNet

To test

Note this assumes that the model weights for the new Turing models #45 are not available where the test is running!

py.test test/test_model_api.py

Run the API and send it an image URL, get back embeddings

python src/cyto_ml/models/api.py
curl -d url="https://cdn.oceanservice.noaa.gov/oceanserviceprod/facts/nasa-copepod.jpg" http://localhost:8081/resnet50/

To run with the Resnet18 weights, see this note https://github.com/alan-turing-institute/ViT-LASNet/tree/main/test and the linked issue here alan-turing-institute/ViT-LASNet#2 - for now a manual stage of downloading them from Google Drive and copying into ./data/weights - option is to package this as a container

@metazool
Copy link
Collaborator Author

metazool commented Dec 4, 2024

This is still really a draft but I'd like to merge it and revise from there; I've got another branch taken from this one with a lot of aligned work on it which I'd like to request critical review on...

@metazool metazool merged commit 3c4c09d into main Dec 4, 2024
2 checks passed
@metazool metazool deleted the fastapi-model-serving branch December 11, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant