I am trying to follow the tutorial given in: https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_video/py_bg_subtraction/py_bg_subtraction.html
cv2.bgsegm.createBackgroundSubtractorGMG() cv2.createBackgroundSubtractorMOG2() cv2.bgsegm.createBackgroundSubtractorMOG(),
**this worked for me **