コード例 #1
0
    print(arr)
    #do ml prediction here
    decision = t.predict(arr, gnb_clf)
    #print("MLsays:")
    f = 1
    ok = 0
    if (f == 1):
        print(decision)
    cv2.imshow('res2', res2)
    #return ok
    cv2.waitKey(0)
    #cv2.destroyAllWindows()


#train dataset
t = ml.Gaussian_Naive_Bayes()
X, Y = t.select_data("satellitePixel.csv")
X_train, X_test, y_train, y_test = t.split_data(X, Y)
gnb_clf = t.train_classifier(X_train, y_train)
t.get_accuracy_score(gnb_clf, X_test, y_test)
isok = 0
#take pics in loop
print(
    "\nAquiring images and detecting pollution like from a real-time feed:\n")
for m in range(1, 37):
    z = "E:/18.Win.Sem/Satellite/pic" + str(m) + ".jpg"
    print("Image number - " + str(m))
    #isok=isok+pollution(z)
    pollution(z)
    #print("Accuracy till now:")
    #print(isok/m)