Open anoob09 opened 5 years ago
Pass the result numpy array and image to the following function:
def boxing(original_img, predictions):
newImage = np.copy(original_img)
for result in predictions:
top_x = result['topleft']['x']
top_y = result['topleft']['y']
btm_x = result['bottomright']['x']
btm_y = result['bottomright']['y']
confidence = result['confidence']
label = result['label'] + " " + str(round(confidence, 3))
if confidence > 0.3:
newImage = cv2.rectangle(newImage, (top_x, top_y), (btm_x, btm_y), (255,0,0), 3)
newImage = cv2.putText(newImage, label, (top_x, top_y-5), cv2.FONT_HERSHEY_COMPLEX_SMALL , 0.8, (0, 230, 0), 1, cv2.LINE_AA)
return newImage
I am getting a numpy array of dimension
(19, 19, 30)
as my output. I want to parse the output on my own without using thereturn_predict()
present insideflow.py
file. Can anyone explain me the output or help me get the bounding boxes?