-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathClassifierTest.py
More file actions
29 lines (21 loc) · 839 Bytes
/
ClassifierTest.py
File metadata and controls
29 lines (21 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import sys
sys.path.insert(1, 'BroodPatternAI/')
sys.path.insert(2, 'PopulationCounter/')
from Classifier import *
from BeeCounterDEMO import *
img = cv2.imread("BroodPatternAI/DataSetV1/Test/h6.jpg")
results = Classify("BroodPatternAI/DataSetV1/Test/h6.jpg")
healthy = 0
unhealthy = 0
if results[0][0] == "healthy":
healthy = round(results[0][1],4)
unhealthy = round(results[1][1],4)
print("healthy")
elif results[0][0] == "broodproblem":
healthy = round(results[1][1],4)
unhealthy = round(results[0][1],4)
print("unhealthy")
cv2.putText(img, "healthy: " + str(healthy) ,(10,60), cv2.FONT_HERSHEY_SIMPLEX, 0.9,(255, 250, 50),2,cv2.LINE_AA)
cv2.putText(img, "unhealthy: " + str(unhealthy) ,(10,90), cv2.FONT_HERSHEY_SIMPLEX, 0.9,(255, 250, 50),2,cv2.LINE_AA)
cv2.imshow("result", img)
cv2.waitKey(6000)