(C++ port of CropSense-Face-Detection)
CropSense is a tool to crop images based on various bounding box sizes, such as upper body, face, or full body. It utilizes a pre-trained SSD face detection model to accurately identify faces within images and performs precise cropping into a 1:1 ratio based on the detected regions. Useful for creating datasets for model training.
- CMake 3.10+
- OpenCV
- Ninja (optional)
- Open Native Tools Command Prompt for VS 2022
- Navigate to your project folder:
cd your_project_path- Clear existing build folder (if any):
rmdir /s /q build- Configure and build with CMake:
cmake -B build -DOpenCV_DIR="C:/your_path/opencv/build"
cmake --build build- Or with Ninja (faster):
cmake -B build -G Ninja -DOpenCV_DIR="C:/your_path/opencv/build"
cmake --build build- Install OpenCV:
sudo apt-get install -y libopencv-dev ninja-build- Configure and build:
cmake -B build -G Ninja
cmake --build build- Place your images in the
inputfolder - Copy
config.json,deploy.prototxt.txt, andres10_300x300_ssd_iter_140000.caffemodelnext to the executable - Run
main.exe(Windows) or./main(Linux) - Select crop type and preview option
This project is licensed under the MIT License.