@ -37,6 +37,7 @@ namespace dlib
dlib : : simple_object_detector & detector ,
boost : : python : : object img ,
const unsigned int upsampling_amount ,
const double adjust_threshold ,
std : : vector < double > & detection_confidences ,
std : : vector < double > & weight_indices
)
@ -51,7 +52,7 @@ namespace dlib
array2d < unsigned char > temp ;
if ( upsampling_amount = = 0 )
{
detector ( numpy_gray_image ( img ) , rect_detections , 0.0 ) ;
detector ( numpy_gray_image ( img ) , rect_detections , adjust_threshold ) ;
split_rect_detections ( rect_detections , rectangles ,
detection_confidences , weight_indices ) ;
return rectangles ;
@ -66,7 +67,7 @@ namespace dlib
pyramid_up ( temp ) ;
}
detector ( temp , rect_detections , 0.0 ) ;
detector ( temp , rect_detections , adjust_threshold ) ;
for ( unsigned long i = 0 ; i < rect_detections . size ( ) ; + + i )
rect_detections [ i ] . rect = pyr . rect_down ( rect_detections [ i ] . rect ,
upsampling_amount ) ;
@ -81,7 +82,7 @@ namespace dlib
array2d < rgb_pixel > temp ;
if ( upsampling_amount = = 0 )
{
detector ( numpy_rgb_image ( img ) , rect_detections , 0.0 ) ;
detector ( numpy_rgb_image ( img ) , rect_detections , adjust_threshold ) ;
split_rect_detections ( rect_detections , rectangles ,
detection_confidences , weight_indices ) ;
return rectangles ;
@ -96,7 +97,7 @@ namespace dlib
pyramid_up ( temp ) ;
}
detector ( temp , rect_detections , 0.0 ) ;
detector ( temp , rect_detections , adjust_threshold ) ;
for ( unsigned long i = 0 ; i < rect_detections . size ( ) ; + + i )
rect_detections [ i ] . rect = pyr . rect_down ( rect_detections [ i ] . rect ,
upsampling_amount ) ;
@ -116,19 +117,23 @@ namespace dlib
dlib : : simple_object_detector & detector ,
boost : : python : : object img ,
const unsigned int upsampling_amount
)
{
std : : vector < double > detection_confidences ;
std : : vector < double > weight_indices ;
const double adjust_threshold = 0.0 ;
return run_detector_with_upscale1 ( detector , img , upsampling_amount ,
adjust_threshold ,
detection_confidences , weight_indices ) ;
}
inline boost : : python : : tuple run_rect_detector (
dlib : : simple_object_detector & detector ,
boost : : python : : object img ,
const unsigned int upsampling_amount )
const unsigned int upsampling_amount ,
const double adjust_threshold )
{
boost : : python : : tuple t ;
@ -137,6 +142,7 @@ namespace dlib
std : : vector < rectangle > rectangles ;
rectangles = run_detector_with_upscale1 ( detector , img , upsampling_amount ,
adjust_threshold ,
detection_confidences , weight_indices ) ;
return boost : : python : : make_tuple ( rectangles ,