Compare commits

...

4 Commits

Author SHA1 Message Date
88180d035c feat: blacking out image 2025-04-24 11:26:17 +02:00
b88f9c22a3 feat: improved bounding box format 2025-04-24 11:21:31 +02:00
cb9e594837 feat: added steps dir 2025-04-24 11:00:54 +02:00
0895256dc4 fix: converting ndarray to list 2025-04-24 10:58:21 +02:00
3 changed files with 10 additions and 4 deletions

View File

@ -1,7 +1,8 @@
from .get_bounding_boxes import select_bounding_boxes from .get_bounding_boxes import select_bounding_boxes
from .pixelation_process import pixelate
def cli(): def cli():
print(f"Running secure_pixelation") print(f"Running secure_pixelation")
select_bounding_boxes("assets/human_detection/test.png") pixelate("assets/human_detection/test.png")

View File

@ -1,6 +1,6 @@
from __future__ import annotations from __future__ import annotations
from typing import Union, List from typing import Union, List, Tuple
from pathlib import Path from pathlib import Path
import json import json
@ -17,13 +17,18 @@ class RawImage:
self.meta_data = self.read_meta() self.meta_data = self.read_meta()
self.image = self.get_image() self.image = self.get_image()
def _get_path(self, ending: str, original_suffix: bool = False) -> Path: def _get_path(self, ending: str, original_suffix: bool = False) -> Path:
if original_suffix: if original_suffix:
return self.file.with_name(self.file.stem + "_" + ending + self.file.suffix) return self.file.with_name(self.file.stem + "_" + ending + self.file.suffix)
else: else:
return self.file.with_name(self.file.stem + "_" + ending) return self.file.with_name(self.file.stem + "_" + ending)
def get_dir(self, name: str) -> Path:
p = self._get_path(ending=name, original_suffix=False)
p.mkdir(exist_ok=True, parents=True)
return p
def read_meta(self) -> dict: def read_meta(self) -> dict:
if not self.meta_file.exists(): if not self.meta_file.exists():
return {} return {}

View File

@ -18,5 +18,5 @@ def select_bounding_boxes(to_detect: str):
fromCenter=False fromCenter=False
) )
raw_image.bounding_boxes.extend(bounding_boxes) raw_image.bounding_boxes.extend(bounding_boxes.tolist())
raw_image.write_meta() raw_image.write_meta()