emilianavt / OpenSeeFace

Robust realtime face and facial landmark tracking on CPU with Unity integration
BSD 2-Clause "Simplified" License
1.45k stars 151 forks source link

Unable to fulfill dependencies #39

Closed SaekoYes closed 2 years ago

SaekoYes commented 2 years ago

Literally cant install this thing cause dependencies are hard to install, are outdated or are just an inconvenience to install.and cant find a proper guide for arch linux.

emilianavt commented 2 years ago

The issue is most likely that you are on Python 3.10 and onnxruntime has not released a build for 3.10 yet, only 3.9. You can either install an older python version, build onnxruntime yourself or report the issue with new python versions to onnxruntime.

SaekoYes commented 2 years ago

The issue is most likely that you are on Python 3.10 and onnxruntime has not released a build for 3.10 yet, only 3.9. You can either install an older python version, build onnxruntime yourself or report the issue with new python versions to onnxruntime.

M8 thats what i did. Still nothing worked

emilianavt commented 2 years ago

Could you give some more information on what you tried and what output you got then?

SaekoYes commented 2 years ago

Could you give some more information on what you tried and what output you got then?

when i run python facetracker.py -c 0 -W 1280 -H 720 --discard-after 0 --scan-every 0 --no-3d-adapt 1 --max-feature-updates 900

it outputs

File "/home/lamar/OpenSeeFace/facetracker.py", line 250, in tracker = Tracker(width, height, threshold=args.threshold, max_threads=args.max_threads, max_faces=args.faces, discard_after=args.discard_after, scan_every=args.scan_every, silent=False if args.silent == 0 else True, model_type=args.model, model_dir=args.model_dir, no_gaze=False if args.gaze_tracking != 0 and args.model != -1 else True, detection_threshold=args.detection_threshold, use_retinaface=args.scan_retinaface, max_feature_updates=args.max_feature_updates, static_model=True if args.no_3d_adapt == 1 else False, try_hard=args.try_hard == 1) File "/home/lamar/OpenSeeFace/tracker.py", line 498, in init options = onnxruntime.SessionOptions() AttributeError: module 'onnxruntime' has no attribute 'SessionOptions'

SaekoYes commented 2 years ago

tried the same thing on a new install and it outputted

Traceback (most recent call last): File "/home/lamar/Downloads/OpenSeeFace-master/facetracker.py", line 132, in from tracker import Tracker, get_model_base_path File "/home/lamar/Downloads/OpenSeeFace-master/tracker.py", line 5, in import onnxruntime ModuleNotFoundError: No module named 'onnxruntime'

thats cause the previous one i showed was edited slightly by me

emilianavt commented 2 years ago

The second post's output is about what is expected if onnxruntime is not installed. What output do you get from pip3 install onnxruntime and pip3 --version? If you installed python 3.9, pip3 should show something like: pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)

Otherwise, if you have both python 3.9 and 3.10 installed, you might have to create a virtual environment, in which pip should have the correct version: python3.9 -mvenv env Then activate it: . env/bin/activate

Also, which version of onnxruntime is installed? You can find out with: pip3 list | grep onnxruntime

I just tested a freshly checked out copy of this repository with python 3.9 and onnxruntime 1.11.1 and it works fine on Linux for me.

SaekoYes commented 2 years ago

i installed onnxruntime using pyenv to switch python versions but everything else was installed normally

emilianavt commented 2 years ago

I don't really have any experience with pyenv, so I'm not sure what could have gone wrong. Still, you should be able to confirm the version of onnxruntime being used as follows:

$ python
Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import onnxruntime
>>> onnxruntime.__version__
'1.11.1'
>>>
SaekoYes commented 2 years ago

ok i fixed that but now the error is

Traceback (most recent call last): File "/home/lamar/Downloads/OpenSeeFace-master/facetracker.py", line 250, in tracker = Tracker(width, height, threshold=args.threshold, max_threads=args.max_threads, max_faces=args.faces, discard_after=args.discard_after, scan_every=args.scan_every, silent=False if args.silent == 0 else True, model_type=args.model, model_dir=args.model_dir, no_gaze=False if args.gaze_tracking != 0 and args.model != -1 else True, detection_threshold=args.detection_threshold, use_retinaface=args.scan_retinaface, max_feature_updates=args.max_feature_updates, static_model=True if args.no_3d_adapt == 1 else False, try_hard=args.try_hard == 1) File "/home/lamar/Downloads/OpenSeeFace-master/tracker.py", line 526, in init self.retinaface = RetinaFaceDetector(model_path=os.path.join(model_base_path, "retinaface_640x640_opt.onnx"), json_path=os.path.join(model_base_path, "priorbox_640x640.json"), threads=max(max_threads,4), top_k=max_faces, res=(640, 640)) File "/home/lamar/Downloads/OpenSeeFace-master/retinaface.py", line 69, in init self.session = onnxruntime.InferenceSession(model_path, sess_options=options) File "/home/lamar/.pyenv/versions/3.9.0/lib/python3.9/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 335, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "/home/lamar/.pyenv/versions/3.9.0/lib/python3.9/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 363, in _create_inference_session raise ValueError("This ORT build has {} enabled. ".format(available_providers) + ValueError: This ORT build has ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'], ...)

emilianavt commented 2 years ago

I just merged a pull request that should hopefully fix this issue.

SaekoYes commented 2 years ago

oh that fixed it thank u :D

SaekoYes commented 2 years ago

sorry for being annoying

emilianavt commented 2 years ago

No worries, it's fine! I'm glad it's working now.