lerobot
lerobot copied to clipboard
fix(opencv backend): Removing open cv default backend on Windows
What this does
This PR removes the forced open cv backend choice for Windows platforms :
if platform.system() == "Windows":
return cv2.CAP_AVFOUNDATION
This choice reportedly caused errors that could have been avoided by letting open cv picking a available and working backend, i.e. using cv2.CAP_ANY for all operating systems.
How it was tested
TBD
How to checkout & try? (for the reviewer)
On Windows, plug a camera and run :
python lerobot/find_cameras.py
If think that function should be
def get_cv2_backend() -> int:
import cv2
if platform.system() == "Windows":
- return cv2.CAP_AVFOUNDATION
+ return cv2.CAP_DSHOW
else:
return cv2.CAP_ANY
Seems we've mixed it since #676 which was forcing cv2.CAP_DSHOW backend on Windows to avoid a delay issue