facebookresearch / maskrcnn-benchmark

Fast, modular reference implementation of Instance Segmentation and Object Detection algorithms in PyTorch.
MIT License
9.31k stars 2.49k forks source link

plot realtime by python #1324

Open shamilkh007 opened 3 years ago

shamilkh007 commented 3 years ago

I want to plot these results in realtime: how this?? ####################################

import cv2 import numpy as np import matplotlib.pyplot as plt import time import random a1=cv2.VideoCapture(0) while True: s,frame = a1.read() b, g, r = cv2.split(frame) zeros_ch = np.zeros(frame.shape[0:2], dtype="uint8") red_img = cv2.merge([zeros_ch, zeros_ch, r])

c= red_img.mean()
print(c)
# plt.plot(c)
# plt.show()
if cv2.waitKey(1) & 0xFF==ord('q'):
    break

a1.release() cv2.destroyAllWindows()

################# results

44.98904405381944 44.94275716145833 45.02025607638889 45.02025607638889 44.97687608506944 44.97687608506944 36.82326171875 36.82326171875 37.10813802083333 36.81928493923611 37.10667534722222 37.10667534722222 36.8056640625 36.8056640625 37.074506293402