Open rashmigaikwad88 opened 1 year ago
colors = [(245,117,16), (117,245,16), (16,117,245)] def prob_viz(res, actions, input_frame, colors): output_frame = input_frame.copy() for num, prob in enumerate(res): cv2.rectangle(output_frame, (0,60+num40), (int(prob100), 90+num40), colors[num], -1) cv2.putText(output_frame, actions[num], (0, 85+num40), cv2.FONT_HERSHEY_SIMPLEX, 1, (255,255,255), 2, cv2.LINE_AA)
return output_frame
plt.figure(figsize=(18,18)) plt.imshow(prob_viz(res, actions, image, colors))
IndexError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_9912\914121024.py in 1 plt.figure(figsize=(18,18)) ----> 2 plt.imshow(prob_viz(res, actions, image, colors))
~\AppData\Local\Temp\ipykernel_9912\2568779431.py in prob_viz(res, actions, input_frame, colors) 3 output_frame = input_frame.copy() 4 for num, prob in enumerate(res): ----> 5 cv2.rectangle(output_frame, (0,60+num40), (int(prob100), 90+num40), colors[num], -1) 6 cv2.putText(output_frame, actions[num], (0, 85+num40), cv2.FONT_HERSHEY_SIMPLEX, 1, (255,255,255), 2, cv2.LINE_AA) 7
IndexError: list index out of range
<Figure size 1800x1800 with 0 Axes>
colors = [(245,117,16), (117,245,16), (16,117,245)] def prob_viz(res, actions, input_frame, colors): output_frame = input_frame.copy() for num, prob in enumerate(res): cv2.rectangle(output_frame, (0,60+num40), (int(prob100), 90+num40), colors[num], -1) cv2.putText(output_frame, actions[num], (0, 85+num40), cv2.FONT_HERSHEY_SIMPLEX, 1, (255,255,255), 2, cv2.LINE_AA)
plt.figure(figsize=(18,18)) plt.imshow(prob_viz(res, actions, image, colors))
IndexError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_9912\914121024.py in
1 plt.figure(figsize=(18,18))
----> 2 plt.imshow(prob_viz(res, actions, image, colors))
~\AppData\Local\Temp\ipykernel_9912\2568779431.py in prob_viz(res, actions, input_frame, colors) 3 output_frame = input_frame.copy() 4 for num, prob in enumerate(res): ----> 5 cv2.rectangle(output_frame, (0,60+num40), (int(prob100), 90+num40), colors[num], -1) 6 cv2.putText(output_frame, actions[num], (0, 85+num40), cv2.FONT_HERSHEY_SIMPLEX, 1, (255,255,255), 2, cv2.LINE_AA) 7
IndexError: list index out of range
<Figure size 1800x1800 with 0 Axes>