Get data 404 error
Describe the bug
Data defined in the task is not provided.
To Reproduce
- Created
tasks.json
{
"0": {
"id": 0,
"data": {
"image": "/data/img/img1.tif",
"mask": "/data/msk/mask1.tif"
}
},
"1": {
"id": 1,
"data": {
"image": "/data/img/img2.tif",
"mask": "/data/msk/mask2.tif"
}
}
}
and config.json
{
"title": "Label Studio",
"port": 8097,
"debug": true,
"label_config": "config.xml",
"input_path": "tasks.json",
"output_dir": "completions",
"instruction": "Type some <b>hypertext</b> for label experts!",
"allow_delete_completions": true,
"templates_dir": "examples",
"editor": {
"debug": false
},
"!ml_backend": {
"url": "http://localhost:9090",
"model_name": "my_super_model"
},
"sampling": "uniform"
}
- Initialize the project
label-studio init labeling_project -c config.json
- Run the project
label-studio start ./labeling_project --port 8097
And I get the following error:
[2020-02-26 16:41:07,111] [werkzeug] [INFO] 127.0.0.1 - - [26/Feb/2020 16:41:07] "GET /static/images/github.svg HTTP/1.1" 200 -
[2020-02-26 16:41:07,113] [werkzeug] [INFO] 127.0.0.1 - - [26/Feb/2020 16:41:07] "GET /static/images/slack.png HTTP/1.1" 200 -
[2020-02-26 16:41:07,114] [werkzeug] [INFO] 127.0.0.1 - - [26/Feb/2020 16:41:07] "GET /static/images/ls_logo.png HTTP/1.1" 200 -
[2020-02-26 16:41:07,472] [werkzeug] [INFO] 127.0.0.1 - - [26/Feb/2020 16:41:07] "GET /api/projects/1/next/ HTTP/1.1" 200 -
[2020-02-26 16:41:07,631] [werkzeug] [INFO] 127.0.0.1 - - [26/Feb/2020 16:41:07] "GET /data/img/img1.tif HTTP/1.1" 404 -
[2020-02-26 16:41:07,634] [werkzeug] [INFO] 127.0.0.1 - - [26/Feb/2020 16:41:07] "GET /data/msk/mask1.tif HTTP/1.1" 404 -
Expected behavior Data should be served ?
Environment (please complete the following information):
- OS: [e.g. iOS] Linux
- Browser [e.g. chrome, safari]
- Version [e.g. 22] : 0.4.8
Hi, @vfdev-5 ! Data from local filesystem should be served a bit differently. There is no need to modify internal tasks.json and config.json files. Please try the solution from https://github.com/heartexlabs/label-studio/issues/221 by creating tasks with local URL using
label-studio init labeling_project --input-path my/image/dir --input-format image-dir --label-config my_config.xml
However if in some cases you need to create local URLs by your own, use the following format:
http://localhost:8200/data/image_filename?d=path/to/image/dir
@niklub thanks for suggestions.
I did the same as you suggested, but without localhost : /data/image_filename?d=path/to/image/dir
I have also a doubt about reading tif files by html, as I did not find any image reader in the repository, I think user need to render its imagery to RGB 8 bits.
So, you can close the issues if you wish. My problem is solved while preparing the data specifically for labelling and using /data/image_filename?d=path/to/image/dir trick.
We haven't image readers, just passing the image links to the browsers - I believe tif files should be handled by them
The approach doesn't directly applicable on Windows. I want to create an audio annotation project with pre-annotations. Everything works fine on macOS/Ubuntu, but I have to import that project on Windows machine. And I've stacked on specifying path to a file in JSON tasks. In order to figure out the template of path specification I've tried to import a file through drug&drop window and checked the generated task.json, and it looks like this:
{
"id": 1,
"data": {
"audio": "http:\/\/localhost:8080\/data\/upload\/f68f81e1cf0681ad839b8bb295e7cb34-record.wav"
}
}
So, the path is not absolute and a part of the path is a generated uuid64 code. I'm actually confused about how can I imitate this approach during the tasks file creation. Any thoughts on that? @niklub
Try this scheme:
- Add audio files via drag&drop
- Call
wget http://localhost:8080/api/tasks > all_tasks.json - Remove all tasks (this action will leave uploaded files in place)
- Make
tasks = json.load(open('all_tasks.json'))['tasks'] - Add predictions to
tasks - Save
taskstoimport.json - Import via GUI
import.json