Added detection_window_width, detection_window_height, and num_detectors fields

to the simple object detection objects in the Python API.
This commit is contained in:
Davis King 2018-06-25 21:11:35 -04:00
parent 8b5ee898a8
commit 6b581d91f6
1 changed files with 6 additions and 0 deletions

View File

@ -376,6 +376,9 @@ ensures \n\
a list of detections. \n\ a list of detections. \n\
- Upsamples the image upsample_num_times before running the basic \n\ - Upsamples the image upsample_num_times before running the basic \n\
detector.") detector.")
.def_property_readonly("detection_window_height", [](const type& item){return item.get_scanner().get_detection_window_height();})
.def_property_readonly("detection_window_width", [](const type& item){return item.get_scanner().get_detection_window_width();})
.def_property_readonly("num_detectors", [](const type& item){return item.num_detectors();})
.def("run", run_rect_detector, py::arg("image"), py::arg("upsample_num_times")=0, py::arg("adjust_threshold")=0.0, .def("run", run_rect_detector, py::arg("image"), py::arg("upsample_num_times")=0, py::arg("adjust_threshold")=0.0,
"requires \n\ "requires \n\
- image is a numpy ndarray containing either an 8bit grayscale or RGB \n\ - image is a numpy ndarray containing either an 8bit grayscale or RGB \n\
@ -443,6 +446,9 @@ ensures \n\
detector. If you don't know how many times you want to upsample then \n\ detector. If you don't know how many times you want to upsample then \n\
don't provide a value for upsample_num_times and an appropriate \n\ don't provide a value for upsample_num_times and an appropriate \n\
default will be used.") default will be used.")
.def_property_readonly("detection_window_height", [](const type& item){return item.detector.get_scanner().get_detection_window_height();})
.def_property_readonly("detection_window_width", [](const type& item){return item.detector.get_scanner().get_detection_window_width();})
.def_property_readonly("num_detectors", [](const type& item){return item.detector.num_detectors();})
.def("__call__", &type::run_detector2, py::arg("image"), .def("__call__", &type::run_detector2, py::arg("image"),
"requires \n\ "requires \n\
- image is a numpy ndarray containing either an 8bit grayscale or RGB \n\ - image is a numpy ndarray containing either an 8bit grayscale or RGB \n\