HumanSignal / HumanSignal/label-studio

Importing pre annotated data with png masks

Open
#6,553 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

I am new to labelstudio and i am having issues importing. I have gotten a pre-annotated dataset from a colleague that is using a different licensed software that i do not have access to so i am trying to use labelstudio. They have sent the JPG images in image folder and masks as png files in a mask folder. I have only 2 classes so label is either the item i want to mark (white pixels) or just background (black pixels). so the whole mask png is just a black box with white parts in it.

**To Reproduce**
1. Have files in this path
C:\Users\User\Project1\dataset\
├── image\
│ ├── 10.JPG
│ ├── 11.JPG
└── mask\
├── 10.png
├── 11.png

2. Set env variables for label studio

```
set LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true
set LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT="C:\\Users\\User\\Project1\\"
```

4. Set source location in project settings
Storage type: Local files
Local path: C:\Users\User\Project1\dataset
File filter regex: empty
Do not sync

5. Set Label interface

```




```

6. Import the Json file

```
[
{
"data": {
"image": "/data/local-files/?d=dataset/image/10.JPG"
},
"predictions": [
{
"model_version": "v1",
"result": [
{
"from_name": "label",
"to_name": "image",
"type": "brushlabels",
"value": {
"format": "png",
"brushlabels": ["item", "background"],
"mask": "/data/local-files/?d=dataset/mask/10.png"
}
}
]
}
]
},
{
"data": {
"image": "/data/local-files/?d=dataset/image/11.JPG"
},
"predictions": [
{
"model_version": "v1",
"result": [
{
"from_name": "label",
"to_name": "image",
"type": "brushlabels",
"value": {
"format": "png",
"brushlabels": ["Class1", "Class2"],
"mask": "/data/local-files/?d=dataset/mask/11.png"
}
}
]
}
]
}
]
```

**Expected behavior**
I expect to see the premade annotations on the predictions tab but it is just empty, no labels no masks. I can see the images just fine, so i assume local storage connection is okay and path names are fine. label studio does create a prediction model called "v1" as well but when i look at the prediction for the task it is empty. I want to just upload the premade masks as "predictions" so i can just copy the predictions as actual results and look at the dataset my colleague made

Have also tried to convert the pngs to rle's and base64's hoping labelstudio would recognise that but same result. Predictions are just empty masks with no labels or marks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.