Support for local file storage
Mekcyed opened this issue · comments
Hi @Alyetama,
my goal is to use the yolo predictions on images which are located in local storage and not in S3. I am currently struggling to even get it running with the existing code.:
label-studio-yolov5-backend/app/api.py
Lines 89 to 104 in 41d7e83
When I just import an image from the web with a http image path and using the code above, I get this error:
File "/root/.cache/torch/hub/ultralytics_yolov5_master/models/common.py", line 508, in forward
b, ch, h, w = im.shape # batch, channel, height, width
AttributeError: 'str' object has no attribute 'shape'
My attempts on changing the code to accept images with a local path like /mnt/c/Users/John/Pictures/image.jpg
failed so far :(
From the error message I see, it seem like this is happening because you're passing the path to the image rather than the image object. Are you using local storage (a folder on your device with images) or are you importing into the project from the GUI (drag and drop)?
I used the GUI in the first place with drag and drop. Just tested it with the local storage and received the same Error. This ist the Task file with one image in the local storage:
{
"id":3,
"data":{
"image":"/data/local-files/?d=Screenshots/chicken.png"
},
"meta":{
},
"created_at":"2022-11-16T07:24:35.015919Z",
"updated_at":"2022-11-16T07:24:35.015947Z",
"is_labeled":false,
"overlap":1,
"inner_id":1,
"total_annotations":0,
"cancelled_annotations":0,
"total_predictions":0,
"comment_count":0,
"unresolved_comment_count":0,
"last_comment_updated_at":"None",
"project":2,
"updated_by":"None",
"file_upload":"None",
"comment_authors":[
],
"annotations":[
],
"predictions":[
]
}