endoreg-db 0.5.2__py3-none-any.whl → 0.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of endoreg-db might be problematic. Click here for more details.
- endoreg_db/admin.py +90 -1
- endoreg_db/urls.py +173 -0
- endoreg_db/views.py +0 -3
- endoreg_db-0.6.0.dist-info/METADATA +151 -0
- endoreg_db-0.6.0.dist-info/RECORD +11 -0
- {endoreg_db-0.5.2.dist-info → endoreg_db-0.6.0.dist-info}/WHEEL +2 -1
- endoreg_db-0.6.0.dist-info/top_level.txt +1 -0
- endoreg_db/data/__init__.py +0 -72
- endoreg_db/data/active_model/data.yaml +0 -3
- endoreg_db/data/agl_service/data.yaml +0 -19
- endoreg_db/data/case_template/rule/00_patient_lab_sample_add_default_value.yaml +0 -167
- endoreg_db/data/case_template/rule/01_patient-set-age.yaml +0 -8
- endoreg_db/data/case_template/rule/01_patient-set-gender.yaml +0 -9
- endoreg_db/data/case_template/rule/11_create_patient_lab_sample.yaml +0 -23
- endoreg_db/data/case_template/rule/12_create-patient_medication-anticoagulation.yaml +0 -19
- endoreg_db/data/case_template/rule/13_create-patient_medication_schedule-anticoagulation.yaml +0 -19
- endoreg_db/data/case_template/rule/19_create_patient.yaml +0 -17
- endoreg_db/data/case_template/rule_type/base_types.yaml +0 -35
- endoreg_db/data/case_template/rule_value/.init +0 -0
- endoreg_db/data/case_template/rule_value_type/base_types.yaml +0 -59
- endoreg_db/data/case_template/template/base.yaml +0 -8
- endoreg_db/data/case_template/template_type/pre_endoscopy.yaml +0 -3
- endoreg_db/data/case_template/tmp/_rule_value +0 -13
- endoreg_db/data/case_template/tmp/rule/01_atrial_fibrillation.yaml +0 -21
- endoreg_db/data/case_template/tmp/rule/02_create_object.yaml +0 -10
- endoreg_db/data/case_template/tmp/template/atrial_fibrillation_low_risk.yaml +0 -7
- endoreg_db/data/center/data.yaml +0 -60
- endoreg_db/data/center_resource/green_endoscopy_dashboard_CenterResource.yaml +0 -144
- endoreg_db/data/center_waste/green_endoscopy_dashboard_CenterWaste.yaml +0 -48
- endoreg_db/data/disease/cardiovascular.yaml +0 -37
- endoreg_db/data/disease/hepatology.yaml +0 -5
- endoreg_db/data/disease/misc.yaml +0 -6
- endoreg_db/data/disease/renal.yaml +0 -5
- endoreg_db/data/disease_classification/chronic_kidney_disease.yaml +0 -6
- endoreg_db/data/disease_classification/coronary_vessel_disease.yaml +0 -6
- endoreg_db/data/disease_classification_choice/chronic_kidney_disease.yaml +0 -41
- endoreg_db/data/disease_classification_choice/coronary_vessel_disease.yaml +0 -20
- endoreg_db/data/distribution/date/patient.yaml +0 -7
- endoreg_db/data/distribution/multiple_categorical/.init +0 -0
- endoreg_db/data/distribution/numeric/.init +0 -0
- endoreg_db/data/distribution/single_categorical/patient.yaml +0 -7
- endoreg_db/data/emission_factor/green_endoscopy_dashboard_EmissionFactor.yaml +0 -132
- endoreg_db/data/endoscope_type/data.yaml +0 -11
- endoreg_db/data/endoscopy_processor/data.yaml +0 -47
- endoreg_db/data/event/cardiology.yaml +0 -28
- endoreg_db/data/event/neurology.yaml +0 -14
- endoreg_db/data/event/surgery.yaml +0 -13
- endoreg_db/data/event/thrombembolism.yaml +0 -20
- endoreg_db/data/examination/examinations/data.yaml +0 -66
- endoreg_db/data/examination/time/data.yaml +0 -48
- endoreg_db/data/examination/time-type/data.yaml +0 -8
- endoreg_db/data/examination/type/data.yaml +0 -5
- endoreg_db/data/gender/data.yaml +0 -18
- endoreg_db/data/information_source/data.yaml +0 -30
- endoreg_db/data/information_source/medication.yaml +0 -6
- endoreg_db/data/lab_value/cardiac_enzymes.yaml +0 -31
- endoreg_db/data/lab_value/coagulation.yaml +0 -49
- endoreg_db/data/lab_value/electrolytes.yaml +0 -190
- endoreg_db/data/lab_value/gastrointestinal_function.yaml +0 -121
- endoreg_db/data/lab_value/hematology.yaml +0 -169
- endoreg_db/data/lab_value/hormones.yaml +0 -53
- endoreg_db/data/lab_value/lipids.yaml +0 -44
- endoreg_db/data/lab_value/misc.yaml +0 -30
- endoreg_db/data/lab_value/renal_function.yaml +0 -11
- endoreg_db/data/label/label/data.yaml +0 -62
- endoreg_db/data/label/label-set/data.yaml +0 -18
- endoreg_db/data/label/label-type/data.yaml +0 -7
- endoreg_db/data/log_type/data.yaml +0 -57
- endoreg_db/data/material/material.yaml +0 -91
- endoreg_db/data/medication/anticoagulation.yaml +0 -65
- endoreg_db/data/medication/tah.yaml +0 -70
- endoreg_db/data/medication_indication/anticoagulation.yaml +0 -120
- endoreg_db/data/medication_indication_type/data.yaml +0 -11
- endoreg_db/data/medication_indication_type/thrombembolism.yaml +0 -41
- endoreg_db/data/medication_intake_time/base.yaml +0 -31
- endoreg_db/data/medication_schedule/apixaban.yaml +0 -95
- endoreg_db/data/medication_schedule/ass.yaml +0 -12
- endoreg_db/data/medication_schedule/enoxaparin.yaml +0 -26
- endoreg_db/data/model_type/data.yaml +0 -7
- endoreg_db/data/network_device/data.yaml +0 -29
- endoreg_db/data/network_device_type/data.yaml +0 -12
- endoreg_db/data/patient_lab_sample_type/generic.yaml +0 -6
- endoreg_db/data/pdf_type/data.yaml +0 -28
- endoreg_db/data/product/green_endoscopy_dashboard_Product.yaml +0 -66
- endoreg_db/data/product_group/green_endoscopy_dashboard_ProductGroup.yaml +0 -33
- endoreg_db/data/product_material/green_endoscopy_dashboard_ProductMaterial.yaml +0 -308
- endoreg_db/data/product_weight/green_endoscopy_dashboard_ProductWeight.yaml +0 -88
- endoreg_db/data/profession/data.yaml +0 -70
- endoreg_db/data/reference_product/green_endoscopy_dashboard_ReferenceProduct.yaml +0 -55
- endoreg_db/data/report_reader_flag/ukw-examination-generic.yaml +0 -26
- endoreg_db/data/report_reader_flag/ukw-histology-generic.yaml +0 -19
- endoreg_db/data/resource/green_endoscopy_dashboard_Resource.yaml +0 -15
- endoreg_db/data/tmp/chronic_kidney_disease.yaml +0 -0
- endoreg_db/data/tmp/congestive_heart_failure.yaml +0 -0
- endoreg_db/data/transport_route/green_endoscopy_dashboard_TransportRoute.yaml +0 -12
- endoreg_db/data/unit/concentration.yaml +0 -92
- endoreg_db/data/unit/data.yaml +0 -17
- endoreg_db/data/unit/length.yaml +0 -31
- endoreg_db/data/unit/misc.yaml +0 -20
- endoreg_db/data/unit/rate.yaml +0 -6
- endoreg_db/data/unit/time.yaml +0 -13
- endoreg_db/data/unit/volume.yaml +0 -35
- endoreg_db/data/unit/weight.yaml +0 -38
- endoreg_db/data/waste/data.yaml +0 -12
- endoreg_db/forms/__init__.py +0 -3
- endoreg_db/forms/questionnaires/__init__.py +0 -1
- endoreg_db/forms/questionnaires/tto_questionnaire.py +0 -23
- endoreg_db/forms/settings/__init__.py +0 -8
- endoreg_db/forms/unit.py +0 -6
- endoreg_db/management/commands/_load_model_template.py +0 -41
- endoreg_db/management/commands/delete_all.py +0 -18
- endoreg_db/management/commands/delete_legacy_images.py +0 -19
- endoreg_db/management/commands/delete_legacy_videos.py +0 -17
- endoreg_db/management/commands/extract_legacy_video_frames.py +0 -18
- endoreg_db/management/commands/fetch_legacy_image_dataset.py +0 -32
- endoreg_db/management/commands/fix_auth_permission.py +0 -20
- endoreg_db/management/commands/import_legacy_images.py +0 -94
- endoreg_db/management/commands/import_legacy_videos.py +0 -76
- endoreg_db/management/commands/load_active_model_data.py +0 -45
- endoreg_db/management/commands/load_ai_model_data.py +0 -45
- endoreg_db/management/commands/load_base_db_data.py +0 -136
- endoreg_db/management/commands/load_center_data.py +0 -43
- endoreg_db/management/commands/load_disease_classification_choices_data.py +0 -41
- endoreg_db/management/commands/load_disease_classification_data.py +0 -41
- endoreg_db/management/commands/load_disease_data.py +0 -40
- endoreg_db/management/commands/load_distribution_data.py +0 -66
- endoreg_db/management/commands/load_endoscope_type_data.py +0 -45
- endoreg_db/management/commands/load_endoscopy_processor_data.py +0 -45
- endoreg_db/management/commands/load_event_data.py +0 -41
- endoreg_db/management/commands/load_examination_data.py +0 -75
- endoreg_db/management/commands/load_g_play_data.py +0 -113
- endoreg_db/management/commands/load_gender_data.py +0 -44
- endoreg_db/management/commands/load_green_endoscopy_wuerzburg_data.py +0 -133
- endoreg_db/management/commands/load_information_source.py +0 -45
- endoreg_db/management/commands/load_lab_value_data.py +0 -50
- endoreg_db/management/commands/load_label_data.py +0 -67
- endoreg_db/management/commands/load_logging_data.py +0 -39
- endoreg_db/management/commands/load_medication_data.py +0 -41
- endoreg_db/management/commands/load_medication_indication_data.py +0 -63
- endoreg_db/management/commands/load_medication_indication_type_data.py +0 -41
- endoreg_db/management/commands/load_medication_intake_time_data.py +0 -41
- endoreg_db/management/commands/load_medication_schedule_data.py +0 -55
- endoreg_db/management/commands/load_network_data.py +0 -57
- endoreg_db/management/commands/load_pdf_type_data.py +0 -61
- endoreg_db/management/commands/load_profession_data.py +0 -44
- endoreg_db/management/commands/load_report_reader_flag.py +0 -46
- endoreg_db/management/commands/load_unit_data.py +0 -46
- endoreg_db/management/commands/load_user_groups.py +0 -28
- endoreg_db/management/commands/register_ai_model.py +0 -64
- endoreg_db/management/commands/reset_celery_schedule.py +0 -9
- endoreg_db/migrations/0001_initial.py +0 -1567
- endoreg_db/migrations/0002_anonymizedimagelabel_anonymousimageannotation_and_more.py +0 -55
- endoreg_db/migrations/0003_anonymousimageannotation_original_image_url_and_more.py +0 -39
- endoreg_db/migrations/0004_alter_rawpdffile_file.py +0 -20
- endoreg_db/migrations/0005_uploadedfile_alter_rawpdffile_file_anonymizedfile.py +0 -40
- endoreg_db/migrations/0006_alter_rawpdffile_file.py +0 -20
- endoreg_db/migrations/0007_networkdevicelogentry_datetime_and_more.py +0 -43
- endoreg_db/migrations/0008_networkdevicelogentry_aglnet_ip_and_more.py +0 -28
- endoreg_db/migrations/0009_alter_networkdevicelogentry_vpn_service_status.py +0 -18
- endoreg_db/migrations/0010_remove_networkdevicelogentry_hostname.py +0 -17
- endoreg_db/migrations/__init__.py +0 -0
- endoreg_db/models/__init__.py +0 -73
- endoreg_db/models/ai_model/__init__.py +0 -3
- endoreg_db/models/ai_model/active_model.py +0 -9
- endoreg_db/models/ai_model/model_meta.py +0 -24
- endoreg_db/models/ai_model/model_type.py +0 -26
- endoreg_db/models/ai_model/utils.py +0 -8
- endoreg_db/models/annotation/__init__.py +0 -3
- endoreg_db/models/annotation/anonymized_image_annotation.py +0 -60
- endoreg_db/models/annotation/binary_classification_annotation_task.py +0 -80
- endoreg_db/models/annotation/image_classification.py +0 -27
- endoreg_db/models/case_template/__init__.py +0 -6
- endoreg_db/models/case_template/case_template.py +0 -81
- endoreg_db/models/case_template/case_template_rule.py +0 -276
- endoreg_db/models/case_template/case_template_rule_value.py +0 -73
- endoreg_db/models/case_template/case_template_type.py +0 -28
- endoreg_db/models/center/__init__.py +0 -4
- endoreg_db/models/center/center.py +0 -25
- endoreg_db/models/center/center_product.py +0 -34
- endoreg_db/models/center/center_resource.py +0 -19
- endoreg_db/models/center/center_waste.py +0 -11
- endoreg_db/models/data_file/__init__.py +0 -6
- endoreg_db/models/data_file/base_classes/__init__.py +0 -2
- endoreg_db/models/data_file/base_classes/abstract_frame.py +0 -51
- endoreg_db/models/data_file/base_classes/abstract_video.py +0 -201
- endoreg_db/models/data_file/frame.py +0 -45
- endoreg_db/models/data_file/import_classes/__init__.py +0 -32
- endoreg_db/models/data_file/import_classes/processing_functions/__init__.py +0 -35
- endoreg_db/models/data_file/import_classes/processing_functions/pdf.py +0 -28
- endoreg_db/models/data_file/import_classes/processing_functions/video.py +0 -260
- endoreg_db/models/data_file/import_classes/raw_pdf.py +0 -188
- endoreg_db/models/data_file/import_classes/raw_video.py +0 -343
- endoreg_db/models/data_file/metadata/__init__.py +0 -3
- endoreg_db/models/data_file/metadata/pdf_meta.py +0 -70
- endoreg_db/models/data_file/metadata/sensitive_meta.py +0 -31
- endoreg_db/models/data_file/metadata/video_meta.py +0 -133
- endoreg_db/models/data_file/report_file.py +0 -89
- endoreg_db/models/data_file/video/__init__.py +0 -7
- endoreg_db/models/data_file/video/import_meta.py +0 -25
- endoreg_db/models/data_file/video/video.py +0 -25
- endoreg_db/models/data_file/video_segment.py +0 -107
- endoreg_db/models/disease.py +0 -56
- endoreg_db/models/emission/__init__.py +0 -1
- endoreg_db/models/emission/emission_factor.py +0 -20
- endoreg_db/models/event.py +0 -22
- endoreg_db/models/examination/__init__.py +0 -4
- endoreg_db/models/examination/examination.py +0 -26
- endoreg_db/models/examination/examination_time.py +0 -27
- endoreg_db/models/examination/examination_time_type.py +0 -24
- endoreg_db/models/examination/examination_type.py +0 -18
- endoreg_db/models/hardware/__init__.py +0 -2
- endoreg_db/models/hardware/endoscope.py +0 -44
- endoreg_db/models/hardware/endoscopy_processor.py +0 -143
- endoreg_db/models/information_source.py +0 -29
- endoreg_db/models/label/__init__.py +0 -1
- endoreg_db/models/label/label.py +0 -84
- endoreg_db/models/laboratory/__init__.py +0 -1
- endoreg_db/models/laboratory/lab_value.py +0 -102
- endoreg_db/models/legacy_data/__init__.py +0 -3
- endoreg_db/models/legacy_data/image.py +0 -34
- endoreg_db/models/logging/__init__.py +0 -4
- endoreg_db/models/logging/agl_service.py +0 -19
- endoreg_db/models/logging/base.py +0 -22
- endoreg_db/models/logging/log_type.py +0 -23
- endoreg_db/models/logging/network_device.py +0 -27
- endoreg_db/models/medication/__init__.py +0 -1
- endoreg_db/models/medication/medication.py +0 -148
- endoreg_db/models/network/__init__.py +0 -3
- endoreg_db/models/network/agl_service.py +0 -38
- endoreg_db/models/network/network_device.py +0 -53
- endoreg_db/models/network/network_device_type.py +0 -23
- endoreg_db/models/other/__init__.py +0 -5
- endoreg_db/models/other/distribution.py +0 -215
- endoreg_db/models/other/material.py +0 -16
- endoreg_db/models/other/resource.py +0 -18
- endoreg_db/models/other/transport_route.py +0 -21
- endoreg_db/models/other/waste.py +0 -20
- endoreg_db/models/patient_examination/__init__.py +0 -35
- endoreg_db/models/permissions/__init__.py +0 -44
- endoreg_db/models/persons/__init__.py +0 -7
- endoreg_db/models/persons/examiner/__init__.py +0 -2
- endoreg_db/models/persons/examiner/examiner.py +0 -16
- endoreg_db/models/persons/examiner/examiner_type.py +0 -2
- endoreg_db/models/persons/first_name.py +0 -18
- endoreg_db/models/persons/gender.py +0 -22
- endoreg_db/models/persons/last_name.py +0 -20
- endoreg_db/models/persons/patient/__init__.py +0 -8
- endoreg_db/models/persons/patient/case/__init__.py +0 -0
- endoreg_db/models/persons/patient/case/case.py +0 -30
- endoreg_db/models/persons/patient/patient.py +0 -216
- endoreg_db/models/persons/patient/patient_disease.py +0 -16
- endoreg_db/models/persons/patient/patient_event.py +0 -22
- endoreg_db/models/persons/patient/patient_lab_sample.py +0 -106
- endoreg_db/models/persons/patient/patient_lab_value.py +0 -176
- endoreg_db/models/persons/patient/patient_medication.py +0 -44
- endoreg_db/models/persons/patient/patient_medication_schedule.py +0 -28
- endoreg_db/models/persons/person.py +0 -31
- endoreg_db/models/persons/portal_user_information.py +0 -27
- endoreg_db/models/prediction/__init__.py +0 -2
- endoreg_db/models/prediction/image_classification.py +0 -37
- endoreg_db/models/prediction/video_prediction_meta.py +0 -244
- endoreg_db/models/product/__init__.py +0 -5
- endoreg_db/models/product/product.py +0 -97
- endoreg_db/models/product/product_group.py +0 -19
- endoreg_db/models/product/product_material.py +0 -24
- endoreg_db/models/product/product_weight.py +0 -26
- endoreg_db/models/product/reference_product.py +0 -99
- endoreg_db/models/questionnaires/__init__.py +0 -114
- endoreg_db/models/quiz/__init__.py +0 -2
- endoreg_db/models/quiz/quiz_answer.py +0 -41
- endoreg_db/models/quiz/quiz_question.py +0 -54
- endoreg_db/models/report_reader/__init__.py +0 -2
- endoreg_db/models/report_reader/report_reader_config.py +0 -53
- endoreg_db/models/report_reader/report_reader_flag.py +0 -20
- endoreg_db/models/rules/__init__.py +0 -5
- endoreg_db/models/rules/rule.py +0 -24
- endoreg_db/models/rules/rule_applicator.py +0 -224
- endoreg_db/models/rules/rule_attribute_dtype.py +0 -19
- endoreg_db/models/rules/rule_type.py +0 -22
- endoreg_db/models/rules/ruleset.py +0 -19
- endoreg_db/models/unit.py +0 -22
- endoreg_db/queries/__init__.py +0 -5
- endoreg_db/queries/annotations/__init__.py +0 -3
- endoreg_db/queries/annotations/legacy.py +0 -158
- endoreg_db/queries/get/__init__.py +0 -6
- endoreg_db/queries/get/annotation.py +0 -0
- endoreg_db/queries/get/center.py +0 -42
- endoreg_db/queries/get/model.py +0 -13
- endoreg_db/queries/get/patient.py +0 -14
- endoreg_db/queries/get/patient_examination.py +0 -20
- endoreg_db/queries/get/prediction.py +0 -0
- endoreg_db/queries/get/report_file.py +0 -33
- endoreg_db/queries/get/video.py +0 -31
- endoreg_db/queries/get/video_import_meta.py +0 -0
- endoreg_db/queries/get/video_prediction_meta.py +0 -0
- endoreg_db/queries/sanity/__init_.py +0 -0
- endoreg_db/serializers/__init__.py +0 -10
- endoreg_db/serializers/ai_model.py +0 -19
- endoreg_db/serializers/annotation.py +0 -17
- endoreg_db/serializers/center.py +0 -11
- endoreg_db/serializers/examination.py +0 -33
- endoreg_db/serializers/frame.py +0 -13
- endoreg_db/serializers/hardware.py +0 -21
- endoreg_db/serializers/label.py +0 -22
- endoreg_db/serializers/patient.py +0 -10
- endoreg_db/serializers/prediction.py +0 -15
- endoreg_db/serializers/report_file.py +0 -7
- endoreg_db/serializers/video.py +0 -27
- endoreg_db/utils/__init__.py +0 -1
- endoreg_db/utils/cropping.py +0 -29
- endoreg_db/utils/dataloader.py +0 -92
- endoreg_db/utils/file_operations.py +0 -30
- endoreg_db/utils/hashs.py +0 -34
- endoreg_db/utils/legacy_ocr.py +0 -201
- endoreg_db/utils/ocr.py +0 -190
- endoreg_db/utils/uuid.py +0 -4
- endoreg_db/utils/video_metadata.py +0 -87
- endoreg_db-0.5.2.dist-info/METADATA +0 -27
- endoreg_db-0.5.2.dist-info/RECORD +0 -319
- {endoreg_db-0.5.2.dist-info/licenses → endoreg_db-0.6.0.dist-info}/LICENSE +0 -0
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# Generated by Django 4.2.15 on 2024-08-28 11:05
|
|
2
|
-
|
|
3
|
-
import django.core.files.storage
|
|
4
|
-
import django.core.validators
|
|
5
|
-
from django.db import migrations, models
|
|
6
|
-
import django.db.models.deletion
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class Migration(migrations.Migration):
|
|
10
|
-
|
|
11
|
-
dependencies = [
|
|
12
|
-
('endoreg_db', '0001_initial'),
|
|
13
|
-
]
|
|
14
|
-
|
|
15
|
-
operations = [
|
|
16
|
-
migrations.CreateModel(
|
|
17
|
-
name='AnonymizedImageLabel',
|
|
18
|
-
fields=[
|
|
19
|
-
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
20
|
-
('name', models.CharField(max_length=255, unique=True)),
|
|
21
|
-
('description', models.TextField(blank=True, null=True)),
|
|
22
|
-
],
|
|
23
|
-
),
|
|
24
|
-
migrations.CreateModel(
|
|
25
|
-
name='AnonymousImageAnnotation',
|
|
26
|
-
fields=[
|
|
27
|
-
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
28
|
-
('image_name', models.CharField(max_length=255)),
|
|
29
|
-
('slug', models.SlugField(blank=True, null=True, unique=True)),
|
|
30
|
-
('polyp_count', models.IntegerField()),
|
|
31
|
-
('comments', models.CharField(max_length=255)),
|
|
32
|
-
('gender', models.CharField(max_length=255)),
|
|
33
|
-
('name_image_url', models.CharField(max_length=255)),
|
|
34
|
-
('date_created', models.DateTimeField(auto_now_add=True)),
|
|
35
|
-
('label', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='endoreg_db.label')),
|
|
36
|
-
],
|
|
37
|
-
),
|
|
38
|
-
migrations.AlterField(
|
|
39
|
-
model_name='rawpdffile',
|
|
40
|
-
name='file',
|
|
41
|
-
field=models.FileField(storage=django.core.files.storage.FileSystemStorage(location='/home/agl-admin/agl-validator-backend/agl_validator_backend/erc_data/raw_pdf'), upload_to='raw_pdf/', validators=[django.core.validators.FileExtensionValidator(allowed_extensions=['pdf'])]),
|
|
42
|
-
),
|
|
43
|
-
migrations.CreateModel(
|
|
44
|
-
name='DroppedName',
|
|
45
|
-
fields=[
|
|
46
|
-
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
47
|
-
('name', models.CharField(max_length=255)),
|
|
48
|
-
('gender', models.CharField(max_length=255)),
|
|
49
|
-
('x', models.FloatField()),
|
|
50
|
-
('y', models.FloatField()),
|
|
51
|
-
('name_image_url', models.CharField(max_length=255)),
|
|
52
|
-
('annotation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dropped_names', to='endoreg_db.anonymousimageannotation')),
|
|
53
|
-
],
|
|
54
|
-
),
|
|
55
|
-
]
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# Generated by Django 4.2.15 on 2024-08-29 07:15
|
|
2
|
-
|
|
3
|
-
from django.db import migrations, models
|
|
4
|
-
import django.db.models.deletion
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class Migration(migrations.Migration):
|
|
8
|
-
|
|
9
|
-
dependencies = [
|
|
10
|
-
('endoreg_db', '0002_anonymizedimagelabel_anonymousimageannotation_and_more'),
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
operations = [
|
|
14
|
-
migrations.AddField(
|
|
15
|
-
model_name='anonymousimageannotation',
|
|
16
|
-
name='original_image_url',
|
|
17
|
-
field=models.CharField(default='https://example.com/placeholder.jpg', max_length=255),
|
|
18
|
-
),
|
|
19
|
-
migrations.AddField(
|
|
20
|
-
model_name='anonymousimageannotation',
|
|
21
|
-
name='processed',
|
|
22
|
-
field=models.BooleanField(default=False),
|
|
23
|
-
),
|
|
24
|
-
migrations.AddField(
|
|
25
|
-
model_name='droppedname',
|
|
26
|
-
name='box_coordinates',
|
|
27
|
-
field=models.CharField(blank=True, max_length=255, null=True),
|
|
28
|
-
),
|
|
29
|
-
migrations.AlterField(
|
|
30
|
-
model_name='anonymousimageannotation',
|
|
31
|
-
name='comments',
|
|
32
|
-
field=models.TextField(blank=True, null=True),
|
|
33
|
-
),
|
|
34
|
-
migrations.AlterField(
|
|
35
|
-
model_name='anonymousimageannotation',
|
|
36
|
-
name='label',
|
|
37
|
-
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='endoreg_db.anonymizedimagelabel'),
|
|
38
|
-
),
|
|
39
|
-
]
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# Generated by Django 4.2.14 on 2024-09-04 19:48
|
|
2
|
-
|
|
3
|
-
import django.core.files.storage
|
|
4
|
-
import django.core.validators
|
|
5
|
-
from django.db import migrations, models
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class Migration(migrations.Migration):
|
|
9
|
-
|
|
10
|
-
dependencies = [
|
|
11
|
-
('endoreg_db', '0003_anonymousimageannotation_original_image_url_and_more'),
|
|
12
|
-
]
|
|
13
|
-
|
|
14
|
-
operations = [
|
|
15
|
-
migrations.AlterField(
|
|
16
|
-
model_name='rawpdffile',
|
|
17
|
-
name='file',
|
|
18
|
-
field=models.FileField(storage=django.core.files.storage.FileSystemStorage(location='/home/agl-admin/agl_anonymizer/agl_anonymizer/erc_data/raw_pdf'), upload_to='raw_pdf/', validators=[django.core.validators.FileExtensionValidator(allowed_extensions=['pdf'])]),
|
|
19
|
-
),
|
|
20
|
-
]
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# Generated by Django 4.2.15 on 2024-09-17 11:46
|
|
2
|
-
|
|
3
|
-
import django.core.files.storage
|
|
4
|
-
import django.core.validators
|
|
5
|
-
from django.db import migrations, models
|
|
6
|
-
import django.db.models.deletion
|
|
7
|
-
import django.utils.timezone
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Migration(migrations.Migration):
|
|
11
|
-
|
|
12
|
-
dependencies = [
|
|
13
|
-
('endoreg_db', '0004_alter_rawpdffile_file'),
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
operations = [
|
|
17
|
-
migrations.CreateModel(
|
|
18
|
-
name='UploadedFile',
|
|
19
|
-
fields=[
|
|
20
|
-
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
21
|
-
('original_file', models.FileField(upload_to='uploads/original/')),
|
|
22
|
-
('upload_date', models.DateTimeField(default=django.utils.timezone.now)),
|
|
23
|
-
('description', models.TextField(blank=True, null=True)),
|
|
24
|
-
],
|
|
25
|
-
),
|
|
26
|
-
migrations.AlterField(
|
|
27
|
-
model_name='rawpdffile',
|
|
28
|
-
name='file',
|
|
29
|
-
field=models.FileField(storage=django.core.files.storage.FileSystemStorage(location='/mnt/hdd-sensitive/Pseudo/import/pdf'), upload_to='raw_pdf/', validators=[django.core.validators.FileExtensionValidator(allowed_extensions=['pdf'])]),
|
|
30
|
-
),
|
|
31
|
-
migrations.CreateModel(
|
|
32
|
-
name='AnonymizedFile',
|
|
33
|
-
fields=[
|
|
34
|
-
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
35
|
-
('anonymized_file', models.FileField(upload_to='uploads/anonymized/')),
|
|
36
|
-
('anonymization_date', models.DateTimeField(default=django.utils.timezone.now)),
|
|
37
|
-
('original_file', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='anonymized_file', to='endoreg_db.uploadedfile')),
|
|
38
|
-
],
|
|
39
|
-
),
|
|
40
|
-
]
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# Generated by Django 5.1.1 on 2024-10-01 16:31
|
|
2
|
-
|
|
3
|
-
import django.core.files.storage
|
|
4
|
-
import django.core.validators
|
|
5
|
-
from django.db import migrations, models
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class Migration(migrations.Migration):
|
|
9
|
-
|
|
10
|
-
dependencies = [
|
|
11
|
-
('endoreg_db', '0005_uploadedfile_alter_rawpdffile_file_anonymizedfile'),
|
|
12
|
-
]
|
|
13
|
-
|
|
14
|
-
operations = [
|
|
15
|
-
migrations.AlterField(
|
|
16
|
-
model_name='rawpdffile',
|
|
17
|
-
name='file',
|
|
18
|
-
field=models.FileField(storage=django.core.files.storage.FileSystemStorage(location='/home/agl-admin/dev/agl-monitor-flake/agl_monitor/erc_data/raw_pdf'), upload_to='raw_pdf/', validators=[django.core.validators.FileExtensionValidator(allowed_extensions=['pdf'])]),
|
|
19
|
-
),
|
|
20
|
-
]
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# Generated by Django 5.1.1 on 2024-10-12 15:28
|
|
2
|
-
|
|
3
|
-
from django.db import migrations, models
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Migration(migrations.Migration):
|
|
7
|
-
|
|
8
|
-
dependencies = [
|
|
9
|
-
('endoreg_db', '0006_alter_rawpdffile_file'),
|
|
10
|
-
]
|
|
11
|
-
|
|
12
|
-
operations = [
|
|
13
|
-
migrations.AddField(
|
|
14
|
-
model_name='networkdevicelogentry',
|
|
15
|
-
name='datetime',
|
|
16
|
-
field=models.DateTimeField(blank=True, default=None, null=True),
|
|
17
|
-
),
|
|
18
|
-
migrations.AddField(
|
|
19
|
-
model_name='networkdevicelogentry',
|
|
20
|
-
name='ping_vpn',
|
|
21
|
-
field=models.BooleanField(default=False),
|
|
22
|
-
),
|
|
23
|
-
migrations.AddField(
|
|
24
|
-
model_name='networkdevicelogentry',
|
|
25
|
-
name='ping_www',
|
|
26
|
-
field=models.BooleanField(default=False),
|
|
27
|
-
),
|
|
28
|
-
migrations.AddField(
|
|
29
|
-
model_name='networkdevicelogentry',
|
|
30
|
-
name='vpn_service_restart_attempt',
|
|
31
|
-
field=models.BooleanField(default=False),
|
|
32
|
-
),
|
|
33
|
-
migrations.AddField(
|
|
34
|
-
model_name='networkdevicelogentry',
|
|
35
|
-
name='vpn_service_restart_success',
|
|
36
|
-
field=models.BooleanField(blank=True, null=True),
|
|
37
|
-
),
|
|
38
|
-
migrations.AddField(
|
|
39
|
-
model_name='networkdevicelogentry',
|
|
40
|
-
name='vpn_service_status',
|
|
41
|
-
field=models.BooleanField(default=False),
|
|
42
|
-
),
|
|
43
|
-
]
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# Generated by Django 5.1.1 on 2024-10-12 16:13
|
|
2
|
-
|
|
3
|
-
from django.db import migrations, models
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Migration(migrations.Migration):
|
|
7
|
-
|
|
8
|
-
dependencies = [
|
|
9
|
-
('endoreg_db', '0007_networkdevicelogentry_datetime_and_more'),
|
|
10
|
-
]
|
|
11
|
-
|
|
12
|
-
operations = [
|
|
13
|
-
migrations.AddField(
|
|
14
|
-
model_name='networkdevicelogentry',
|
|
15
|
-
name='aglnet_ip',
|
|
16
|
-
field=models.GenericIPAddressField(blank=True, null=True),
|
|
17
|
-
),
|
|
18
|
-
migrations.AddField(
|
|
19
|
-
model_name='networkdevicelogentry',
|
|
20
|
-
name='hostname',
|
|
21
|
-
field=models.CharField(blank=True, max_length=255, null=True),
|
|
22
|
-
),
|
|
23
|
-
migrations.AddField(
|
|
24
|
-
model_name='networkdevicelogentry',
|
|
25
|
-
name='transferred_to_host',
|
|
26
|
-
field=models.BooleanField(default=False),
|
|
27
|
-
),
|
|
28
|
-
]
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# Generated by Django 5.1.1 on 2024-10-12 16:51
|
|
2
|
-
|
|
3
|
-
from django.db import migrations, models
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Migration(migrations.Migration):
|
|
7
|
-
|
|
8
|
-
dependencies = [
|
|
9
|
-
('endoreg_db', '0008_networkdevicelogentry_aglnet_ip_and_more'),
|
|
10
|
-
]
|
|
11
|
-
|
|
12
|
-
operations = [
|
|
13
|
-
migrations.AlterField(
|
|
14
|
-
model_name='networkdevicelogentry',
|
|
15
|
-
name='vpn_service_status',
|
|
16
|
-
field=models.CharField(blank=True, max_length=255, null=True),
|
|
17
|
-
),
|
|
18
|
-
]
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Generated by Django 5.1.1 on 2024-10-12 16:54
|
|
2
|
-
|
|
3
|
-
from django.db import migrations
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Migration(migrations.Migration):
|
|
7
|
-
|
|
8
|
-
dependencies = [
|
|
9
|
-
('endoreg_db', '0009_alter_networkdevicelogentry_vpn_service_status'),
|
|
10
|
-
]
|
|
11
|
-
|
|
12
|
-
operations = [
|
|
13
|
-
migrations.RemoveField(
|
|
14
|
-
model_name='networkdevicelogentry',
|
|
15
|
-
name='hostname',
|
|
16
|
-
),
|
|
17
|
-
]
|
|
File without changes
|
endoreg_db/models/__init__.py
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
from .unit import Unit
|
|
2
|
-
from .information_source import InformationSource
|
|
3
|
-
from .center import *
|
|
4
|
-
from .report_reader import ReportReaderConfig, ReportReaderFlag
|
|
5
|
-
from .emission import *
|
|
6
|
-
from .persons import *
|
|
7
|
-
from .network import *
|
|
8
|
-
from .logging import *
|
|
9
|
-
|
|
10
|
-
from .case_template import *
|
|
11
|
-
# from .other.distribution import (
|
|
12
|
-
# SingleCategoricalValueDistribution,
|
|
13
|
-
# NumericValueDistribution,
|
|
14
|
-
# MultipleCategoricalValueDistribution,
|
|
15
|
-
# DateValueDistribution,
|
|
16
|
-
# )
|
|
17
|
-
from .rules import (
|
|
18
|
-
Rule,
|
|
19
|
-
RuleType,
|
|
20
|
-
Ruleset,
|
|
21
|
-
RuleApplicator,
|
|
22
|
-
Rule
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
from .disease import Disease, DiseaseClassification, DiseaseClassificationChoice
|
|
26
|
-
from .event import Event
|
|
27
|
-
from .laboratory import LabValue
|
|
28
|
-
from .medication import *
|
|
29
|
-
|
|
30
|
-
from .examination import (
|
|
31
|
-
Examination,
|
|
32
|
-
ExaminationType,
|
|
33
|
-
ExaminationTime,
|
|
34
|
-
ExaminationTimeType,
|
|
35
|
-
)
|
|
36
|
-
from .data_file import *
|
|
37
|
-
|
|
38
|
-
from .patient_examination import PatientExamination
|
|
39
|
-
|
|
40
|
-
from .label import Label, LabelType, LabelSet
|
|
41
|
-
|
|
42
|
-
from .annotation import *
|
|
43
|
-
|
|
44
|
-
from .legacy_data import (
|
|
45
|
-
LegacyImage,
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
from .other import *
|
|
49
|
-
|
|
50
|
-
from .product import *
|
|
51
|
-
|
|
52
|
-
from .ai_model import (
|
|
53
|
-
ModelMeta,
|
|
54
|
-
ModelType,
|
|
55
|
-
ActiveModel,
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
from .quiz import *
|
|
59
|
-
|
|
60
|
-
from .prediction import (
|
|
61
|
-
ImageClassificationPrediction,
|
|
62
|
-
LegacyVideoPredictionMeta,
|
|
63
|
-
VideoPredictionMeta,
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
from .hardware import (
|
|
67
|
-
EndoscopyProcessor,
|
|
68
|
-
Endoscope,
|
|
69
|
-
EndoscopeType,
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
from .questionnaires import TtoQuestionnaire
|
|
73
|
-
from .annotation import AnonymousImageAnnotation, AnonymizedImageLabel, DroppedName
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
from django.db import models
|
|
2
|
-
|
|
3
|
-
class ActiveModelManager(models.Manager):
|
|
4
|
-
def get_by_natural_key(self, name):
|
|
5
|
-
return self.get(name=name)
|
|
6
|
-
|
|
7
|
-
class ActiveModel(models.Model):
|
|
8
|
-
name = models.CharField(max_length=255, unique=True)
|
|
9
|
-
model_meta = models.OneToOneField('ModelMeta', on_delete=models.SET_NULL, blank=True, null=True)
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
from django.db import models
|
|
2
|
-
|
|
3
|
-
class ModelMetaManager(models.Manager):
|
|
4
|
-
# natural key is name and version
|
|
5
|
-
def get_by_natural_key(self, name, version):
|
|
6
|
-
return self.get(name=name, version=version)
|
|
7
|
-
|
|
8
|
-
class ModelMeta(models.Model):
|
|
9
|
-
name = models.CharField(max_length=255)
|
|
10
|
-
version = models.CharField(max_length=255)
|
|
11
|
-
type = models.ForeignKey("ModelType", on_delete=models.CASCADE, related_name="models")
|
|
12
|
-
labelset = models.ForeignKey("LabelSet", on_delete=models.CASCADE, related_name="models")
|
|
13
|
-
weights = models.FileField(upload_to='weights/')
|
|
14
|
-
|
|
15
|
-
description = models.TextField(blank=True, null=True)
|
|
16
|
-
date_created = models.DateTimeField(auto_now_add=True)
|
|
17
|
-
objects = ModelMetaManager()
|
|
18
|
-
|
|
19
|
-
def natural_key(self):
|
|
20
|
-
return (self.name, self.version)
|
|
21
|
-
|
|
22
|
-
def __str__(self):
|
|
23
|
-
return f"{self.name} (v: {self.version})"
|
|
24
|
-
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
from django.db import models
|
|
2
|
-
from django.core import serializers
|
|
3
|
-
|
|
4
|
-
class ModelTypeManager(models.Manager):
|
|
5
|
-
def get_by_natural_key(self, name):
|
|
6
|
-
return self.get(name=name)
|
|
7
|
-
|
|
8
|
-
class ModelType(models.Model):
|
|
9
|
-
"""
|
|
10
|
-
A class representing a model type.
|
|
11
|
-
|
|
12
|
-
Attributes:
|
|
13
|
-
name (str): The name of the model type.
|
|
14
|
-
description (str): A description of the model type.
|
|
15
|
-
|
|
16
|
-
"""
|
|
17
|
-
name = models.CharField(max_length=255)
|
|
18
|
-
description = models.TextField(blank=True, null=True)
|
|
19
|
-
|
|
20
|
-
objects = ModelTypeManager()
|
|
21
|
-
|
|
22
|
-
def natural_key(self):
|
|
23
|
-
return (self.name,)
|
|
24
|
-
|
|
25
|
-
def __str__(self):
|
|
26
|
-
return self.name
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
from .model_meta import ModelMeta
|
|
2
|
-
|
|
3
|
-
# get latest model meta by model name
|
|
4
|
-
|
|
5
|
-
# TODO MOVE THIS TO A QUERY FILE
|
|
6
|
-
def get_latest_model_meta_by_model_name(model_name):
|
|
7
|
-
model_meta = ModelMeta.objects.filter(name=model_name).order_by('-version').first()
|
|
8
|
-
return model_meta
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
from .image_classification import ImageClassificationAnnotation
|
|
2
|
-
from .binary_classification_annotation_task import LegacyBinaryClassificationAnnotationTask, BinaryClassificationAnnotationTask
|
|
3
|
-
from .anonymized_image_annotation import AnonymousImageAnnotation, DroppedName, AnonymizedImageLabel, AnonymizedFile, UploadedFile
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
from django.db import models
|
|
2
|
-
from django.utils.text import slugify
|
|
3
|
-
|
|
4
|
-
class AnonymizedImageLabel(models.Model):
|
|
5
|
-
name = models.CharField(max_length=255, unique=True) # Ensuring label names are unique
|
|
6
|
-
description = models.TextField(blank=True, null=True) # Optional description field
|
|
7
|
-
|
|
8
|
-
def __str__(self):
|
|
9
|
-
return self.name
|
|
10
|
-
|
|
11
|
-
class AnonymousImageAnnotation(models.Model):
|
|
12
|
-
label = models.ForeignKey(AnonymizedImageLabel, on_delete=models.CASCADE)
|
|
13
|
-
image_name = models.CharField(max_length=255)
|
|
14
|
-
original_image_url = models.CharField(max_length=255, default='https://example.com/placeholder.jpg') # Field for the original image
|
|
15
|
-
slug = models.SlugField(unique=True, blank=True, null=True)
|
|
16
|
-
polyp_count = models.IntegerField()
|
|
17
|
-
comments = models.TextField(blank=True, null=True) # Comments can be longer
|
|
18
|
-
gender = models.CharField(max_length=255) # Overall gender (if applicable)
|
|
19
|
-
name_image_url = models.CharField(max_length=255)
|
|
20
|
-
date_created = models.DateTimeField(auto_now_add=True)
|
|
21
|
-
processed = models.BooleanField(default=False) # Track if this annotation has been processed
|
|
22
|
-
|
|
23
|
-
def save(self, *args, **kwargs):
|
|
24
|
-
if not self.slug:
|
|
25
|
-
self.slug = slugify(f"{self.label}-{self.image_name}")
|
|
26
|
-
super().save(*args, **kwargs)
|
|
27
|
-
|
|
28
|
-
def __str__(self):
|
|
29
|
-
return f"{self.image_name} - {self.label}"
|
|
30
|
-
|
|
31
|
-
class DroppedName(models.Model):
|
|
32
|
-
annotation = models.ForeignKey(AnonymousImageAnnotation, related_name='dropped_names', on_delete=models.CASCADE)
|
|
33
|
-
name = models.CharField(max_length=255)
|
|
34
|
-
gender = models.CharField(max_length=255) # Gender of the individual name
|
|
35
|
-
x = models.FloatField()
|
|
36
|
-
y = models.FloatField()
|
|
37
|
-
name_image_url = models.CharField(max_length=255)
|
|
38
|
-
box_coordinates = models.CharField(max_length=255, blank=True, null=True) # Store box coordinates if needed
|
|
39
|
-
|
|
40
|
-
def __str__(self):
|
|
41
|
-
return f"{self.name} ({self.gender}) at ({self.x}, {self.y})"
|
|
42
|
-
|
|
43
|
-
from django.db import models
|
|
44
|
-
from django.utils import timezone
|
|
45
|
-
|
|
46
|
-
class UploadedFile(models.Model):
|
|
47
|
-
original_file = models.FileField(upload_to='uploads/original/')
|
|
48
|
-
upload_date = models.DateTimeField(default=timezone.now)
|
|
49
|
-
description = models.TextField(blank=True, null=True)
|
|
50
|
-
|
|
51
|
-
def __str__(self):
|
|
52
|
-
return self.original_file.name
|
|
53
|
-
|
|
54
|
-
class AnonymizedFile(models.Model):
|
|
55
|
-
original_file = models.OneToOneField(UploadedFile, on_delete=models.CASCADE, related_name='anonymized_file')
|
|
56
|
-
anonymized_file = models.FileField(upload_to='uploads/anonymized/')
|
|
57
|
-
anonymization_date = models.DateTimeField(default=timezone.now)
|
|
58
|
-
|
|
59
|
-
def __str__(self):
|
|
60
|
-
return f"Anonymized version of {self.original_file.original_file.name}"
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
from django.db import models
|
|
2
|
-
from rest_framework import serializers
|
|
3
|
-
from ..label import Label
|
|
4
|
-
from ..data_file.video_segment import LegacyLabelVideoSegment
|
|
5
|
-
from .image_classification import ImageClassificationAnnotation
|
|
6
|
-
|
|
7
|
-
ANNOTATION_PER_S_THRESHOLD = 2
|
|
8
|
-
|
|
9
|
-
def clear_finished_legacy_tasks():
|
|
10
|
-
# fetch all BinaryClassificationAnnotationTasks that are finished and delete them
|
|
11
|
-
tasks = LegacyBinaryClassificationAnnotationTask.objects.filter(finished=True)
|
|
12
|
-
|
|
13
|
-
# delete tasks with a bulk operation
|
|
14
|
-
tasks.delete()
|
|
15
|
-
|
|
16
|
-
def get_legacy_binary_classification_annotation_tasks_by_label(label:Label, n:int=100, legacy=False):
|
|
17
|
-
clear_finished_legacy_tasks()
|
|
18
|
-
|
|
19
|
-
if legacy:
|
|
20
|
-
# fetch all LegacyLabelVideoSegments with the given label
|
|
21
|
-
_segments = LegacyLabelVideoSegment.objects.filter(label=label)
|
|
22
|
-
frames_for_tasks = []
|
|
23
|
-
|
|
24
|
-
for segment in _segments:
|
|
25
|
-
# check if the segment has already been annotated
|
|
26
|
-
annotations = list(ImageClassificationAnnotation.objects.filter(legacy_frame__in=segment.get_frames(), label=label))
|
|
27
|
-
segment_len_in_s = segment.get_segment_len_in_s()
|
|
28
|
-
|
|
29
|
-
target_annotation_number = segment_len_in_s * ANNOTATION_PER_S_THRESHOLD
|
|
30
|
-
|
|
31
|
-
if len(annotations) < target_annotation_number:
|
|
32
|
-
get_frame_number = int(target_annotation_number - len(annotations))
|
|
33
|
-
frames = segment.get_frames_without_annotation(get_frame_number)
|
|
34
|
-
frames_for_tasks.extend(frames)
|
|
35
|
-
|
|
36
|
-
if len(frames_for_tasks) >= n:
|
|
37
|
-
break
|
|
38
|
-
|
|
39
|
-
# create tasks
|
|
40
|
-
tasks = []
|
|
41
|
-
for frame in frames_for_tasks:
|
|
42
|
-
|
|
43
|
-
# get_or_create task
|
|
44
|
-
task, created = LegacyBinaryClassificationAnnotationTask.objects.get_or_create(
|
|
45
|
-
label=label,
|
|
46
|
-
image_path=frame.image.path,
|
|
47
|
-
frame_id=frame.pk,
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class AbstractBinaryClassificationAnnotationTask(models.Model):
|
|
52
|
-
label = models.ForeignKey("Label", on_delete=models.CASCADE)
|
|
53
|
-
is_finished = models.BooleanField(default=False)
|
|
54
|
-
date_created = models.DateTimeField(auto_now_add=True)
|
|
55
|
-
date_finished = models.DateTimeField(blank=True, null=True)
|
|
56
|
-
image_path = models.CharField(max_length=255, blank=True, null=True)
|
|
57
|
-
image_type = models.CharField(max_length=255, blank=True, null=True)
|
|
58
|
-
frame_id = models.IntegerField(blank=True, null=True)
|
|
59
|
-
labelstudio_project_id = models.IntegerField(blank=True, null=True)
|
|
60
|
-
labelstudio_task_id = models.IntegerField(blank=True, null=True)
|
|
61
|
-
|
|
62
|
-
class Meta:
|
|
63
|
-
abstract = True
|
|
64
|
-
|
|
65
|
-
class BinaryClassificationAnnotationTask(AbstractBinaryClassificationAnnotationTask):
|
|
66
|
-
frame = models.ForeignKey("Frame", on_delete=models.CASCADE, related_name="binary_classification_annotation_tasks")
|
|
67
|
-
image_type = models.CharField(max_length=255, default="frame")
|
|
68
|
-
|
|
69
|
-
def get_frame(self):
|
|
70
|
-
return self.video_segment.get_frame_by_id(self.frame_id)
|
|
71
|
-
|
|
72
|
-
class LegacyBinaryClassificationAnnotationTask(AbstractBinaryClassificationAnnotationTask):
|
|
73
|
-
frame = models.ForeignKey("LegacyFrame", on_delete=models.CASCADE, related_name="binary_classification_annotation_tasks")
|
|
74
|
-
image_type = models.CharField(max_length=255, default="legacy")
|
|
75
|
-
|
|
76
|
-
def get_frame(self):
|
|
77
|
-
return self.frame
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
from django.db import models
|
|
2
|
-
|
|
3
|
-
class ImageClassificationAnnotation(models.Model):
|
|
4
|
-
"""
|
|
5
|
-
A class representing an image classification annotation.
|
|
6
|
-
|
|
7
|
-
Attributes:
|
|
8
|
-
label (str): The label that was assigned to the image.
|
|
9
|
-
confidence (float): The confidence that the label is correct.
|
|
10
|
-
annotator (User): The user that created this annotation.
|
|
11
|
-
date (datetime.datetime): The date and time when this annotation was created.
|
|
12
|
-
|
|
13
|
-
"""
|
|
14
|
-
# Foreign keys to Frame, LegacyFrame, and LegacyImage (only one of these should be set)
|
|
15
|
-
frame = models.ForeignKey("Frame", on_delete=models.CASCADE, blank=True, null=True, related_name="image_classification_annotations")
|
|
16
|
-
legacy_frame = models.ForeignKey("LegacyFrame", on_delete=models.CASCADE, blank=True, null=True, related_name="image_classification_annotations")
|
|
17
|
-
legacy_image = models.ForeignKey("LegacyImage", on_delete=models.CASCADE, blank=True, null=True, related_name="image_classification_annotations")
|
|
18
|
-
|
|
19
|
-
label = models.ForeignKey("Label", on_delete=models.CASCADE, related_name="image_classification_annotations")
|
|
20
|
-
value = models.BooleanField()
|
|
21
|
-
annotator = models.CharField(max_length=255)
|
|
22
|
-
date_created = models.DateTimeField(auto_now_add=True)
|
|
23
|
-
date_modified = models.DateTimeField(auto_now=True)
|
|
24
|
-
|
|
25
|
-
def __str__(self):
|
|
26
|
-
return self.label.name + " - " + str(self.value)
|
|
27
|
-
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
# Django models to define CaseTemplate and CaseTemplateType models
|
|
2
|
-
# (each with "name" field which acts as a natural key)
|
|
3
|
-
from .case_template_rule import CaseTemplateRule, CaseTemplateRuleType
|
|
4
|
-
from .case_template_rule_value import CaseTemplateRuleValue, CaseTemplateRuleValueType
|
|
5
|
-
from .case_template_type import CaseTemplateType
|
|
6
|
-
from .case_template import CaseTemplate
|