HumanSignal / HumanSignal/label-studio
How is the task id from the frontend passed to the REST api of the backend and then to the ML backend?
- Dominant language
- TypeScript
- Stars
- 28.3k
- Forks
- 3.7k
- Avg merge
- 14h
- Merged PRs (30d)
- 15
Description
I would really appreciate some help on the question how the task id from the frontend is passed to the REST api of the backend and then to the ML backend.
So more detailed: When I click on a task in the browser I get the predicted annotation from my interactive ML backend (that works already). I thought in order for that to work the DataManager.jsx sends the task id to the backend and requests the task data there, the task data is added and the ml/api.py sends both to the predict endpoint of the ML backend.
In the DataManager.jsx this part looks like the right one to me, because "mlInteractive" sounds like the appropriate endpoint:
if (interactiveBacked) {
dataManager.on("lsf:regionFinishedDrawing", (reg, group) => {
const { lsf, task, currentAnnotation: annotation } = dataManager.lsf;
const ids = group.map((r) => r.cleanId);
const result = annotation.serializeAnnotation().filter((res) => ids.includes(res.id));
const suggestionsRequest = api.callApi("mlInteractive", {
params: { pk: interactiveBacked.id},
body: {
task: task.id,
context: { result },
},
});
But it appears to be triggered on regionFinishedDrawing..which does not sound right, given that the prediction is triggered in my case by opening a task.
Could you provide me the route on which the task.id and finally the task is passed to the ML backend for the prediction in cases where the whole process is initiated by a click on the task and with an interactive backend?
Thanks so much in advance!
Contributor guide
Assessment
This issue has not been assessed yet.