ai-cfia / nachet-backend

A flask-based backend for Nachet to handle Azure endpoint and Azure storage API requests from the frontend.
MIT License
1 stars 4 forks source link

Endpoint to retrieve content of a folder #105

Closed sylvanie85 closed 1 month ago

sylvanie85 commented 2 months ago

https://github.com/ai-cfia/nachet-frontend/issues/172 : "As a User, I'd like to be able to access the pictures from other folders"

The backend needs new routes that takes a user id and a folder id as parameters to retrieve pictures and inferences from them using datastore functions.

We'll do this in 2 steps: first, we want to retrieve only the names of the pictures, if they've been verified or come from a batch download, for example. Then, if the user clicks on a picture, we'll retrieve the inference and the picture from blob storage.

/get-directories

is_verified \ inference_exist false true
false should not happend inference not verified
true batch import inference verified
{
"folders" : [
        {
            "picture_set_id" : "xxxx-xxxx-xxxx-xxxx",
            "folder_name" : "folder name",
            "nb_pictures": 4,
            "pictures" : [
                {
                    "picture_id" : "xxxx-xxxx-xxxx-xxxx",
                    "inference_exist": false,
                    "is_validated": true
                },
                ...
            ]
        },
        ...
    ]
}

/get-picture

{
    "picture_id" : "xxxx-xxxx-xxxx-xxxx",
    "inference": {
     }
    "image": "xxxxxxxxxxx"
}