-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding recording annotation model * Add recording annnotation and migrations * client-side updates * adding recording annotation interface * basic adding/editing user based file level annotations * adding file annotation to main recording view * linting client * change apt-fast to apt-get * revert apt-fast * convert to sudo apt-get * pin to ubuntu 22.04
- Loading branch information
1 parent
6b974cf
commit 2aa32ef
Showing
21 changed files
with
1,200 additions
and
5,177 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
107 changes: 107 additions & 0 deletions
107
bats_ai/core/migrations/0011_alter_annotations_options_annotations_confidence_and_more.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,107 @@ | ||
# Generated by Django 4.1.13 on 2024-12-09 15:26 | ||
|
||
from django.conf import settings | ||
import django.core.validators | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.utils.timezone | ||
import django_extensions.db.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('core', '0010_compressedspectrogram'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='annotations', | ||
options={'get_latest_by': 'modified'}, | ||
), | ||
migrations.AddField( | ||
model_name='annotations', | ||
name='confidence', | ||
field=models.FloatField( | ||
default=1.0, | ||
help_text='A confidence value between 0 and 1.0, default is 1.0.', | ||
validators=[ | ||
django.core.validators.MinValueValidator(0.0), | ||
django.core.validators.MaxValueValidator(1.0), | ||
], | ||
), | ||
), | ||
migrations.AddField( | ||
model_name='annotations', | ||
name='created', | ||
field=django_extensions.db.fields.CreationDateTimeField( | ||
auto_now_add=True, default=django.utils.timezone.now, verbose_name='created' | ||
), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name='annotations', | ||
name='model', | ||
field=models.TextField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='annotations', | ||
name='modified', | ||
field=django_extensions.db.fields.ModificationDateTimeField( | ||
auto_now=True, verbose_name='modified' | ||
), | ||
), | ||
migrations.CreateModel( | ||
name='RecordingAnnotation', | ||
fields=[ | ||
( | ||
'id', | ||
models.BigAutoField( | ||
auto_created=True, primary_key=True, serialize=False, verbose_name='ID' | ||
), | ||
), | ||
( | ||
'created', | ||
django_extensions.db.fields.CreationDateTimeField( | ||
auto_now_add=True, verbose_name='created' | ||
), | ||
), | ||
( | ||
'modified', | ||
django_extensions.db.fields.ModificationDateTimeField( | ||
auto_now=True, verbose_name='modified' | ||
), | ||
), | ||
('comments', models.TextField(blank=True, null=True)), | ||
('model', models.TextField(blank=True, null=True)), | ||
( | ||
'confidence', | ||
models.FloatField( | ||
default=1.0, | ||
help_text='A confidence value between 0 and 1.0, default is 1.0.', | ||
validators=[ | ||
django.core.validators.MinValueValidator(0.0), | ||
django.core.validators.MaxValueValidator(1.0), | ||
], | ||
), | ||
), | ||
( | ||
'owner', | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL | ||
), | ||
), | ||
( | ||
'recording', | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to='core.recording' | ||
), | ||
), | ||
('species', models.ManyToManyField(to='core.species')), | ||
], | ||
options={ | ||
'get_latest_by': 'modified', | ||
'abstract': False, | ||
}, | ||
), | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from django.contrib.auth.models import User | ||
from django.core.validators import MaxValueValidator, MinValueValidator | ||
from django.db import models | ||
from django_extensions.db.models import TimeStampedModel | ||
|
||
from .recording import Recording | ||
from .species import Species | ||
|
||
|
||
class RecordingAnnotation(TimeStampedModel, models.Model): | ||
recording = models.ForeignKey(Recording, on_delete=models.CASCADE) | ||
owner = models.ForeignKey(User, on_delete=models.CASCADE) | ||
species = models.ManyToManyField(Species) | ||
comments = models.TextField(blank=True, null=True) | ||
model = models.TextField(blank=True, null=True) # AI Model information if inference used | ||
confidence = models.FloatField( | ||
default=1.0, | ||
validators=[ | ||
MinValueValidator(0.0), | ||
MaxValueValidator(1.0), | ||
], | ||
help_text='A confidence value between 0 and 1.0, default is 1.0.', | ||
) |
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
Oops, something went wrong.