Skip to content

How to upload image for lobe trained model in local host? #30

@zydjohnHotmail

Description

@zydjohnHotmail

Hello:
I have trained an image converter model in Lobe (version 0.10.1130.5). I also exported as an ONNX model. But I don’t know how to write some C# code to make some predication.
However, I found that I can use Lobe locally and post image to it. So I want to try this model.
I run Lobe in Lobe Connect, and I can see its local URL:
http://localhost:38101/v1/predict/2cc072ae-dbda-43c5-8db7-4c2515e0548d

However, the HTTP request is in this format:
{
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"image": ""
}
}

I used one C# program to convert one of the training image to base64 string. Then I launch PostMan (Version 9.15.2) for Windows 10 to post the following Json data to local lobe connect end-point, like this:
{
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"image": "iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAIAAADwf7zUAAEAAE......=="
}
}

Then I quickly get response from lobe end-point, with the following Json reply:
{
"errors": [
{
"value": "{ "method": "POST", "headers": { "Content-Type": "application/json" }, "body": {
"image": "iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAIAAADwf7zUAAEAAE......==" }}",
"msg": "Request body should be {"image": ""}",
"param": "",
"location": "body"
}
]
}

It seems Lobe connect does NOT recognize the base64 as an image.
Please advise on how to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions