If I click on a data link - the broken Data + images in the last 2 line in picture above I get the error:
How can I have bots images and annotations?
What is the error you get when you try to import and “Treat every bucket object as a source file” is not selected?
I believe that because this option is selected, it is why the annotations and images are not being formed as one task
It makes sense, but when I export the json file contains:
"file_upload": "bc5b3ad0-7e0dcaed-Ar1_Dd_d5.JPG",
"drafts": [],
"predictions": [],
"data": {
"image": "/data/upload/22/bc5b3ad0-7e0dcaed-Ar1_Dd_d5.JPG"
},
although the files are stored into a windows directory (d:\data.…) and the file names are just Ar1_Dd_d5.JPG
, not the two random-looking ids with dashes prepended: bc5b3ad0-7e0dcaed-Ar1_Dd_d5.JPG
.
How do I enforce the exported LS JSON file to contain the correct directory path?
When you do not select “Treat every bucket object as a source file” and get a “status: Failed” error, it typically means that Label Studio is not able to correctly interpret the files in the storage. This option should be unchecked to avoid creating tasks for each image automatically, but you need to ensure that the paths and configurations are correct.
When you import images, Label Studio generates unique IDs for each file to avoid conflicts. This is why you see filenames like bc5b3ad0-7e0dcaed-Ar1_Dd_d5.JPG
. To ensure that the exported JSON file contains the correct directory path, you need to modify the paths in the JSON file to match the local storage paths.
- Export JSON File:
- Export the JSON file from your project.
- Modify JSON File:
- Update the paths in the JSON file to match the local storage paths. For example:
{
"data": {
"image": "/data/local-files/?d=path/to/your/image1.jpg"
},
"annotations": [
{
"result": [
{
"id": "region1",
"type": "polygonlabels",
"value": {
"points": [[10, 10], [20, 20], [30, 10]],
"polygonlabels": ["Label1"]
},
"to_name": "image",
"from_name": "label",
"image_rotation": 0,
"original_width": 4000,
"original_height": 3000
}
]
}
]
}