Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting deep learning tracker (GOTURN) to run opencv python

I installed opencv-python and opencv-contrib-python:

~$ pip install opencv-python
~$ pip install opencv-contrib-python

Both installations went smoothly, and I now have:

In [1]: import cv2    
In [2]: cv2.__version__
Out[2]: '3.4.0'

However, If I try to use the GOTURN tracker, I get the following error:

cv2.error: /io/opencv/modules/dnn/src/caffe/caffe_io.cpp:1119:
error: (-2) FAILED: fs.is_open(). Can't open "goturn.prototxt" in function ReadProtoFromTextFile

It seems like my installation is missing the model files goturn.prototxt and goturn.caffemodel.

I can manually download the missing files from git, but I don't know where to place them locally so opencv can read them.

Alternatively, is there a pip install ... or similar action that can automatically "install" these missing files in the right place for me?

like image 308
Shai Avatar asked Feb 15 '18 08:02

Shai


People also ask

Does OpenCV comes under deep learning?

With the rise of deep learning, OpenCV started integrating more functionalities that support deep learning based tasks by introducing a new module called DNN (Deep Neural Networks). This DNN module was designed to make it easy to integrate deep learning models that have already been trained.

What is Goturn?

GOTURN is one such offline learning tracker based on convolutional neural network which doesn't learn online at all. First, the tracker is trained using thousands of videos for general object tracking.

How does Csrt Tracker work?

This tracker works by training a filter with patches containing the object as well as nearby patches that do not. This allows the tracker to search the area around the previous position and exploit the fact that nearby patches are likely to contain the object.


1 Answers

You need to download the goturn.prototxt file and goturn.caffemodel from the net and put it in same folder as your current working directory to run it.

like image 155
Smit Avatar answered Sep 24 '22 13:09

Smit