-215 opencv runtime_error ai_generated true

cv::error: (-215:Assertion failed) !goturnModel.empty() in function 'init'

ID: opencv/tracker-goturn-initialization-failed

Also available as: JSON · Markdown · 中文
82%Fix Rate
88%Confidence
1Evidence
2023-09-20First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
4.5.3 active
4.6.0 active
4.7.0 active

Root Cause

GOTURN tracker requires a pre-trained model file (prototxt and caffemodel) that is either missing or not loaded correctly.

generic

中文

GOTURN跟踪器需要预训练模型文件(prototxt和caffemodel),这些文件缺失或未正确加载。

Official Documentation

https://docs.opencv.org/4.x/d2/d0a/tutorial_introduction_to_tracker.html

Workarounds

  1. 90% success Download GOTURN model files (goturn.prototxt and goturn.caffemodel) from https://github.com/opencv/opencv_extra/tree/master/testdata/tracking and place them in the current working directory or set OPENCV_GOTURN_MODEL_PATH environment variable.
    Download GOTURN model files (goturn.prototxt and goturn.caffemodel) from https://github.com/opencv/opencv_extra/tree/master/testdata/tracking and place them in the current working directory or set OPENCV_GOTURN_MODEL_PATH environment variable.
  2. 95% success Use a different tracker (e.g., CSRT or KCF) if GOTURN model download is not feasible.
    Use a different tracker (e.g., CSRT or KCF) if GOTURN model download is not feasible.

中文步骤

  1. 从https://github.com/opencv/opencv_extra/tree/master/testdata/tracking下载GOTURN模型文件(goturn.prototxt和goturn.caffemodel),放在当前工作目录或设置OPENCV_GOTURN_MODEL_PATH环境变量。
  2. 如果无法下载GOTURN模型,使用其他跟踪器(如CSRT或KCF)。

Dead Ends

Common approaches that don't work:

  1. Reinstalling OpenCV without downloading GOTURN model 90% fail

    GOTURN model is not bundled with OpenCV; must be downloaded separately from opencv_extra or official repository.

  2. Setting cv2.TrackerGOTURN_create() with no arguments 70% fail

    The function does not accept model paths; model must be placed in a specific location or set via environment variable.