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

Is using LSF on its own but still able to connect to ML backend possible? #6940

Open
yeeyaa opened this issue Jan 21, 2025 · 2 comments
Open

Comments

@yeeyaa
Copy link

yeeyaa commented Jan 21, 2025

Hi Community, I understand we could use LSF on it's own for an editor to embedded in another web page to annotate data.
However, I did not find any information about how we are able to use LSF while still being able to connect to the backend ML models you guys made available here: https://github.com/HumanSignal/label-studio-ml-backend

So my questions is, is it possible to use the embedded LSF while still being able to connect to the backend ML models? If it's possible, is there any documentation I can refer to to get it done?

@yeeyaa yeeyaa changed the title Use LSF on its own Is using LSF on its own but still able to connect to ML backend possible? Jan 22, 2025
@heidi-humansignal
Copy link
Collaborator

Hi there!

Thanks for reaching out. Label Studio Frontend (LSF) by itself is purely a JavaScript library for rendering the annotation interface in a browser and doesn’t include an API layer to interact directly with the Label Studio ML Backend. In other words, if you want to embed just the LSF library into your own webpage, it won’t automatically communicate with the ML backend.
The ML backend wraps your model with a server that expects requests from the full Label Studio Backend (the Django/Python service). So if you need to use those ML integrations from the label-studio-ml-backend repository, you have two main options:

  1. Run the full Label Studio Backend (which in turn connects to your ML backend). Then you can point your LSF interface at the Label Studio API. That way, LSF routes requests through the Label Studio Backend, which then calls the ML backend to provide predictions.
  2. Implement your own middleware to mimic how Label Studio sends tasks to the ML backend. Essentially, you’d build a custom REST API in your own server, passing data and user actions from your embedded LSF to your custom server, and then forwarding requests to the label-studio-ml-backend. This requires replicating the data formats and logic that Label Studio standards provide, but it’s entirely possible if you want full control.
    Unfortunately, there isn’t an official guide for bridging an embedded LSF directly with label-studio-ml-backend without also using the Label Studio Python backend. The simplest route to guaranteeing ML predictions and auto-labeling is to run the Label Studio Backend in addition to your ML backend, then embed LSF by pointing it to the Label Studio APIs.

Thanks,

Tyler Conlee
Head of Support
HumanSignal

Comment by Tyler Conlee
Workflow Run

@yeeyaa
Copy link
Author

yeeyaa commented Jan 23, 2025

Hi Tyler,

Thank you very much for your detailed and informative response. I really appreciate the time you took to explain the relationship between Label Studio Frontend (LSF) and the ML backend, as well as the options available for integrating them.

Your suggestions are very helpful. I will carefully consider the two approaches you mentioned—running the full Label Studio backend or implementing a custom middleware solution. I understand that using the Label Studio backend is the simplest way to ensure seamless integration and functionality, but I will also explore the custom middleware option to see if it can provide the flexibility we need for our project.

If you have any additional tips or resources that might help us get started, especially with running the full LS backend approach, I would be very grateful.

Simon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants