votchallenge / toolkit

The official VOT Challenge evaluation and analysis toolkit
http://www.votchallenge.net/
GNU General Public License v3.0
164 stars 46 forks source link

An error occurred during the vot evaluation #79

Closed davidyang180 closed 1 year ago

davidyang180 commented 1 year ago

Hi! When I integrate the tracker according to the tutorial to support multi-object as follows:

        import vot_test_toolkit.evaluation.vot as vot
        handle = vot.VOT("mask")
        objects = handle.objects()
        image_path = handle.frame()
        if not image_path:
            return

        image = self._read_image(image_path)

Then the following problem appeared. After debugging, it seemed that the initialization could not be performed when the request = self._trax.wait() command was executed, and the quit command was directly executed. What is the problem?

File "/ssd/xxxx/miniconda3/envs/xxxx/lib/python3.8/site-packages/vot/utilities/cli.py", line 412, in main
    do_evaluate(args)
  File "/ssd/xxxx/miniconda3/envs/xxxx/lib/python3.8/site-packages/vot/utilities/cli.py", line 200, in do_evaluate
    run_experiment(experiment, tracker, workspace.dataset, config.force, config.persist)
  File "/ssd/xxxx/miniconda3/envs/xxxx/lib/python3.8/site-packages/vot/experiment/__init__.py", line 201, in run_experiment
    experiment.execute(tracker, sequence, force=force, callback=progress)
  File "/ssd/xxxx/miniconda3/envs/xxxx/lib/python3.8/site-packages/vot/experiment/multirun.py", line 99, in execute
    with self._get_runtime(tracker, sequence, self._multiobject) as runtime:
  File "/ssd/xxxx/miniconda3/envs/xxxx/lib/python3.8/site-packages/vot/experiment/__init__.py", line 108, in _get_runtime
    raise TrackerException("Tracker {} does not support multi-object experiments".format(tracker.identifier))
TypeError: __init__() missing 1 required keyword-only argument: 'tracker'
davidyang180 commented 1 year ago

It is further found that in the trax/client.py file, the default value is 0 (False). Is this normal?

value = c_int(value=0)   
trax_get_parameter(handle, TRAX_PARAMETER_MULTIOBJECT, byref(value))
self._custom["multiobject"] = bool(value.value)
davidyang180 commented 1 year ago

After changing the value to 1(True), the following error occurs:

Evaluation interrupted by tracker error: ('Experiment interrupted', TrackerException(TraxException('Exception when initializing tracker: Too many objects given')))
lukacu commented 1 year ago

Well, the integration wrapper is backwards compatible, if you want to use the multiobject API you have to call handle = vot.VOT("mask", multiobject=True). I have noticed that there is no example of direct wrapper usage (without VOTManager, so I will add such example.

Zhangyong-Tang commented 1 year ago

@davidyang180 Have you passed the line request = self._trax.wait()? i have tried on both the Ubantu and Windows systems, but both stopped at this line. If so, can you share your personal api to me? Many thanks!

davidyang180 commented 1 year ago

@davidyang180您是否通过了 request = self._trax.wait() 行? 我在 Ubantu 和 Windows 系统上都试过了,但都停在了这一行。 如果是这样,你能把你的个人api分享给我吗? 非常感谢!

我目前用的是教程中第一种集成tracker支持多目标的方法,可以通过 request = self._trax.wait() 行。我也看到了你发的issue,虽然我不是用的第二种VOTManager的方法,但我看VOTManager里面的程序应该和下面逻辑是一致的:

handle = vot.VOT("mask", multiobject=True)
objects = handle.objects()

imagefile = handle.frame()
image = cv2.imread(imagefile, cv2.IMREAD_GRAYSCALE)

trackers = [your_tracker_initialize(image, object) for object in objects]

while True:
    imagefile = handle.frame()
    if not imagefile:
        break
    image = cv2.imread(imagefile, cv2.IMREAD_GRAYSCALE)
    handle.report([your_tracker.track(image) for tracker in trackers])