-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: save proof prediction for all proofs in a new table
- Loading branch information
1 parent
a922030
commit b6db99e
Showing
12 changed files
with
592 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
open_prices/proofs/migrations/0006_add_proof_prediction_table.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# Generated by Django 5.1 on 2024-12-01 17:41 | ||
|
||
import django.db.models.deletion | ||
import django.utils.timezone | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("proofs", "0005_proof_receipt_price_count_proof_receipt_price_total"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="ProofPrediction", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"type", | ||
models.CharField( | ||
choices=[ | ||
("OBJECT_DETECTION", "OBJECT_DETECTION"), | ||
("CLASSIFICATION", "CLASSIFICATION"), | ||
("RECEIPT_EXTRACTION", "RECEIPT_EXTRACTION"), | ||
("PRICE_TAG_EXTRACTION", "PRICE_TAG_EXTRACTION"), | ||
], | ||
max_length=20, | ||
verbose_name="The type of the prediction", | ||
), | ||
), | ||
( | ||
"model_name", | ||
models.CharField( | ||
max_length=30, | ||
verbose_name="The name of the model that generated the prediction", | ||
), | ||
), | ||
( | ||
"model_version", | ||
models.CharField( | ||
max_length=30, | ||
verbose_name="The specific version of the model that generated the prediction", | ||
), | ||
), | ||
( | ||
"created", | ||
models.DateTimeField( | ||
default=django.utils.timezone.now, | ||
verbose_name="When the prediction was created in DB", | ||
), | ||
), | ||
( | ||
"data", | ||
models.JSONField( | ||
blank=True, | ||
null=True, | ||
verbose_name="a dict representing the data of the prediction. This field is model-specific.", | ||
), | ||
), | ||
( | ||
"value", | ||
models.CharField( | ||
blank=True, | ||
max_length=30, | ||
null=True, | ||
verbose_name="The predicted value, only for classification models, null otherwise.", | ||
), | ||
), | ||
( | ||
"max_confidence", | ||
models.FloatField( | ||
blank=True, | ||
null=True, | ||
verbose_name="The maximum confidence of the prediction, may be null for some models.For object detection models, this is the confidence of the most confident object.For classification models, this is the confidence of the predicted class.", | ||
), | ||
), | ||
( | ||
"proof", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="predictions", | ||
to="proofs.proof", | ||
verbose_name="The proof this prediction belongs to", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "Proof Prediction", | ||
"verbose_name_plural": "Proof Predictions", | ||
"db_table": "proof_predictions", | ||
}, | ||
), | ||
] |
Oops, something went wrong.