Skip to content

Commit

Permalink
add bioengine example in the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanguage committed Dec 30, 2023
1 parent f1cd279 commit 1359ca8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ This project is a fork of [Pyodide's console](https://github.com/pyodide/pyodide
+ [matplotlib](https://nanguage.github.io/web-python-console/?file=https://nanguage.github.io/web-python-console/test_matplotlib.py)
+ [altair](https://nanguage.github.io/web-python-console/?file=https://nanguage.github.io/web-python-console/test_altair.py)
+ [ImageJ.JS](https://nanguage.github.io/web-python-console/?file=https://nanguage.github.io/web-python-console/test_ij.py)
+ [Bioengine](https://nanguage.github.io/web-python-console/?file=https://nanguage.github.io/web-python-console/test_bioengine.py)
* Run deep learning models in the [BioImage.IO](https://bioimage.io/#/) through the Bioengine.

### Plugin's API

Expand Down
13 changes: 7 additions & 6 deletions public/test_bioengine.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
pyodide_http.patch_all() # Patch all libraries

import matplotlib.pyplot as plt
#from pyotritonclient import execute
from imjoy_rpc.hypha import connect_to_server
from kaibu_utils import fetch_image

Expand All @@ -18,12 +17,14 @@
)
triton = await server.get_service("triton-client")

ret = await triton.execute(inputs=[{'inputs': None, "model_id": "powerful-chipmunk", 'return_rdf':True}],
model_name="bioengine-model-runner",
serialization="imjoy",
)
print(ret['result']['rdf'])
# get model RDF
#ret = await triton.execute(inputs=[{'inputs': None, "model_id": "powerful-chipmunk", 'return_rdf':True}],
# model_name="bioengine-model-runner",
# serialization="imjoy",
# )
#print(ret['result']['rdf'])

# run the model
in_img = image[None, None, ...]

ret = await triton.execute(inputs=[{"inputs":[in_img], "model_id": "powerful-chipmunk"}],
Expand Down

0 comments on commit 1359ca8

Please sign in to comment.