Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a proof_prediction table to store predictions from ML models #511

Closed
raphael0202 opened this issue Oct 10, 2024 · 0 comments · Fixed by #605, #601, #588 or #614
Closed

Create a proof_prediction table to store predictions from ML models #511

raphael0202 opened this issue Oct 10, 2024 · 0 comments · Fixed by #605, #601, #588 or #614

Comments

@raphael0202
Copy link
Contributor

raphael0202 commented Oct 10, 2024

We now have a new ML model that can be used to predict automatically the kind of proof image the user sends us.

For every newly uploaded proof, we want to call this endpoint to classify the proof type and store it in the DB.

For this, I suggest that we create a new proof_prediction table that has the following fields:

  • id (auto-incrementing int)
  • proof_id: the ID of the proof associated with the prediction
  • type: str, the task type (object_detection or classification, here classification)
  • model_name: str, name of the ML model, here price_proof_classification
  • model_version: str, version of the model, here price_proof_classification_1.0
  • created: datetime of creation of the prediction
  • data: JSONB, dictionary containing prediction data (here what's returned by the API)
  • value: str, the predicted value, for classification only (otherwise null)
  • max_confidence: float, the maximum score of the prediction, for classification it's the score of the predicted class, for object detection it's the maximum confidence score for all objects.

We don't have (yet) object detection models, but it will come soon :)

This is just a proposal, feel free to comment!
poke @raphodn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment