-
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.
initial prediction on compressed spectrogram generation (#117)
- Loading branch information
1 parent
2aa32ef
commit 34b4a95
Showing
6 changed files
with
107 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from django.contrib import admin | ||
|
||
from bats_ai.core.models import RecordingAnnotation | ||
|
||
|
||
@admin.register(RecordingAnnotation) | ||
class RecordingAnnotationAdmin(admin.ModelAdmin): | ||
list_display = [ | ||
'pk', | ||
'recording', | ||
'owner', | ||
'species_codes', # Add the custom field here | ||
'confidence', | ||
'additional_data', | ||
'comments', | ||
'model', | ||
] | ||
list_select_related = True | ||
filter_horizontal = ('species',) # or filter_vertical | ||
autocomplete_fields = ['owner'] | ||
|
||
# Custom method to display the species codes as a comma-separated string | ||
@admin.display(description='Species Codes') | ||
def species_codes(self, obj): | ||
# Assuming species have a `species_code` field | ||
return ', '.join([species.species_code for species in obj.species.all()]) | ||
|
||
# Optionally, you can also add a verbose name for this field |
19 changes: 19 additions & 0 deletions
19
bats_ai/core/migrations/0012_recordingannotation_additional_data.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,19 @@ | ||
# Generated by Django 4.1.13 on 2024-12-17 17:57 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
('core', '0011_alter_annotations_options_annotations_confidence_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='recordingannotation', | ||
name='additional_data', | ||
field=models.JSONField( | ||
blank=True, help_text='Additional information about the models/data', null=True | ||
), | ||
), | ||
] |
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