diff --git a/.gitignore b/.gitignore index 4a191a8..b38b31c 100644 --- a/.gitignore +++ b/.gitignore @@ -160,4 +160,5 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ .venv -assets/* \ No newline at end of file +assets/* +*.pt \ No newline at end of file diff --git a/secure_pixelation/detect_humans.py b/secure_pixelation/detect_humans.py index 34b1f2b..62fdefa 100644 --- a/secure_pixelation/detect_humans.py +++ b/secure_pixelation/detect_humans.py @@ -266,7 +266,7 @@ def detect_human_parts(human: dict, face_padding: int = 20): cv2.imwrite(detected, image) -def detect_humans(to_detect: str, crop_padding: int = 20, skip_detection_if_present: bool = True): +def detect_humans(to_detect: str, crop_padding: int = 20, skip_detection_if_present: bool = False): _p = Path(to_detect) detected = str(_p.with_name(_p.stem + "_detected" + _p.suffix)) boxes_file = str(_p.with_name(_p.stem + "_boxes.json")) @@ -287,6 +287,9 @@ def detect_humans(to_detect: str, crop_padding: int = 20, skip_detection_if_pres # Load image image = cv2.imread(to_detect) + r = cv2.selectROI(image) + print(r) + original_image = cv2.imread(to_detect) height, width, channels = image.shape diff --git a/secure_pixelation/get_bounding_boxes.py b/secure_pixelation/get_bounding_boxes.py new file mode 100644 index 0000000..0ca13e3 --- /dev/null +++ b/secure_pixelation/get_bounding_boxes.py @@ -0,0 +1 @@ +# https://learnopencv.com/how-to-select-a-bounding-box-roi-in-opencv-cpp-python/ \ No newline at end of file