Skip to content

Instantly share code, notes, and snippets.

View oeway's full-sized avatar

Wei Ouyang oeway

  • Science For Life Laboratory
  • Stockholm
View GitHub Profile
import sys, os
import imagej
import scyjava as sj
import argparse
import asyncio
import traceback
import numpy as np
import xarray as xr
from jpype import JOverride, JImplements
from imjoy_rpc.hypha import connect_to_server
<docs lang="markdown">
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "CodeInterpreter",
"type": "window",
"tags": [],
"ui": "",
<docs>
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "ImageViewerServices",
"type": "web-worker",
"tags": [],
"ui": "",
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oeway
oeway / README.md
Last active October 11, 2023 16:43

SAM for the BioEngine

Inference

Here are some files for converting SAM models to make it available in the BioEngine (local deployment: https://github.com/oeway/bioengine/).

The tree strcture for the model repository is like this:

├── sam-backbone
│ ├── 1
<docs lang="markdown">
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "React UI Plugin",
"type": "window",
"tags": [],
"ui": "",
<docs lang="markdown">
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "stlite Demo",
"type": "window",
"tags": [],
"ui": "",
import asyncio
import threading
from concurrent.futures import ThreadPoolExecutor
from imjoy_rpc.hypha import connect_to_server
import time
class BackgroundServer:
def __init__(self, server_url):
self.loop = None
# pip install imjoy-rpc numpy qrcode[pil]
# Code adopted from https://github.com/Khalil-Youssefi/qrcodeT/tree/master
# Released under MIT license
import qrcode
import numpy as np
def qrcode2text(img):
bindata = np.array(img)[::10,::10] + 0
if bindata.shape[0] % 2 != 0:

Hypha

Hypha is a server software for creating computational platforms consists of computational and user interface components.

Hypha server act as a hub for connecting different components through imjoy-rpc.

Installation

pip install hypha