Closed sumanshusamarora closed 3 years ago
Hi! You need to prepare a JSON-file with HyperText
tag. You can find out how a similar config is set up here at Playground and compare it to yours.
The example takes the pdf source from an image which seems to work but in my case pdf comes from local storage and thats not working.
Hi @sumanshusamarora
This is how I was able to get my images into the project. But should work the same way with PDF’s.
I assume you run LabelStudio with the local files serving, described in the guide the whole section here .
To get the path you can check the "Treat every bucket object as a source file" and copy a file to your absolute local path.
Sync Storage and import your test document.
Then check with the blue </> button in the Data Manager the documents URL.
{ "id": 1, "data": { "$undefined$": "https://some-url.top/labelstudio/data/local-files/?d=data/inbox/test.jpeg" }, "annotations": [], "predictions": [] }
If you need further customization for your tasks
For an image on your local deployment it might look like this "$undefined$": "/data/local-files/?d=dataset1/1.jpg". But the /data/local-files/ route stays the same where the path to your file follows in the ?d=/abs/path/to/your/file http URL parameter.
Finally create your task according to your URL schema just discovered and set your path. Uncheck the “Treat every bucket object...” copy the files to the data directory and import your created task.json.
update/addition: Following this example on the LS Blog, there is a different way.
If there are hellper moduls for such kind of import task I am also very interested in them.
Hope this helps.
Hi @schafsam The images work just fine mate. The problem is pdf preview. Try putting a pdf into your storage and see if that shows up even for pdf rating project.
@sumanshusamarora
I just tried the PDF classification template from the Playground Rate PDF with creating the task from syncronizing the storage. It also does not work for me. This is what I got:
@dentalala I run version 1.1.0 from a conda environment.
Ok, me too. Version 1.1.0 in a conda environment.
@sumanshusamarora @schafsam You have to use specially prepared tasks and load them as JSON files:
task.json
{
"pdf": "<embed src='https://app.heartex.ai/static/samples/sample.pdf' width='100%' height='600px'/>"
}
Add Local Storage (or another one) and DO NOT press sync button.
After you should prepare your task.json (or tasks.json) manually using links provided via Local Storage (like https://some-url.top/labelstudio/data/local-files/?d=data/inbox/test.jpeg
) in
{
"pdf": "<embed src='https://some-url.top/labelstudio/data/local-files/?d=data/inbox/test.jpeg' width='100%' height='600px'/>"
}
And then import task.json into LS.
I know It's not very convenient, but we don't have direct PDF support yet in LS.
I am trying to use PDF Classification template and when i upload my pdfs, they show as a text path to the pdf in-stead-of pdf view. Screenshot attached. Is this something expected or a bug?