votchallenge / integration Goto Github PK
View Code? Open in Web Editor NEWIntegration examples and utilities for VOT toolkit
Integration examples and utilities for VOT toolkit
Dear all,
I am trying to build a native tracker for evaluation in VOTS2023.
However, when I include vot.h from the integration module, I get several compiling errors about undefined symbols, such as "trax_object_list" at line 783, "trax_object_list_count" at line 832, "trax_object_list_get" at line 833, etc.
Some trax functions used in vot.h do not have the same parameter declaration defined in trax.h. For example, at line 804 in vot.h,
trax_metadata* metadata = trax_metadata_create(region_format, TRAX_IMAGE_PATH, channels, NULL, NULL, NULL, flags);
The trax_metadata_create function uses 7 parameters; however, at lines 201-202 in trax.h, this function only defines 6 parameters as follows:
__TRAX_EXPORT trax_metadata* trax_metadata_create(int region_formats, int image_formats, int channels, const char* tracker_name, const char* tracker_description, const char* tracker_family);
Can someone suggest how to deal with this issue?
Thanks in advance.
Hi,
After configuring the new toolkit following the tutorial, it raises an error "No module named 'python_ncc'" when I run the tracker. Could you kindly help me to fix it?
Here is the configuration file,
Hi,
In the vot.py, can we fetch multiple frames and make predictions (in a clip-wise fashion)?
For instance, modifying this piece of code to account for clip-wise inference
while True:
image = self._handle.frame()
if not image:
break
status = [tracker(image) for tracker in trackers]
self._handle.report(status)
results in timeout error (Tracker interrupted, it did not reply in 30 seconds
)
Timeout reached, terminating tracker
@@TRAX:quit
Exception ignored in: <function VOT.__del__ at 0x7f4b50661c10>
Traceback (most recent call last):
File "/h/rgoyal/code/epi_mem_vos_chris/trackers/vot.py", line 170, in __del__
File "/h/rgoyal/code/epi_mem_vos_chris/trackers/vot.py", line 166, in quit
File "/h/rgoyal/miniconda3/envs/epi_mem_vos_1.12/lib/python3.8/site-packages/trax/server.py", line 162, in quit
ImportError: sys.meta_path is None, Python is likely shutting down
Do you happen to know how I go about resolving this issue?
Hi
I am trying to integrate the new version of the toolkit into our codebase. I updated trax, pulled the newest version of the toolkit and used the new vot.py file I found in this repo since the old ones were not working anymore. Now when running the vot2020 stack I get the following error
@@TRAX:hello "trax.name=" "trax.family=" "trax.image=path;" "trax.region=rectangle;" "trax.description=" "trax.version=4" "vot=python" "trax.channels=color;"
@@TRAX:initialize "549.0000,249.0000,23.0000,57.0000"
@@TRAX:frame "file:///scratch_net/clariden/chmayer/vot/vot2022-stb/sequences/agility/color/00000001.jpg"
@@TRAX:state "549.0000,249.0000,23.0000,57.0000"
@@TRAX:frame "file:///scratch_net/clariden/chmayer/vot/vot2022-stb/sequences/agility/color/00000002.jpg"
/scratch_net/clariden/chmayer/conda_envs/pytracking-transformer/lib/python3.7/site-packages/torch/nn/functional.py:3063: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
"See the documentation of nn.Upsample for details.".format(mode))
Using /scratch_net/clariden/chmayer/tmp as PyTorch extensions root...
Detected CUDA files, patching ldflags
Emitting ninja build file /scratch_net/clariden/chmayer/tmp/_prroi_pooling/build.ninja...
Building extension module _prroi_pooling...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
ninja: no work to do.
Loading extension module _prroi_pooling...
/scratch_net/clariden/chmayer/conda_envs/pytracking-transformer/lib/python3.7/site-packages/torch/nn/functional.py:3063: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
"See the documentation of nn.Upsample for details.".format(mode))
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/chmayer/github/pytracking-transformer/pytracking/run_vot.py", line 14, in run_vot2020
tracker.run_vot2020(debug, visdom_info)
File "/home/chmayer/github/pytracking-transformer/pytracking/evaluation/tracker.py", line 595, in run_vot2020
handle.report(pred, conf)
File "/home/chmayer/github/pytracking-transformer/pytracking/evaluation/vots2023.py", line 128, in report
self._trax.status(status, properties)
File "/scratch_net/clariden/chmayer/conda_envs/pytracking-transformer/lib/python3.7/site-packages/trax/server.py", line 123, in status
assert(isinstance(objects, list))
AssertionError
@@TRAX:quit
Process exited with code (1)
Something seems misaligned here. The new vot.py file produces the status and the properties dict but trax is expecting a list for some reason.
The inputs to self._trax.status()
are
status Rectangle 554.280517578125,240.6689910888672 24.481735229492188x47.17734146118164
properties {'confidence': 1.0}
Any ideas what is going wrong?
Python wrapper converts all confidence values to string. Since these values have a specific use, they should be checked that they are numerical before conversion.
Here is the error I get after running
$ vot evaluate NCCPython
A newer version of the VOT toolkit is available (0.6.3), please update.
Loading dataset |█████████████████████████████████████████████████████████████████| 100% [00:00<00:00]
NCCPython/baseline |▍ | 1% [00:00<02:15]Tracker NCCPython encountered an error: Only supports single object tracking
Evaluation interrupted by tracker error: ('Experiment interrupted', TrackerException('Only supports single object tracking'))
NCCPython/baseline |▍ | 1% [00:01<02:29]
I am using NCC tracker:
#!/usr/bin/python
import sys
import cv2
import numpy as np
import vot
class NCCTracker(object):
def __init__(self, image, mask):
region = self._rect_from_mask(mask)
region = vot.Rectangle(region[0], region[1], region[2], region[3])
self.window = max(region.width, region.height) * 2
left = max(region.x, 0)
top = max(region.y, 0)
right = min(region.x + region.width, image.shape[1] - 1)
bottom = min(region.y + region.height, image.shape[0] - 1)
self.template = image[int(top):int(bottom), int(left):int(right)]
self.position = (region.x + region.width / 2, region.y + region.height / 2)
self.size = (region.width, region.height)
def track(self, image):
left = max(round(self.position[0] - float(self.window) / 2), 0)
top = max(round(self.position[1] - float(self.window) / 2), 0)
right = min(round(self.position[0] + float(self.window) / 2), image.shape[1] - 1)
bottom = min(round(self.position[1] + float(self.window) / 2), image.shape[0] - 1)
if right - left < self.template.shape[1] or bottom - top < self.template.shape[0]:
return vot.Rectangle(self.position[0] + self.size[0] / 2, self.position[1] + self.size[1] / 2, self.size[0], self.size[1])
cut = image[int(top):int(bottom), int(left):int(right)]
matches = cv2.matchTemplate(cut, self.template, cv2.TM_CCOEFF_NORMED)
min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(matches)
self.position = (left + max_loc[0] + float(self.size[0]) / 2, top + max_loc[1] + float(self.size[1]) / 2)
return self._mask_from_rect([left + max_loc[0], top + max_loc[1], self.size[0], self.size[1]], (image.shape[1], image.shape[0])), max_val
def _rect_from_mask(self, mask):
'''
create an axis-aligned rectangle from a given binary mask
mask in created as a minimal rectangle containing all non-zero pixels
'''
x_ = np.sum(mask, axis=0)
y_ = np.sum(mask, axis=1)
x0 = np.min(np.nonzero(x_))
x1 = np.max(np.nonzero(x_))
y0 = np.min(np.nonzero(y_))
y1 = np.max(np.nonzero(y_))
return [x0, y0, x1 - x0 + 1, y1 - y0 + 1]
def _mask_from_rect(self, rect, output_sz):
'''
create a binary mask from a given rectangle
rect: axis-aligned rectangle [x0, y0, width, height]
output_sz: size of the output [width, height]
'''
mask = np.zeros((output_sz[1], output_sz[0]), dtype=np.uint8)
x0 = max(int(round(rect[0])), 0)
y0 = max(int(round(rect[1])), 0)
x1 = min(int(round(rect[0] + rect[2])), output_sz[0])
y1 = min(int(round(rect[1] + rect[3])), output_sz[1])
mask[y0:y1, x0:x1] = 1
return mask
def make_full_size(x, output_sz):
'''
zero-pad input x (right and down) to match output_sz
x: numpy array e.g., binary mask
output_sz: size of the output [width, height]
'''
if x.shape[0] == output_sz[1] and x.shape[1] == output_sz[0]:
return x
pad_x = output_sz[0] - x.shape[1]
if pad_x < 0:
x = x[:, :x.shape[1] + pad_x]
# padding has to be set to zero, otherwise pad function fails
pad_x = 0
pad_y = output_sz[1] - x.shape[0]
if pad_y < 0:
x = x[:x.shape[0] + pad_y, :]
# padding has to be set to zero, otherwise pad function fails
pad_y = 0
return np.pad(x, ((0, pad_y), (0, pad_x)), 'constant', constant_values=0)
handle = vot.VOT("mask", multiobject=True)
objects = handle.objects()
imagefile = handle.frame()
image = cv2.imread(imagefile, cv2.IMREAD_GRAYSCALE)
trackers = [NCCTracker(image, object) for object in objects]
while True:
imagefile = handle.frame()
if not imagefile:
break
image = cv2.imread(imagefile, cv2.IMREAD_GRAYSCALE)
handle.report([tracker.track(image) for tracker in trackers])
and the vot.py
file recommended.
Hello, I want to ask, I use your python_ The ncc file is successful. How should I test and evaluate my tracker. Do I need to use my tracker.py file as Python_ Ncc files. thank you.
AttributeError: 'MultiObjectTrackerRuntime' object has no attribute '_runtime'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.