Hops error when using Rhino Inside

Hi,
I tried to use rhino inside with hops as I want to use rhinocommon and python external library such as open3d, numpy, and convert it back and forth between rc and the library. Currently, I used ghpythonremote. It works, but when lets say I convert pts3d from rhinocommon to nparray, it takes a lot of time.

So, I am wondering if it is possible to use rhinoinside with hops?
below are the sample code:

from flask import Flask
import ghhops_server as hs

import rhinoinside
rhinoinside.load()
import System  # noqa
import Rhino  # noqa

# register hops app as middleware
app = Flask(__name__)
hops = hs.Hops(app)

@hops.component(
    "/test",
    name="test",
    description="create Line",
    #icon="examples/pointat.png",
    inputs=[
        hs.HopsPoint("p1"),
        hs.HopsPoint("p2"),
    ],
    outputs=[
        hs.HopsLine("l"),
    ]
)

def main(pt1, pt2):
    return Rhino.Geometry.Line(pt1, pt2)

if __name__ == "__main__":
    app.run()

However, somehow it show an error as below:

anyone know what is the issue? I guess I missing something…

Here is the python file:
app.py (589 Bytes)

Thanks