Git Product home page Git Product logo

lobe.net's Introduction

Lobe

Lobe is an easy-to-use tool that helps you train machine learning models on your own computer, for free, without any prior experience required. It runs locally on both Mac and PC, and you can ship your model to any platform you choose.

Download it for free to get started on your machine learning model today.

Machine Learning Made Easy

Lobe takes a new humane approach to machine learning by putting your images in the foreground and receding to the background, serving as the main bridge between your ideas and your machine learning model.

Lobe also simplifies the process of machine learning into three easy steps. Collect and label your images. Train and understand your results. Then play with your model and improve it.

image

lobe.net's People

Contributors

colombod avatar dmilkie avatar mbeissinger avatar tymtam2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lobe.net's Issues

Error BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

hello everybody
i made a LOBE model as onnx. then i used the sample code in the main page
but it shows me an error on runtime:

System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'Microsoft.ML.OnnxRuntime.NativeMethods' threw an exception.
Source=Microsoft.ML.OnnxRuntime
StackTrace:
at Microsoft.ML.OnnxRuntime.SessionOptions..ctor() in C:\a\3\s\csharp\src\Microsoft.ML.OnnxRuntime\SessionOptions.cs:line 50
at lobe.OnnxImageClassifier.InitialiseFromSignature(Signature signature, String modelFileName)
at lobe.ImageClassifier.CreateFromSignature(Signature signature, String modelFileName, String engineType)
at lobe.ImageClassifier.CreateFromSignatureFile(FileInfo signatureFile, String modelFileName, String format)
at AIWebApp.ML.LobeOfficeAppDetection.Main(String signatureFilePath, String imageToClassify) in G:***\LobeDetection.cs:line 26 at *.Tests.MyTests.Test1() in G:*\MyTests.cs:line 21

Inner Exception 1:
BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

Could you please help me to solve the problem ?
thanks in advanced
regards
mohammad

How to get ONNX input/output class from signature file?

Hello:
I have installed Lobe Application in my Windows 10 PC, from this URL: https://www.lobe.ai/
I used a small dataset to train and get an ONNX model. This model is an image converter, it is not a classifier.

The following is the signature JSON file:
{
"doc_id": "2cc072ae-dbda-43c5-8db7-4c2515e0548d",
"doc_name": "model",
"doc_version": "9c8be1ab541b4591f46bb01fc60116cf",
"format": "onnx",
"version": 5,
"inputs": {
"Image": {
"dtype": "float32",
"shape": [null, 224, 224, 3],
"name": "Image:0"
}
},
"outputs": {
"Confidences": {
"dtype": "float32",
"shape": [null, 2],
"name": "2cc072ae-dbda-43c5-8db7-4c2515e0548d.9554adfa-5d26-484f-88d3-dea9f2f46f01/dense_2/Softmax:0"
}
},
"tags": [],
"classes": {
"Label": ["test_A", "test_B"]
},
"filename": "model.onnx",
"export_model_version": 1
}

I also use mlgen for Visual Studio 2019 from this URL, to generate some C# wrapper class, like this:
public sealed class ModelInput
{
public TensorFloat Image00; // shape(-1,224,224,3)
}

public sealed class ModelOutput
{
    public TensorFloat output2cc072ae0dbda043c508db704c2515e0548d09554adfa05d260484f088d30dea9f2f46f010dense_20Softmax00; // shape(-1,2)
}

public sealed class ModelModel
{
    private LearningModel model;
    private LearningModelSession session;
    private LearningModelBinding binding;
    public static async Task<ModelModel> CreateFromStreamAsync(IRandomAccessStreamReference stream)
    {
        ModelModel learningModel = new ModelModel();
        learningModel.model = await LearningModel.LoadFromStreamAsync(stream);
        learningModel.session = new LearningModelSession(learningModel.model);
        learningModel.binding = new LearningModelBinding(learningModel.session);
        return learningModel;
    }
    public async Task<ModelOutput> EvaluateAsync(ModelInput input)
    {
        binding.Bind("Image:0", input.Image00);
        var result = await session.EvaluateAsync(binding, "0");
        var output = new ModelOutput();
        output.output2cc072ae0dbda043c508db704c2515e0548d09554adfa05d260484f088d30dea9f2f46f010dense_20Softmax00 = result.Outputs["2cc072ae-dbda-43c5-8db7-4c2515e0548d.9554adfa-5d26-484f-88d3-dea9f2f46f01/dense_2/Softmax:0"] as TensorFloat;
        return output;
    }

But I don’t quite understand the meaning of the above class.
If I want to use an input image and generate an output image from the ONNX model.
How I can write an OnnxInput and OnnxOutputClass?
I have no idea about the input shape [null, …] means what and output shape [null, 2] means what?

By the way, the input/output name seems to be very long and meaningless.
Can I use python code to change the ONNX model, so it will show some meaningful names for input/output? For example, if I want to use output name like: Iamge2Sketch, not like this one:
"name": "2cc072ae-dbda-43c5-8db7-4c2515e0548d.9554adfa-5d26-484f-88d3-dea9f2f46f01/dense_2/Softmax:0"

I am using Visual Studio 2022 and 2019 on Windows 10, I also installed Python 3.9.
Please advise,
Thanks,

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

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?

Cannot parse outputs.Prediction.name

Hi!

I'm working in C#, .NET Framework 4.6.1.

So I've trained a simple 4-class image classifier in Lobe, exported as an onnx model. I'm using the OnnxRuntime.MKLML package to load it, it initializes alright when I call this:

ImageClassifier.Register("onnx", () => new OnnxImageClassifier());
                classifier = ImageClassifier.CreateFromSignatureFile(new FileInfo(ModelPathAndName)); // Lobe.AI Model

but then when I try to call classifier.Classify() on the image, I get this error:

System.Collections.Generic.KeyNotFoundException: 'Cannot parse outputs.Prediction.name'
with the Inner Exception:
KeyNotFoundException: The given key was not present in the dictionary.

I'm calling it with this line:

var results = classifier.Classify(SixLabors.ImageSharp.Image
                .Load(sFilename).CloneAs<Rgb24>());

Just in case, here's the signature.json file that I got when I exported the model:

{
  "doc_id": "c916a4a7-ee27-4926-a5b8-1162f4477fc7",
  "doc_name": "AutoRotate",
  "doc_version": "9d01647d49e2fd0e05622b6a7ec3c4eb",
  "format": "onnx",
  "version": 12,
  "inputs": {
    "Image": {
      "dtype": "float32",
      "shape": [ null, 224, 224, 3 ],
      "name": "Image:0"
    }
  },
  "outputs": {
    "Confidences": {
      "dtype": "float32",
      "shape": [ null, 4 ],
      "name": "c916a4a7-ee27-4926-a5b8-1162f4477fc7.1842bd14-28e9-4261-bc41-4083b30ea3a4/dense_2/Softmax:0"
    }
  },
  "tags": [],
  "classes": 
  { "Label": [ "0", "180", "270", "90" ] },
  "filename": "model.onnx", 
  "export_model_version": 1}

Wrong Example?

The example on README.md shows:
Console.WriteLine(results.Classification.Label);

But results has a collection called Classifications, not a single item.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.