-
Notifications
You must be signed in to change notification settings - Fork 0
initial nabat models/api script #122
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
Open
BryonLewis
wants to merge
46
commits into
main
Choose a base branch
from
nabat-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,003
−358
Open
Changes from 42 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
a54aef9
initial nabat models/api script
BryonLewis d8440c2
model updates and reset endpoints
BryonLewis 760acc9
outlining tasks
BryonLewis da7d35c
nabat retrieval logic
BryonLewis 0574aa4
NABat ingestion working
BryonLewis e83ef4c
rename acoustic_batch_initialize
BryonLewis 91be416
remove flower, add spectrogram viewer script, move spectrogram creati…
BryonLewis ab9977d
nabat integration
BryonLewis 45bb4b3
deduplicating functions
BryonLewis e495458
Merge branch 'main' into nabat-integration
BryonLewis 8849abb
add species manual and auto ids to nabat retrieval
BryonLewis 456cad6
non-compressed X-axis highlight, zooming legend fix, 2.5x default com…
BryonLewis 9d05588
cursor time compressed fix, axis length fix, edit column reorder in R…
BryonLewis c31154b
recording annotation details
BryonLewis 5491064
removing some commented out emits
BryonLewis f42c986
remove footer from details for inference annotations
BryonLewis 230e8e3
Ignore egg-info directories
naglepuff 024147d
Add additional configuration settings
naglepuff 488a78c
Add new settings to admin page
naglepuff 96caa74
Use configuration to set `compressed` ref
naglepuff 370ac19
Move save button closer to settings
naglepuff 31c089c
Check config setting before running inference
naglepuff 2329da7
Use config setting for initial compressed scale
naglepuff b3ca903
reference the outputs.tags instead of outputs.results
BryonLewis e139f7a
renames acoustic batch to recording (#128)
BryonLewis f49e501
Merge branch 'main' into nabat-integration
BryonLewis d0bc693
Use slider for stretch setting
naglepuff 5d3f361
Merge pull request #138 from Kitware/issue-134-configuration-settings
naglepuff e18b046
recording based nabat spectrograms
BryonLewis ced6425
Merge branch 'main' into ui-improvements
BryonLewis aa07187
Merge branch 'ui-improvements' into nabat-integration
BryonLewis de0adb1
migrations modifications
BryonLewis d2b0b10
public apis, adding apiToken access control
BryonLewis b0a28db
recording annotation endpoints
BryonLewis 1a2ee94
nabat local annotaitons
BryonLewis 9e78dcf
precition config, requesting annotations, updating species
BryonLewis d8be1bb
swapping to user_email from user_id
BryonLewis df75702
pushing annotations back
BryonLewis d801530
auth cleanup
BryonLewis 71190d8
Merge branch 'main' into nabat-integration
BryonLewis 6ee235d
Merge branch 'main' into nabat-integration
BryonLewis c0c0aca
convert to mutation
BryonLewis 4d00bdc
Update scripts/USGS/naBatSpecies.py
BryonLewis a7d5e1b
addressing some of the comments
BryonLewis 798fd4d
enum for processing task types, processing task get_or_create
BryonLewis 454725a
client_id option, base environment file, updating instructions, NABAT…
BryonLewis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,24 @@ | ||
from django.contrib import admin | ||
|
||
from bats_ai.core.models.configuration import Configuration | ||
|
||
|
||
@admin.register(Configuration) | ||
class ConfigurationAdmin(admin.ModelAdmin): | ||
list_display = ( | ||
'display_pulse_annotations', | ||
'display_sequence_annotations', | ||
'run_inference_on_upload', | ||
'spectrogram_x_stretch', | ||
'spectrogram_view', | ||
) | ||
|
||
def has_add_permission(self, request): | ||
# Allow add only if there is no Configuration instance | ||
if Configuration.objects.exists(): | ||
return False | ||
return super().has_add_permission(request) | ||
|
||
def has_delete_permission(self, request, obj=None): | ||
# Prevent deleting the Configuration through the admin | ||
return False |
This file contains hidden or 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 hidden or 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,66 @@ | ||
from django.contrib import admin | ||
|
||
from bats_ai.core.models.nabat import ( | ||
NABatCompressedSpectrogram, | ||
NABatRecording, | ||
NABatRecordingAnnotation, | ||
NABatSpectrogram, | ||
) | ||
|
||
|
||
# Register models for the NaBat category | ||
@admin.register(NABatRecordingAnnotation) | ||
class NABatRecordingAnnotationAdmin(admin.ModelAdmin): | ||
list_display = ( | ||
'nabat_recording', | ||
'comments', | ||
'model', | ||
'confidence', | ||
'additional_data', | ||
'species_codes', | ||
) | ||
search_fields = ('nabat_recording_name', 'comments', 'model') | ||
list_filter = ('nabat_recording',) | ||
|
||
@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()]) | ||
|
||
|
||
@admin.register(NABatSpectrogram) | ||
class NABatSpectrogramAdmin(admin.ModelAdmin): | ||
list_display = ( | ||
'nabat_recording', | ||
'image_file', | ||
'width', | ||
'height', | ||
'duration', | ||
'frequency_min', | ||
'frequency_max', | ||
'colormap', | ||
) | ||
search_fields = ('nabat_recording__name', 'colormap') | ||
list_filter = ('nabat_recording', 'colormap') | ||
|
||
|
||
@admin.register(NABatCompressedSpectrogram) | ||
class NABatCompressedSpectrogramAdmin(admin.ModelAdmin): | ||
list_display = ('nabat_recording', 'spectrogram', 'length', 'cache_invalidated') | ||
search_fields = ('nabat_recording__name', 'spectrogram__id') | ||
list_filter = ('nabat_recording', 'cache_invalidated') | ||
|
||
|
||
@admin.register(NABatRecording) | ||
class NABatRecordingAdmin(admin.ModelAdmin): | ||
list_display = ( | ||
'name', | ||
'recording_id', | ||
'equipment', | ||
'comments', | ||
'recording_location', | ||
'grts_cell_id', | ||
'grts_cell', | ||
) | ||
search_fields = ('name', 'recording_id', 'recording_location') | ||
list_filter = ('name', 'recording_id', 'recording_location') |
This file contains hidden or 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 ProcessingTask | ||
|
||
|
||
@admin.register(ProcessingTask) | ||
class ProcessingTaskAdmin(admin.ModelAdmin): | ||
list_display = ('id', 'name', 'status', 'created', 'modified', 'celery_id', 'metadata', 'error') | ||
list_filter = ('status', 'created', 'modified') | ||
search_fields = ('name', 'celery_id', 'metadata', 'error') | ||
ordering = ('-created',) | ||
readonly_fields = ('created', 'modified') | ||
fieldsets = ( | ||
(None, {'fields': ('name', 'status', 'celery_id', 'error')}), | ||
( | ||
'Metadata', | ||
{ | ||
'classes': ('collapse',), | ||
'fields': ('metadata',), | ||
}, | ||
), | ||
( | ||
'Timestamps', | ||
{ | ||
'fields': ('created', 'modified'), | ||
}, | ||
), | ||
) |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No action needed, just observing that these don't follow the convention of other classes here of ending with
...Admin
. Not sure if you want to keep that convention for these or move forward as-is.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're correct, I'll update it