2

I have a .NET web app I am setting up to identify random objects. I set up a custom model with ~500 labelled images and am able to successfully get a prediction for an image via the REST API.

But how can I add to that models' dataset and train it with new images that get uploaded/sent for prediction?

For example, the user uploads a photo of something and the model isn't able to accurately predict what it is (e.g. highest score is < 50), so the user is prompted to select a label to identify it and then it adds that image with the label to the model for training.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
user3636407
  • 103
  • 1
  • 10

2 Answers2

2

You need to take a few steps:

  1. Upload the image file to Google Cloud Storage, under the bucket <project_id>-vcm
  2. Upload a CSV file to Google Cloud Storage under the same bucket, with the following content:

    gs://<project_id>-vcm/<path-to-image-file>,<label>

  3. Call the importData API to import the CSV file.

Now your dataset is updated with the new image with label. You can call the create model API to train a new model.

Tiger Soldier
  • 361
  • 2
  • 4
0

We're working hard to make use cases like this simple, but for the time being, you will need to build some services around this. For example, you could create a GCF that accepts your request, forwards it to CloudML Engine, sends the request and response to BigQuery (including the "scores") and then returns the final response. Then you could setup a Cloud Composer pipeline that will periodically retrain the model.

rhaertel80
  • 8,254
  • 1
  • 31
  • 47