Two problems, one of which blocks step 2 of the README for every new user
1. dataset_init.py cannot run from a fresh install. It imports huggingface_hub at line 9, and requirements.txt does not declare it. So pip install -r requirements.txt followed by the README's own python dataset_init.py --output-dir ./dataset_VR fails with ModuleNotFoundError. matplotlib is undeclared too (imported by games/maze3d/main.py, games/maze3d/adapter.py, games/sokoban/board.py).
2. The declared environment cannot run --tracker-type csrt — the tracker README:21 names for reproducing the paper's results. extractor.py:417 reaches for cv2.TrackerCSRT_create, which ships only in a contrib OpenCV build, while requirements.txt:6 declares plain opencv-python. _create_tracker() falls through every branch, returns None, and extraction raises RuntimeError: 无法创建跟踪器,请安装 opencv-contrib-python — the message already names the right package.
Swapping that pin to opencv-contrib-python is not the fix, though, which is the part worth knowing: rembg>=2.0.68 (line 19, under # Image processing (AutoEnv)) depends on opencv-python-headless, so a second wheel lands in the same cv2 namespace and which one wins depends on install order.
Measured
Fresh venvs, Python 3.10, checking hasattr(cv2, 'TrackerCSRT_create'):
| environment |
wheels installed |
CSRT |
opencv-python + rembg — what requirements.txt produces today |
opencv-python, opencv-python-headless |
No |
opencv-contrib-python + rembg — the naive one-line fix |
opencv-contrib-python, opencv-python-headless |
No |
rembg first, then opencv-contrib-python |
same two |
Yes (order-dependent) |
a single ad-hoc pip install opencv-contrib-python rembg |
same two |
Yes (order-dependent) |
opencv-contrib-python-headless + rembg |
opencv-contrib-python-headless, opencv-python-headless |
Yes |
| same, reverse install order |
same two |
Yes |
full requirements.txt minus the two AutoEnv lines, with opencv-contrib-python |
opencv-contrib-python only |
Yes |
The outcome depends on the install invocation, not only on the wheel set: what fails is the one that matters — editing line 6 and re-running pip install -r requirements.txt.
Also checked directly: plain opencv-python at both 4.8.0.76 (the declared floor) and 4.10.0.84 reports hasattr(cv2, 'TrackerCSRT_create') == False and has no cv2.legacy, so none of the versions I tested across the declared range provides it.
Suggested fix — one line
-opencv-python>=4.8.0
+opencv-contrib-python-headless>=4.8.0
plus matplotlib and huggingface-hub.
opencv-contrib-python-headless is the only candidate that survives rembg in both install orders, and it needs no restructuring of the file. The headless build drops only the GUI functions, and there is no imshow, namedWindow, waitKey, destroyAllWindows or createTrackbar anywhere in the tree, so nothing in the repo uses what it leaves out.
If you would rather keep a GUI-capable build, the alternative is to move rembg / onnxruntime-gpu out of requirements.txt — they are already labelled # Image processing (AutoEnv), i.e. they belong to the skin-generation tool rather than to the benchmark pipeline. I verified that core file (36 requirement lines, 61 installed distributions, with opencv-contrib-python) installs clean and provides CSRT.
Happy to send either shape as a PR — say which and it is a two-minute change.
For reference, OpenCV's own guidance is that only one of these wheels may be installed: "Do not install multiple different packages in the same environment. There is no plugin architecture: all the packages use the same namespace (cv2)." (opencv-python README) — which is why the rembg dependency is awkward however it is resolved.
Environment
Python 3.10.20, Linux, measured at 89b29a9.
Two problems, one of which blocks step 2 of the README for every new user
1.
dataset_init.pycannot run from a fresh install. It importshuggingface_hubat line 9, andrequirements.txtdoes not declare it. Sopip install -r requirements.txtfollowed by the README's ownpython dataset_init.py --output-dir ./dataset_VRfails withModuleNotFoundError.matplotlibis undeclared too (imported bygames/maze3d/main.py,games/maze3d/adapter.py,games/sokoban/board.py).2. The declared environment cannot run
--tracker-type csrt— the tracker README:21 names for reproducing the paper's results.extractor.py:417reaches forcv2.TrackerCSRT_create, which ships only in a contrib OpenCV build, whilerequirements.txt:6declares plainopencv-python._create_tracker()falls through every branch, returnsNone, and extraction raisesRuntimeError: 无法创建跟踪器,请安装 opencv-contrib-python— the message already names the right package.Swapping that pin to
opencv-contrib-pythonis not the fix, though, which is the part worth knowing:rembg>=2.0.68(line 19, under# Image processing (AutoEnv)) depends onopencv-python-headless, so a second wheel lands in the samecv2namespace and which one wins depends on install order.Measured
Fresh venvs, Python 3.10, checking
hasattr(cv2, 'TrackerCSRT_create'):opencv-python+rembg— whatrequirements.txtproduces todayopencv-python,opencv-python-headlessopencv-contrib-python+rembg— the naive one-line fixopencv-contrib-python,opencv-python-headlessrembgfirst, thenopencv-contrib-pythonpip install opencv-contrib-python rembgopencv-contrib-python-headless+rembgopencv-contrib-python-headless,opencv-python-headlessrequirements.txtminus the two AutoEnv lines, withopencv-contrib-pythonopencv-contrib-pythononlyThe outcome depends on the install invocation, not only on the wheel set: what fails is the one that matters — editing line 6 and re-running
pip install -r requirements.txt.Also checked directly: plain
opencv-pythonat both 4.8.0.76 (the declared floor) and 4.10.0.84 reportshasattr(cv2, 'TrackerCSRT_create') == Falseand has nocv2.legacy, so none of the versions I tested across the declared range provides it.Suggested fix — one line
plus
matplotlibandhuggingface-hub.opencv-contrib-python-headlessis the only candidate that survivesrembgin both install orders, and it needs no restructuring of the file. The headless build drops only the GUI functions, and there is noimshow,namedWindow,waitKey,destroyAllWindowsorcreateTrackbaranywhere in the tree, so nothing in the repo uses what it leaves out.If you would rather keep a GUI-capable build, the alternative is to move
rembg/onnxruntime-gpuout ofrequirements.txt— they are already labelled# Image processing (AutoEnv), i.e. they belong to the skin-generation tool rather than to the benchmark pipeline. I verified that core file (36 requirement lines, 61 installed distributions, withopencv-contrib-python) installs clean and provides CSRT.Happy to send either shape as a PR — say which and it is a two-minute change.
For reference, OpenCV's own guidance is that only one of these wheels may be installed: "Do not install multiple different packages in the same environment. There is no plugin architecture: all the packages use the same namespace (
cv2)." (opencv-python README) — which is why therembgdependency is awkward however it is resolved.Environment
Python 3.10.20, Linux, measured at
89b29a9.