Commit eaf6ca12 authored by Open Science Conservation Fund's avatar Open Science Conservation Fund
Browse files

more self-explanatory namd and description for merging species ai classification pipeline setting

parent 32e4be9b
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
# Generated by Django 4.2.17 on 2025-10-28 10:24

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0029_userhttpuploaderaccountfiles'),
    ]

    operations = [
        migrations.AlterField(
            model_name='userhttpuploaderaccountfiles',
            name='file_size',
            field=models.BigIntegerField(blank=True, default=0),
        ),
    ]
+1 −1
Original line number Diff line number Diff line
@@ -604,7 +604,7 @@ class CSDeploymentProcessingProgressSerializer(serializers.ModelSerializer):

            ai_progress = self.with_ai_classification / self.total

            if project.copy_ai_classifications:
            if project.merge_species_ai_classifications:
                ai_progress *= 0.5

            self.with_blurred_humans = classifications.filter(
+10 −3
Original line number Diff line number Diff line
@@ -155,7 +155,6 @@ class ProjectRoleInline(admin.TabularInline):

class ClassificationProjectAdmin(admin.ModelAdmin):
    inlines = [ProjectRoleInline]
    filter_horizontal = ("collections",)
    list_display = (
        "name",
        "research_project",
@@ -166,7 +165,7 @@ class ClassificationProjectAdmin(admin.ModelAdmin):
        "target_fps",
        "object_detection_ai_model",
        "species_ai_model",
        "copy_ai_classifications",
        "merge_species_ai_classifications",
        "species_matching_iou_threshold",
        "date_created",
        "disabled_at",
@@ -174,7 +173,15 @@ class ClassificationProjectAdmin(admin.ModelAdmin):
    )
    search_fields = ("name", "research_project__name")
    exclude = ("deployments",)
    list_filter = ("research_project", "citizen_science_status")
    list_filter = (
        "research_project",
        "citizen_science_status",
        "video_support_enabled",
        "merge_species_ai_classifications",
        "object_detection_ai_model",
        "species_ai_model",
    )
    filter_horizontal = ("collections",)
    readonly_fields = ("slug_id", "slug", "date_created")


+18 −0
Original line number Diff line number Diff line
# Generated by Django 4.2.17 on 2025-10-28 10:29

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('media_classification', '0091_add_missing_indices'),
    ]

    operations = [
        migrations.RenameField(
            model_name='classificationproject',
            old_name='copy_ai_classifications',
            new_name='merge_species_ai_classifications',
        ),
    ]
+9 −15
Original line number Diff line number Diff line
@@ -230,7 +230,6 @@ class ClassificationProject(models.Model):
        default=ClassificationProjectStatus.ONGOING,
        verbose_name=_("Status"),
    )
    # --- Citizen Science ---
    citizen_science_status = models.IntegerField(
        _("Citizen Science status"),
        default=CitizenScienceStatus.NOT_BELONG,
@@ -264,13 +263,11 @@ class ClassificationProject(models.Model):
        max_width=500,
        max_height=300,
    )

    video_support_enabled = models.BooleanField(
        _("Video support enabled"),
        default=False,
        help_text=_("Enable video support for the project"),
    )

    target_fps = models.IntegerField(
        _("Target FPS"),
        null=True,
@@ -279,7 +276,6 @@ class ClassificationProject(models.Model):
            "Target FPS for the video annotations. If not set, the source FPS will be used."
        ),
    )

    object_detection_ai_model = models.ForeignKey(
        "AIProvider",
        related_name="classification_projects_object_detection",
@@ -288,7 +284,6 @@ class ClassificationProject(models.Model):
        on_delete=models.SET_NULL,
        verbose_name=_("Object detection AI model"),
    )

    species_ai_model = models.ForeignKey(
        "AIProvider",
        related_name="classification_projects_species",
@@ -297,18 +292,22 @@ class ClassificationProject(models.Model):
        on_delete=models.SET_NULL,
        verbose_name=_("Species AI model"),
    )
    copy_ai_classifications = models.BooleanField(
        _("Copy AI classifications"),
    merge_species_ai_classifications = models.BooleanField(
        _("Merge species AI classifications"),
        default=True,
        help_text=_("Copy AI classifications trying to match bboxes"),
        help_text=_(
            "AI pipeline setting indicating whether species-level AI labels should be merged into "
            "already approved detected animal observations by matching the AI bounding boxes. "
            "Disable this option if you prefer to review AI species suggestions separately and approve them "
            "manually at a later time."
        ),
    )
    species_matching_iou_threshold = models.FloatField(
        _("Species matching IOU threshold"),
        default=0.5,
        validators=[MinValueValidator(0.0), MaxValueValidator(1.0)],
        help_text=_("IOU threshold for species matching"),
        help_text=_("IOU threshold for species matching if merging is enabled"),
    )

    observation_type_confidence_warning_threshold = models.FloatField(
        _("Observation type confidence warning threshold"),
        default=None,
@@ -317,7 +316,6 @@ class ClassificationProject(models.Model):
        validators=[MinValueValidator(0.0), MaxValueValidator(1.0)],
        help_text=_("Confidence threshold for observation type warning"),
    )

    species_confidence_warning_threshold = models.FloatField(
        _("Species confidence warning threshold"),
        default=None,
@@ -326,7 +324,6 @@ class ClassificationProject(models.Model):
        validators=[MinValueValidator(0.0), MaxValueValidator(1.0)],
        help_text=_("Confidence threshold for species warning"),
    )

    # Blurring options
    blur_humans = models.BooleanField(
        _("Blur humans"),
@@ -353,7 +350,6 @@ class ClassificationProject(models.Model):
            "This setting is used for privacy reasons and will overwrite the source images."
        ),
    )

    hide_classification_attributes_for_non_animals = models.BooleanField(
        _("Hide classification attributes for non-animals"),
        default=True,
@@ -361,8 +357,6 @@ class ClassificationProject(models.Model):
            "Hide classification attributes such as species when observation type is not animal."
        ),
    )

    # --- / Citizen Science ---
    disabled_at = models.DateTimeField(
        blank=True, null=True, editable=False, verbose_name=_("Disabled at")
    )
Loading