def Recognize(self,img): label=image_recognition(img) return label
def isDog(self,img): label=image_recognition(img) self.label_type[label] += 1 print self.label_type print label return (1==label)
class DogClassifier(): Dog=1 Cat=0 Other=2 def __init__(self): self.label_type = [0, 0, 0] pass def isDog(self,img): label=image_recognition(img) self.label_type[label] += 1 print self.label_type print label return (1==label) def Recognize(self,img): label=image_recognition(img) return label if __name__ == '__main__': main() exit(0) DataHome = "../../data/Kaggle/DogVsCatData/" img_route = DataHome + "head_images/Abyssinian_100.jpg" img=cv2.imread(img_route) img_label = image_recognition(img) print "result:", img_label
def Recognize(self, img): label = image_recognition(img) return label
def isDog(self, img): label = image_recognition(img) self.label_type[label] += 1 print self.label_type print label return (1 == label)
class DogClassifier(): Dog = 1 Cat = 0 Other = 2 def __init__(self): self.label_type = [0, 0, 0] pass def isDog(self, img): label = image_recognition(img) self.label_type[label] += 1 print self.label_type print label return (1 == label) def Recognize(self, img): label = image_recognition(img) return label if __name__ == '__main__': main() exit(0) DataHome = "../../data/Kaggle/DogVsCatData/" img_route = DataHome + "head_images/Abyssinian_100.jpg" img = cv2.imread(img_route) img_label = image_recognition(img) print "result:", img_label