InceptionV3.py
def predict_top5_breeds(self):
        """
        Use InceptionV3 model to predicte dog breed and return top5 predicted breeds
        Parameters:
            None
        Return:
            top5_breeds_idx: top5 dog breed idx that is predicted by the model
            top5_breeds_prob: top5 dog breed probabilities that are corresponding to top5 dog breed idx
        """
        # extract bottleneck features
        bottleneck_feature = extract_InceptionV3(self.path_to_tensor())
        # obtain predicted vector
        predicted_vector = self.InceptionV3_model.predict(bottleneck_feature)
        # return dog breed that is predicted by the model
        # np.argsort(-predicted_vector) return matrix shape (1, 133)
        top5_breeds_idx= np.argsort(-predicted_vector)[0][:5] # return top5 probability class idx
        top5_breeds_prob= [predicted_vector[0][idx] for idx in top5_breeds_idx]# return top5 probability
        return top5_breeds_idx, top5_breeds_prob

        Use InceptionV3 model to predicte dog breed and return top5 predicted breeds
        Parameters:
            None
        Return:
            top5_breeds_idx: top5 dog breed idx that is predicted by the model
            top5_breeds_prob: top5 dog breed probabilities that are corresponding to top5 dog breed idx
        
Use InceptionV3 model to predicte dog breed and return top5 predicted breeds
Parameters:
None
Return:
top5_breeds_idx: top5 dog breed idx that is predicted by the model
top5_breeds_prob: top5 dog breed probabilities that are corresponding to top5 dog breed idx
Use InceptionV3 model to predicte dog breed and return top5 predicted breeds Parameters : None Return : top5_breeds_idx : top5 dog breed idx that is predicted by the model top5_breeds_prob : top5 dog breed probabilities that are corresponding to top5 dog breed idx
def predict_top5_breeds(self):
        bottleneck_feature = extract_InceptionV3(self.path_to_tensor())
        predicted_vector = self.InceptionV3_model.predict(bottleneck_feature)
        top5_breeds_idx= np.argsort(-predicted_vector)[0][:5] 
        top5_breeds_prob= [predicted_vector[0][idx] for idx in top5_breeds_idx]
        return top5_breeds_idx, top5_breeds_prob
def predict_top5_breeds ( self ) : bottleneck_feature = extract_InceptionV3 ( self . path_to_tensor ( ) ) predicted_vector = self . InceptionV3_model . predict ( bottleneck_feature ) top5_breeds_idx = np . argsort ( - predicted_vector ) [ 0 ] [ : 5 ] top5_breeds_prob = [ predicted_vector [ 0 ] [ idx ] for idx in top5_breeds_idx ] return top5_breeds_idx , top5_breeds_prob
Use InceptionV3 model to predicte dog breed and return top5 predicted breeds
Parameters:
None
Return:
top5_breeds_idx: top5 dog breed idx that is predicted by the model
top5_breeds_prob: top5 dog breed probabilities that are corresponding to top5 dog breed idx
Use InceptionV3 model to predicte dog breed and return top5 predicted breeds Parameters : None Return : top5_breeds_idx : top5 dog breed idx that is predicted by the model top5_breeds_prob : top5 dog breed probabilities that are corresponding to top5 dog breed idx
"""
        Use InceptionV3 model to predicte dog breed and return top5 predicted breeds
        Parameters:
            None
        Return:
            top5_breeds_idx: top5 dog breed idx that is predicted by the model
            top5_breeds_prob: top5 dog breed probabilities that are corresponding to top5 dog breed idx
        """ # extract bottleneck features # obtain predicted vector # return dog breed that is predicted by the model # np.argsort(-predicted_vector) return matrix shape (1, 133) # return top5 probability class idx # return top5 probability
self