endoreg-db 0.8.3.3__py3-none-any.whl → 0.8.3.4__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/services/video_import.py +11 -21
- {endoreg_db-0.8.3.3.dist-info → endoreg_db-0.8.3.4.dist-info}/METADATA +1 -1
- {endoreg_db-0.8.3.3.dist-info → endoreg_db-0.8.3.4.dist-info}/RECORD +5 -5
- {endoreg_db-0.8.3.3.dist-info → endoreg_db-0.8.3.4.dist-info}/WHEEL +0 -0
- {endoreg_db-0.8.3.3.dist-info → endoreg_db-0.8.3.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -719,7 +719,7 @@ class VideoImportService():
|
|
|
719
719
|
self.logger.info("Created sensitive file for %s at %s", video.uuid, target_file_path)
|
|
720
720
|
return target_file_path
|
|
721
721
|
|
|
722
|
-
def _get_processor_roi_info(self) -> Tuple[Optional[
|
|
722
|
+
def _get_processor_roi_info(self) -> Tuple[Optional[dict[str, dict[str, int | None] | None]], Optional[dict[str, int | None]] ]:
|
|
723
723
|
"""Get processor ROI information for masking."""
|
|
724
724
|
endoscope_data_roi_nested = None
|
|
725
725
|
endoscope_image_roi = None
|
|
@@ -742,16 +742,6 @@ class VideoImportService():
|
|
|
742
742
|
except Exception as exc:
|
|
743
743
|
self.logger.error("Failed to retrieve processor ROI information: %s", exc)
|
|
744
744
|
|
|
745
|
-
# Convert dict to nested list if necessary to match return type
|
|
746
|
-
if isinstance(endoscope_data_roi_nested, dict):
|
|
747
|
-
# Convert dict[str, dict[str, int | None] | None] to List[List[Dict[str, Any]]]
|
|
748
|
-
converted_roi = []
|
|
749
|
-
for key, value in endoscope_data_roi_nested.items():
|
|
750
|
-
if isinstance(value, dict):
|
|
751
|
-
converted_roi.append([value])
|
|
752
|
-
elif value is None:
|
|
753
|
-
converted_roi.append([])
|
|
754
|
-
endoscope_data_roi_nested = converted_roi
|
|
755
745
|
|
|
756
746
|
return endoscope_data_roi_nested, endoscope_image_roi
|
|
757
747
|
|
|
@@ -828,9 +818,9 @@ class VideoImportService():
|
|
|
828
818
|
def _perform_frame_cleaning(self, endoscope_data_roi_nested, endoscope_image_roi):
|
|
829
819
|
"""Perform frame cleaning and anonymization."""
|
|
830
820
|
# Instantiate frame cleaner
|
|
831
|
-
is_available,
|
|
821
|
+
is_available, FrameCleaner = self._ensure_frame_cleaning_available()
|
|
832
822
|
|
|
833
|
-
if not is_available:
|
|
823
|
+
if not is_available or FrameCleaner is None:
|
|
834
824
|
raise RuntimeError("Frame cleaning not available")
|
|
835
825
|
|
|
836
826
|
# Prepare parameters for frame cleaning
|
|
@@ -839,31 +829,31 @@ class VideoImportService():
|
|
|
839
829
|
if not raw_video_path or not Path(raw_video_path).exists():
|
|
840
830
|
raise RuntimeError(f"Raw video path not found: {raw_video_path}")
|
|
841
831
|
|
|
842
|
-
|
|
843
832
|
# Create temporary output path for cleaned video
|
|
844
833
|
video_filename = self.processing_context.get('video_filename', Path(raw_video_path).name)
|
|
845
834
|
cleaned_filename = f"cleaned_{video_filename}"
|
|
846
835
|
cleaned_video_path = Path(raw_video_path).parent / cleaned_filename
|
|
847
|
-
|
|
848
|
-
|
|
836
|
+
|
|
837
|
+
# Instantiate FrameCleaner object
|
|
838
|
+
frame_cleaner_instance = FrameCleaner()
|
|
839
|
+
|
|
849
840
|
# Clean video with ROI masking (heavy I/O operation)
|
|
850
|
-
actual_cleaned_path, extracted_metadata =
|
|
841
|
+
actual_cleaned_path, extracted_metadata = frame_cleaner_instance.clean_video(
|
|
851
842
|
video_path=Path(raw_video_path),
|
|
852
843
|
endoscope_image_roi=endoscope_image_roi,
|
|
853
844
|
endoscope_data_roi_nested=endoscope_data_roi_nested,
|
|
854
845
|
output_path=cleaned_video_path,
|
|
855
846
|
technique="mask_overlay"
|
|
856
847
|
)
|
|
857
|
-
|
|
858
|
-
|
|
848
|
+
|
|
859
849
|
# Store cleaned video path for later use in _cleanup_and_archive
|
|
860
850
|
self.processing_context['cleaned_video_path'] = actual_cleaned_path
|
|
861
851
|
self.processing_context['extracted_metadata'] = extracted_metadata
|
|
862
|
-
|
|
852
|
+
|
|
863
853
|
# Update sensitive metadata with extracted information
|
|
864
854
|
self._update_sensitive_metadata(extracted_metadata)
|
|
865
855
|
self.logger.info(f"Extracted metadata from frame cleaning: {extracted_metadata}")
|
|
866
|
-
|
|
856
|
+
|
|
867
857
|
self.logger.info(f"Frame cleaning with ROI masking completed: {actual_cleaned_path}")
|
|
868
858
|
self.logger.info("Cleaned video will be moved to anonym_videos during cleanup")
|
|
869
859
|
|
|
@@ -602,7 +602,7 @@ endoreg_db/services/pseudonym_service.py,sha256=CJhbtRa6K6SPbphgCZgEMi8AFQtB18CU
|
|
|
602
602
|
endoreg_db/services/requirements_object.py,sha256=290zf8AEbVtCoHhW4Jr7_ud-RvrqYmb1Nz9UBHtTnc0,6164
|
|
603
603
|
endoreg_db/services/segment_sync.py,sha256=YgHvIHkbW4mqCu0ACf3zjRSZnNfxWwt4gh5syUVXuE0,6400
|
|
604
604
|
endoreg_db/services/storage_aware_video_processor.py,sha256=kKFK64vXLeBSVkp1YJonU3gFDTeXZ8C4qb9QZZB99SE,13420
|
|
605
|
-
endoreg_db/services/video_import.py,sha256=
|
|
605
|
+
endoreg_db/services/video_import.py,sha256=RBk0n_oN3VXRBMHtUKsRVjVXYv9VnxlM6GsMx2yHL6s,45187
|
|
606
606
|
endoreg_db/tasks/upload_tasks.py,sha256=OJq7DhNwcbWdXzHY8jz5c51BCVkPN5gSWOz-6Fx6W5M,7799
|
|
607
607
|
endoreg_db/tasks/video_ingest.py,sha256=kxFuYkHijINV0VabQKCFVpJRv6eCAw07tviONurDgg8,5265
|
|
608
608
|
endoreg_db/tasks/video_processing_tasks.py,sha256=rZ7Kr49bAR4Q-vALO2SURebrhcJ5hSFGwjF4aULrOao,14089
|
|
@@ -786,7 +786,7 @@ endoreg_db/views/video/video_meta.py,sha256=C1wBMTtQb_yzEUrhFGAy2UHEWMk_CbU75WXX
|
|
|
786
786
|
endoreg_db/views/video/video_processing_history.py,sha256=mhFuS8RG5GV8E-lTtuD0qrq-bIpnUFp8vy9aERfC-J8,770
|
|
787
787
|
endoreg_db/views/video/video_remove_frames.py,sha256=2FmvNrSPM0fUXiBxINN6vBUUDCqDlBkNcGR3WsLDgKo,1696
|
|
788
788
|
endoreg_db/views/video/video_stream.py,sha256=kLyuf0ORTmsLeYUQkTQ6iRYqlIQozWhMMR3Lhfe_trk,12148
|
|
789
|
-
endoreg_db-0.8.3.
|
|
790
|
-
endoreg_db-0.8.3.
|
|
791
|
-
endoreg_db-0.8.3.
|
|
792
|
-
endoreg_db-0.8.3.
|
|
789
|
+
endoreg_db-0.8.3.4.dist-info/METADATA,sha256=a9terVG2Fh1NBsonpVMM9l5O7PS8FSlAPOMdcg1vAOY,14758
|
|
790
|
+
endoreg_db-0.8.3.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
791
|
+
endoreg_db-0.8.3.4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
792
|
+
endoreg_db-0.8.3.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|