Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
685db89
feat: template of a management command for binning classifications
mihow Jun 13, 2025
ef8d849
feat: consider scores from a given species prediction, not top score
mihow Jun 13, 2025
b939c02
fix: pin minio containers to known working versions
mihow Jun 18, 2025
a708ea5
scratch: testing an approach to class masking / geo-fencing
mihow Jul 17, 2025
5541e56
fix: type annotations
mihow Jul 17, 2025
01ecf06
fix: require filtering by algorithm
mihow Jul 17, 2025
a3d7bd4
feat: update updated_at timestamp for modified classifications
mihow Jul 17, 2025
62f574e
draft: placeholder for creating a classification instead of modifying
mihow Jul 21, 2025
c5e94fa
feat: create new classification when apply class masking
mihow Jul 23, 2025
f092378
feat: Django admin command for applying masking to a single occurrence
mihow Jul 23, 2025
141c152
feat: allow searching by ID, hide detections in detail view
mihow Jul 23, 2025
3894718
chore: update logging
mihow Jul 23, 2025
1fa4f6a
feat: set previous classification as intermediate
mihow Jul 23, 2025
7ce6f84
Fix reference to update_occurrences_in_collection
rhine3 Aug 6, 2025
d2bed8b
Try to import unregistered taxa
rhine3 Aug 7, 2025
d97211c
Add debugging statements
rhine3 Aug 7, 2025
6f1cc5b
feat: update legacy importer for data from AMI Data Companion
mihow Aug 7, 2025
cbdc72a
feat: method to import pipeline results created externally
mihow Aug 7, 2025
c56bfc6
fix: associate occurrences with events correctly
mihow Aug 7, 2025
c68ba1b
fix[imports]: update stations and sessions after import
mihow Aug 8, 2025
2db2c8b
feat[imports]: only use existing algorithms and category maps by default
mihow Aug 8, 2025
b607cb7
fix[imports]: create crops from imports if they are not externally ho…
mihow Aug 8, 2025
70e6f46
Update when event regrouping takes place (#908)
mihow Jul 31, 2025
19b0cec
Merge branch 'deployments/ood.antenna.insectai.org' of github.com:Rol…
mihow Aug 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions ami/main/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ class OccurrenceAdmin(admin.ModelAdmin[Occurrence]):
"determination__rank",
"created_at",
)
search_fields = ("determination__name", "determination__search_names")
search_fields = ("determination__name", "determination__search_names", "pk")

def get_queryset(self, request: HttpRequest) -> QuerySet[Any]:
qs = super().get_queryset(request)
Expand All @@ -418,10 +418,33 @@ def get_queryset(self, request: HttpRequest) -> QuerySet[Any]:
def detections_count(self, obj) -> int:
return obj.detections_count

@admin.action(description="Apply class masking to occurrences")
def apply_class_mask(self, request: HttpRequest, queryset: QuerySet[Occurrence]) -> QuerySet[Occurrence]:
"""
Apply class masking to the queryset.
This is a placeholder for the actual implementation.
"""
from ami.main.models import TaxaList
from ami.ml.models import Algorithm
from ami.ml.post_processing import class_masking

taxa_list = TaxaList.objects.get(pk=5)
algorithm = Algorithm.objects.get(pk=11)

for occurrence in queryset:
class_masking.update_single_occurrence(
occurrence=occurrence,
algorithm=algorithm,
taxa_list=taxa_list,
)
return queryset

actions = [apply_class_mask]

ordering = ("-created_at",)

# Add classifications as inline
inlines = [DetectionInline]
# inlines = [DetectionInline]


@admin.register(Classification)
Expand Down
Loading
Loading