label-studio-frontend
label-studio-frontend copied to clipboard
Passing a list of images to a label studio component
Is it possible to pass multiple images or a list of images to Label studio component? Here is an example of the component for a single image.
var labelStudio = new LabelStudio('label-studio', {
config: `
<View>
<Image name="img" value="$image"></Image>
<RectangleLabels name="tag" toName="img">
<Label value="Hello"></Label>
<Label value="World"></Label>
</RectangleLabels>
</View>
`,
interfaces: [
"panel",
"update",
"controls",
"side-column",
"annotations:menu",
"annotations:add-new",
"annotations:delete",
"predictions:menu"
],
user: {
pk: 1,
firstName: "James",
lastName: "Dean"
},
task: {
annotations: [],
predictions: [],
id: 1,
data: {
image: "https://htx-misc.s3.amazonaws.com/opensource/label-studio/examples/images/nick-owuor-astro-nic-visuals-wDifg5xc9Z4-unsplash.jpg"
}
},
onLabelStudioLoad: function(LS) {
var c = LS.annotationStore.addAnnotation({
userGenerate: true
});
LS.annotationStore.selectAnnotation(c.id);
},
onSubmitAnnotation: function(LS, annotation) {
// retrive an annotation
console.log(annotation.serializeAnnotation())
}
});
Try to use this data:
data: {
image: ["http://x.com/1.jpg", "http://x.com/2.jpg", "http://x.com/3.jpg"]
}
in this case LS will allow to have multiple layers in one image, e.g. it's convenient for medical images.
Try to use this data:
data: { image: ["http://x.com/1.jpg", "http://x.com/2.jpg", "http://x.com/3.jpg"] }
in this case LS will allow to have multiple layers in one image, e.g. it's convenient for medical images.
After I switch to another image after processing one image, the annotations still remain. Shouldn't the expectation be that each image should have its own annotation?