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

python api / backend #12

Open
ananis25 opened this issue Jun 10, 2022 · 2 comments
Open

python api / backend #12

ananis25 opened this issue Jun 10, 2022 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@ananis25
Copy link

(Apologies if this should rather go into the discussions tab)

Hi - I came across Marcelle from the citation in Apple's paper describing their Symphony framework. I have been looking into the docs and examples, and it looks super neat! I want to use Marcelle components and write new ones with computation backed by a python kernel. Python frameworks like Streamlit and Gradio have underpowered custom components or don't document them well.

I see documentation related to the python API but can't seem to find the related code. The example project iris-python only seems to run training offline in python and saving the model artifact rather than something that updates on interaction. Does the project scope includes bidirectional comms with python?

@JulesFrancoise
Copy link
Collaborator

Hi @ananis25,

My apologies for the late reply.

Thank you very much for your interest in Marcelle and for reaching out!

Indeed, we still need to document how Marcelle integrate with Python and to add more examples. I will summarize the capabilities of the current release and then outline some of the changes and features that are planned for the next release. According to your timeline, we can discuss how to proceed from there.

Currently, with the latest release (v0.5.1), the Python package provides an API to read and write data from a datastore over HTTP (the backend server must run on the same machine or be hosted somewhere). In particular, it includes:

  • A DataStore interface where you can interaction (CRUD) with datastore services (for example, the instances in a dataset). It is therefore easy to train a model in python from data that was captured with a web interface, or to write data from python, to be displayed in a custom interface.
  • A Writer interface, as well as a Keras callback, that enables you to record training runs to the datastore, enabling you to monitor the training process from a web interface, to compare training runs (e.g. with different parameters), and to record model snapshots to the backend, so that they can later be loaded. This works mostly with Tensorflow.js.

Regarding examples, you will find 2 examples in the demos where the training is done in Python, and the models run on the web using ONNX-runtime. You can also find the code for the demos associated with the UIST paper on Github, and the demos are available online. In the second demo, we have a more advanced use of datastores to synchronize models trained with Python.

Now regarding limitations of the current integration with Python: because the communication with data stores uses HTTP, Python code cannot react to events from the web interface. We started reworking the Python package to use Socket.io, meaning that we can have python code reacting to events in the interface. There will be a number of important changes in the next release.

Depending on your use case and timeline, I can either guide you through an example with the current release or the next one. In order to continue the conversation, could you give us more details about your project, so that we understand the scenario better? In particular, what you want to do with Python and what you want to control from the interface, what Python libraries you are using, etc?

Best,
Jules

@JulesFrancoise JulesFrancoise self-assigned this Jun 21, 2022
@JulesFrancoise JulesFrancoise added documentation Improvements or additions to documentation question Further information is requested labels Jun 21, 2022
@ananis25
Copy link
Author

ananis25 commented Jun 22, 2022

Hi Jules, thanks for replying.

We started reworking the Python package to use Socket.io, meaning that we can have python code reacting to events in the interface.

I think this is close to what I was looking for! My use case is building richer visualization tools for working with data, for example a bunch of cross linked charts so that interactions with parts of them trigger GUI changes, run analysis on the selected data, etc.

I think the difference with Marcelle (which I missed the first time) is that the app state is primarily server side (useful for large datasets), rather than in the browser. I wonder if that is in the roadmap for Marcelle?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants