trainingandtesting.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:SBB4-damage-tracker 作者: whorn 项目源码 文件源码
def testClassifier(foldername,classifier):
    clf = joblib.load(classifier)
    os.chdir(foldername)
    correct = 0
    total = 0
    for filename in glob.iglob('*.png'):
        img = cv2.imread(filename,-1)
        roi = hog(img.reshape((27, 35)), orientations=9, pixels_per_cell=(9, 7), cells_per_block=(1, 1), visualise=False)
        preditcion = clf.predict(roi)
        if preditcion == filename[0]:
            correct += 1
        total += 1
    print(total)
    print(correct)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号