dog_breeds_web_app/dog_filters.py
def resize_filter(self, w):
        """
        Adjust the size of filter images according to the size of the detected face on the test image
        Parameters:
            img: images that has read by OpenCV (BGR image)
            w: width of bounding box for the detected face
        Return:
            img: resized image
        """
        for dog_filter in dog_filters:
            new_w = int(w*0.3) # resize the image to 0.3 scale of the width of the face detector
            new_h = int(dog_filter.shape[0]/dog_filter.shape[1]*new_w) # keep aspect ratio
            resize_filter = cv2.resize(dog_filter, (new_w, new_h))
            self.resize_filters.append(resize_filter)

        Adjust the size of filter images according to the size of the detected face on the test image
        Parameters:
            img: images that has read by OpenCV (BGR image)
            w: width of bounding box for the detected face
        Return:
            img: resized image
        
Adjust the size of filter images according to the size of the detected face on the test image
Adjust the size of filter images according to the size of the detected face on the test image
def resize_filter(self, w):
        for dog_filter in dog_filters:
            new_w = int(w*0.3) 
            new_h = int(dog_filter.shape[0]/dog_filter.shape[1]*new_w) 
            resize_filter = cv2.resize(dog_filter, (new_w, new_h))
            self.resize_filters.append(resize_filter)
def resize_filter ( self , w ) : for dog_filter in dog_filters : new_w = int ( w * 0.3 ) new_h = int ( dog_filter . shape [ 0 ] / dog_filter . shape [ 1 ] * new_w ) resize_filter = cv2 . resize ( dog_filter , ( new_w , new_h ) ) self . resize_filters . append ( resize_filter )
Adjust the size of filter images according to the size of the detected face on the test image
Adjust the size of filter images according to the size of the detected face on the test image
"""
        Adjust the size of filter images according to the size of the detected face on the test image
        Parameters:
            img: images that has read by OpenCV (BGR image)
            w: width of bounding box for the detected face
        Return:
            img: resized image
        """ # resize the image to 0.3 scale of the width of the face detector # keep aspect ratio
self
w
width of bounding box for the detected face
width of bounding box for the detected face
img
images that has read by OpenCV (BGR image)
images that has read by OpenCV ( BGR image )