label-studio icon indicating copy to clipboard operation
label-studio copied to clipboard

Import and Sync image from local storage Label Studio

Open AnelorG opened this issue 2 years ago • 2 comments

Hi,

Describe the bug I would like to sync my dataset (only .jpg) that is localized on a local server and Label Studio. This dataset is updated with new images every day. I'm new in Label Studio. First step for me is to import (fake) image from local repository (my desktop for example) to LS. And... I get trouble !

I have made this LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true in my anaconda prompt and then run label-studio

I have created new SOURCE STORAGE in LS : storage type : local files absolute path : C:/Users/anne-/Desktop/test1 filter : .*jpg Treat every bucket object as a source file : checked

Connexion is a success but when I go to the project I have my 3 files but images are not uploaded. icon broken image/Data My cmd displays

test1\0003_0009_000026_001.jpg does not match uri regex ([\"'])(?P<uri>(?P<storage>{})://[^\1=]*)\1
[2022-08-02 15:28:45,389] [io_storages.utils::get_uri_via_regex::25] [WARNING] /data/local-files/?d=Users\anne-\Desktop\test1\0003_0009_000028_001.jpg does not match uri regex ([\"'])(?P<uri>(?P<storage>{})://[^\1=]*)\1
[2022-08-02 15:28:45,391] [io_storages.utils::get_uri_via_regex::25] [WARNING] /data/local-files/?d=Users\anne-\Desktop\test1\0003_0009_000043_001.jpg does not match uri regex ([\"'])(?P<uri>(?P<storage>{})://[^\1=]*)\1
[02/Aug/2022 15:28:45] "GET /api/tasks?page=1&page_size=30&view=7&project=3 HTTP/1.1" 200 1604
[2022-08-02 15:28:45,449] [django.request::log_response::224] [WARNING] Not Found: /data/local-files/
[2022-08-02 15:28:45,450] [django.request::log_response::224] [WARNING] Not Found: /data/local-files/
[02/Aug/2022 15:28:45] "GET /data/local-files/?d=Users\anne-\Desktop\test1\0003_0009_000028_001.jpg HTTP/1.1" 404 0
[02/Aug/2022 15:28:45] "GET /data/local-files/?d=Users\anne-\Desktop\test1\0003_0009_000043_001.jpg HTTP/1.1" 404 0
[2022-08-02 15:28:45,456] [django.request::log_response::224] [WARNING] Not Found: /data/local-files/
[02/Aug/2022 15:28:45] "GET /data/local-files/?d=Users\anne-\Desktop\test1\0003_0009_000026_001.jpg HTTP/1.1" 404 0

When I click on an image I have this : There was an issue loading URL from $image value image

Things to look out for:

URL is valid URL scheme matches the service scheme, i.e. https and https The static server has wide-open CORS, more on that here Technical description: URL: /data/local-files/?d=Users\anne-\Desktop\test1\0003_0009_000026_001.jpg

Environment (please complete the following information):

  • OS: WINDOWS 11
  • Label Studio

Thanks a lot,

AL

AnelorG avatar Aug 02 '22 13:08 AnelorG

@AnelorG Could you please check this video tutorial: https://www.youtube.com/watch?v=lo6ncQajbdU It's for more complex cases when your data has more than one image, however it shows how to connect Local Storage correctly. Hope it'll help.

makseq avatar Aug 02 '22 23:08 makseq

Thanks for your response. So I have this (after config my json task): image

How to delete the first 6 raws that come when I import my txt file ?

AnelorG avatar Aug 05 '22 10:08 AnelorG

select them with checkboxes and delete using actions image

makseq avatar Aug 08 '22 23:08 makseq

Thanks @makseq I have solved with your solution when my folder is in my machine but when I try to import photo from local server it failed. I have the same image icon broken, even if I import a json file containing the name of the image.

My local storage is successfully connected. The image are imported in LS but it's impossible to see and label these image (icon broken).

Have you faced this problem before?

Thanks

AnelorG avatar Aug 11 '22 07:08 AnelorG

Perhapas, I've found a solution but how do you import multiple images ? We should import mutliple json file ??? Each of them containing { "data": { "image": "/data/local-files/?d=dataset1/0001_0001_000068_001.jpg" } }

AnelorG avatar Aug 11 '22 07:08 AnelorG

I've solved using txt files instead of json :)

AnelorG avatar Aug 11 '22 09:08 AnelorG

Why didn't you click Sync button on Source Storage dialog?

makseq avatar Aug 12 '22 00:08 makseq