Generated by Cython 0.15.1 on Tue Jan 31 14:40:21 2012
Raw output: dp.c
1: import numpy
/* "vision/track/dp.pyx":1 * import numpy #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* from vision import convolution * from vision import Box */ __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__numpy, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "vision/track/dp.pyx":1 * import numpy #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* from vision import convolution * from vision import Box */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1))<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
2: from vision import convolution
/* "vision/track/dp.pyx":2 * import numpy * from vision import convolution #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* from vision import Box * from vision.track import pairwise */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(((PyObject *)__pyx_n_s__convolution)); PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__convolution)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__convolution)); __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__vision), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__convolution); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__convolution, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3: from vision import Box
/* "vision/track/dp.pyx":3 * import numpy * from vision import convolution * from vision import Box #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* from vision.track import pairwise * from vision import annotations */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(((PyObject *)__pyx_n_s__Box)); PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__Box)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Box)); __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__vision), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__Box); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Box, __pyx_t_2)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4: from vision.track import pairwise
/* "vision/track/dp.pyx":4 * from vision import convolution * from vision import Box * from vision.track import pairwise #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* from vision import annotations * from vision.model import PathModel */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(((PyObject *)__pyx_n_s__pairwise)); PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__pairwise)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pairwise)); __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_26), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__pairwise); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pairwise, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5: from vision import annotations
/* "vision/track/dp.pyx":5 * from vision import Box * from vision.track import pairwise * from vision import annotations #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* from vision.model import PathModel * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(((PyObject *)__pyx_n_s__annotations)); PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__annotations)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__annotations)); __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__vision), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__annotations); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__annotations, __pyx_t_2)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6: from vision.model import PathModel
/* "vision/track/dp.pyx":6 * from vision.track import pairwise * from vision import annotations * from vision.model import PathModel #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * from math import ceil */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(((PyObject *)__pyx_n_s__PathModel)); PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__PathModel)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PathModel)); __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_27), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__PathModel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PathModel, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7:
8: from math import ceil
/* "vision/track/dp.pyx":8 * from vision.model import PathModel * * from math import ceil #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * import logging */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(((PyObject *)__pyx_n_s__ceil)); PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__ceil)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ceil)); __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__math), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ceil); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ceil, __pyx_t_2)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9:
10: import logging
/* "vision/track/dp.pyx":10 * from math import ceil * * import logging #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * cimport numpy */ __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__logging), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logging, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11:
12: cimport numpy
13: from vision cimport annotations
14:
15: cdef int debug = 0
/* "vision/track/dp.pyx":15 * from vision cimport annotations * * cdef int debug = 0 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * if debug: */ __pyx_v_6vision_5track_2dp_debug = 0;
16:
17: if debug:
/* "vision/track/dp.pyx":17 * cdef int debug = 0 * * if debug: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* import pylab * */ if (__pyx_v_6vision_5track_2dp_debug) {
18: import pylab
/* "vision/track/dp.pyx":18 * * if debug: * import pylab #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * logger = logging.getLogger("vision.track.dp") */ __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__pylab), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pylab, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L2; } __pyx_L2:;
19:
20: logger = logging.getLogger("vision.track.dp")
/* "vision/track/dp.pyx":20 * import pylab * * logger = logging.getLogger("vision.track.dp") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def fill(givens, images, last = None, */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__getLogger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_28), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logger, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21:
22: def fill(givens, images, last = None,
/* "vision/track/dp.pyx":22 * logger = logging.getLogger("vision.track.dp") * * def fill(givens, images, last = None, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* pairwisecost = 0.001, upperthreshold = 10, lowerthreshold = -100, * skip = 3, rgbbin = 8, hogbin = 8, c = 1, pool = None): */ static PyObject *__pyx_pf_6vision_5track_2dp_fill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6vision_5track_2dp_fill[] = "fill(givens, images, last=None, pairwisecost=0.001, upperthreshold=10, lowerthreshold=-100, skip=3, rgbbin=8, hogbin=8, c=1, pool=None)"; static PyMethodDef __pyx_mdef_6vision_5track_2dp_fill = {__Pyx_NAMESTR("fill"), (PyCFunction)__pyx_pf_6vision_5track_2dp_fill, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6vision_5track_2dp_fill)}; static PyObject *__pyx_pf_6vision_5track_2dp_fill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_givens = 0; PyObject *__pyx_v_images = 0; PyObject *__pyx_v_last = 0; PyObject *__pyx_v_pairwisecost = 0; PyObject *__pyx_v_upperthreshold = 0; PyObject *__pyx_v_lowerthreshold = 0; PyObject *__pyx_v_skip = 0; PyObject *__pyx_v_rgbbin = 0; PyObject *__pyx_v_hogbin = 0; PyObject *__pyx_v_c = 0; PyObject *__pyx_v_pool = 0; PyObject *__pyx_v_model = NULL; PyObject *__pyx_v_fullpath = NULL; PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_path = NULL; PyObject *__pyx_r = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__givens,&__pyx_n_s__images,&__pyx_n_s__last,&__pyx_n_s__pairwisecost,&__pyx_n_s__upperthreshold,&__pyx_n_s__lowerthreshold,&__pyx_n_s__skip,&__pyx_n_s__rgbbin,&__pyx_n_s__hogbin,&__pyx_n_s__c,&__pyx_n_s__pool,0}; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fill"); __pyx_self = __pyx_self; { PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = __pyx_k_1; values[4] = ((PyObject *)__pyx_int_10); values[5] = ((PyObject *)__pyx_int_neg_100); values[6] = ((PyObject *)__pyx_int_3); values[7] = ((PyObject *)__pyx_int_8); values[8] = ((PyObject *)__pyx_int_8); values[9] = ((PyObject *)__pyx_int_1); /* "vision/track/dp.pyx":22 * logger = logging.getLogger("vision.track.dp") * * def fill(givens, images, last = None, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* pairwisecost = 0.001, upperthreshold = 10, lowerthreshold = -100, * skip = 3, rgbbin = 8, hogbin = 8, c = 1, pool = None): */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6vision_5track_2dp_fill, NULL, __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fill, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23: pairwisecost = 0.001, upperthreshold = 10, lowerthreshold = -100,
/* "vision/track/dp.pyx":23 * * def fill(givens, images, last = None, * pairwisecost = 0.001, upperthreshold = 10, lowerthreshold = -100, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* skip = 3, rgbbin = 8, hogbin = 8, c = 1, pool = None): * */ __pyx_t_1 = PyFloat_FromDouble(0.001); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_k_1 = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0;
24: skip = 3, rgbbin = 8, hogbin = 8, c = 1, pool = None):
/* "vision/track/dp.pyx":24 * def fill(givens, images, last = None, * pairwisecost = 0.001, upperthreshold = 10, lowerthreshold = -100, * skip = 3, rgbbin = 8, hogbin = 8, c = 1, pool = None): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * givens.sort(key = lambda x: x.frame) */ values[10] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; switch (PyTuple_GET_SIZE(__pyx_args)) { case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__givens); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__images); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fill", 0, 2, 11, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__last); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pairwisecost); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__upperthreshold); if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lowerthreshold); if (value) { values[5] = value; kw_args--; } } case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__skip); if (value) { values[6] = value; kw_args--; } } case 7: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rgbbin); if (value) { values[7] = value; kw_args--; } } case 8: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__hogbin); if (value) { values[8] = value; kw_args--; } } case 9: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__c); if (value) { values[9] = value; kw_args--; } } case 10: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pool); if (value) { values[10] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "fill")<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_givens = values[0]; __pyx_v_images = values[1]; __pyx_v_last = values[2]; __pyx_v_pairwisecost = values[3]; __pyx_v_upperthreshold = values[4]; __pyx_v_lowerthreshold = values[5]; __pyx_v_skip = values[6]; __pyx_v_rgbbin = values[7]; __pyx_v_hogbin = values[8]; __pyx_v_c = values[9]; __pyx_v_pool = values[10]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fill", 0, 2, 11, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("vision.track.dp.fill", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:;
25:
26: givens.sort(key = lambda x: x.frame)
/* "vision/track/dp.pyx":26 * skip = 3, rgbbin = 8, hogbin = 8, c = 1, pool = None): * * givens.sort(key = lambda x: x.frame) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * model = PathModel(images, givens, rgbbin = rgbbin, hogbin = hogbin, c = c) */ static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyMethodDef __pyx_lambda_methdef_lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_lambda_funcdef_lambda1, METH_O, __Pyx_DOCSTR(0)}; static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda1"); __pyx_self = __pyx_self; __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("vision.track.dp.fill.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "vision/track/dp.pyx":26 * skip = 3, rgbbin = 8, hogbin = 8, c = 1, pool = None): * * givens.sort(key = lambda x: x.frame) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * model = PathModel(images, givens, rgbbin = rgbbin, hogbin = hogbin, c = c) */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_givens, __pyx_n_s__sort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_3 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_lambda_methdef_lambda1, NULL, __pyx_n_s_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__key), __pyx_t_3)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27:
28: model = PathModel(images, givens, rgbbin = rgbbin, hogbin = hogbin, c = c)
/* "vision/track/dp.pyx":28 * givens.sort(key = lambda x: x.frame) * * model = PathModel(images, givens, rgbbin = rgbbin, hogbin = hogbin, c = c) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * fullpath = [] */ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__PathModel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_images); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_images); __Pyx_GIVEREF(__pyx_v_images); __Pyx_INCREF(__pyx_v_givens); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_givens); __Pyx_GIVEREF(__pyx_v_givens); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__rgbbin), __pyx_v_rgbbin)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__hogbin), __pyx_v_hogbin)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__c), __pyx_v_c)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_v_model = __pyx_t_4; __pyx_t_4 = 0;
29:
30: fullpath = []
/* "vision/track/dp.pyx":30 * model = PathModel(images, givens, rgbbin = rgbbin, hogbin = hogbin, c = c) * * fullpath = [] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* for x, y in zip(givens, givens[1:]): * path = track(x, y, model, images, pairwisecost, */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __pyx_v_fullpath = __pyx_t_4; __pyx_t_4 = 0;
31: for x, y in zip(givens, givens[1:]):
/* "vision/track/dp.pyx":31 * * fullpath = [] * for x, y in zip(givens, givens[1:]): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* path = track(x, y, model, images, pairwisecost, * upperthreshold, lowerthreshold, skip, pool) */ __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_givens, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_givens); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_givens); __Pyx_GIVEREF(__pyx_v_givens); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_Call(__pyx_builtin_zip, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; } else if (PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; } else { __pyx_t_4 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; if (likely(PyTuple_CheckExact(sequence))) { if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { if (unlikely(PyList_GET_SIZE(sequence) != 2)) { if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L9_unpacking_done:; } __Pyx_XDECREF(__pyx_v_x); __pyx_v_x = __pyx_t_2; __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_v_y); __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0;
32: path = track(x, y, model, images, pairwisecost,
/* "vision/track/dp.pyx":32 * fullpath = [] * for x, y in zip(givens, givens[1:]): * path = track(x, y, model, images, pairwisecost, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* upperthreshold, lowerthreshold, skip, pool) * fullpath.extend(path[:-1]) */ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__track); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4);
33: upperthreshold, lowerthreshold, skip, pool)
/* "vision/track/dp.pyx":33 * for x, y in zip(givens, givens[1:]): * path = track(x, y, model, images, pairwisecost, * upperthreshold, lowerthreshold, skip, pool) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* fullpath.extend(path[:-1]) * */ __pyx_t_3 = PyTuple_New(9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); __Pyx_INCREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); __Pyx_INCREF(__pyx_v_model); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_model); __Pyx_GIVEREF(__pyx_v_model); __Pyx_INCREF(__pyx_v_images); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_images); __Pyx_GIVEREF(__pyx_v_images); __Pyx_INCREF(__pyx_v_pairwisecost); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_pairwisecost); __Pyx_GIVEREF(__pyx_v_pairwisecost); __Pyx_INCREF(__pyx_v_upperthreshold); PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_upperthreshold); __Pyx_GIVEREF(__pyx_v_upperthreshold); __Pyx_INCREF(__pyx_v_lowerthreshold); PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_v_lowerthreshold); __Pyx_GIVEREF(__pyx_v_lowerthreshold); __Pyx_INCREF(__pyx_v_skip); PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_v_skip); __Pyx_GIVEREF(__pyx_v_skip); __Pyx_INCREF(__pyx_v_pool); PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_v_pool); __Pyx_GIVEREF(__pyx_v_pool); __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_v_path); __pyx_v_path = __pyx_t_2; __pyx_t_2 = 0;
34: fullpath.extend(path[:-1])
/* "vision/track/dp.pyx":34 * path = track(x, y, model, images, pairwisecost, * upperthreshold, lowerthreshold, skip, pool) * fullpath.extend(path[:-1]) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * if last is not None and last > givens[-1].frame: */ __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_fullpath), __pyx_n_s__extend); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_path, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35:
36: if last is not None and last > givens[-1].frame:
/* "vision/track/dp.pyx":36 * fullpath.extend(path[:-1]) * * if last is not None and last > givens[-1].frame: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* path = track(givens[-1], last, model, images, * pairwisecost, upperthreshold, lowerthreshold, skip, pool) */ __pyx_t_9 = (__pyx_v_last != Py_None); if (__pyx_t_9) { __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_givens, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__frame); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_v_last, __pyx_t_3, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __pyx_t_10; } else { __pyx_t_11 = __pyx_t_9; } if (__pyx_t_11) {
37: path = track(givens[-1], last, model, images,
/* "vision/track/dp.pyx":37 * * if last is not None and last > givens[-1].frame: * path = track(givens[-1], last, model, images, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* pairwisecost, upperthreshold, lowerthreshold, skip, pool) * fullpath.extend(path[:-1]) */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__track); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_givens, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3);
38: pairwisecost, upperthreshold, lowerthreshold, skip, pool)
/* "vision/track/dp.pyx":38 * if last is not None and last > givens[-1].frame: * path = track(givens[-1], last, model, images, * pairwisecost, upperthreshold, lowerthreshold, skip, pool) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* fullpath.extend(path[:-1]) * */ __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_last); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_last); __Pyx_GIVEREF(__pyx_v_last); __Pyx_INCREF(__pyx_v_model); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_model); __Pyx_GIVEREF(__pyx_v_model); __Pyx_INCREF(__pyx_v_images); PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_images); __Pyx_GIVEREF(__pyx_v_images); __Pyx_INCREF(__pyx_v_pairwisecost); PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_pairwisecost); __Pyx_GIVEREF(__pyx_v_pairwisecost); __Pyx_INCREF(__pyx_v_upperthreshold); PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_upperthreshold); __Pyx_GIVEREF(__pyx_v_upperthreshold); __Pyx_INCREF(__pyx_v_lowerthreshold); PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_v_lowerthreshold); __Pyx_GIVEREF(__pyx_v_lowerthreshold); __Pyx_INCREF(__pyx_v_skip); PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_v_skip); __Pyx_GIVEREF(__pyx_v_skip); __Pyx_INCREF(__pyx_v_pool); PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_v_pool); __Pyx_GIVEREF(__pyx_v_pool); __pyx_t_3 = 0; __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_v_path); __pyx_v_path = __pyx_t_3; __pyx_t_3 = 0;
39: fullpath.extend(path[:-1])
/* "vision/track/dp.pyx":39 * path = track(givens[-1], last, model, images, * pairwisecost, upperthreshold, lowerthreshold, skip, pool) * fullpath.extend(path[:-1]) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * return fullpath */ __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_fullpath), __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_path, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L10; } __pyx_L10:;
40:
41: return fullpath
/* "vision/track/dp.pyx":41 * fullpath.extend(path[:-1]) * * return fullpath #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def track(start, stop, model, images, */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_fullpath)); __pyx_r = ((PyObject *)__pyx_v_fullpath); goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("vision.track.dp.fill", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_model); __Pyx_XDECREF(__pyx_v_fullpath); __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_path); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
42:
43: def track(start, stop, model, images,
/* "vision/track/dp.pyx":43 * return fullpath * * def track(start, stop, model, images, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* pairwisecost = 0.001, upperthreshold = 10, lowerthreshold = -100, * skip = 3, pool = None): */ static PyObject *__pyx_pf_6vision_5track_2dp_1track(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6vision_5track_2dp_1track[] = "track(start, stop, model, images, pairwisecost=0.001, upperthreshold=10, lowerthreshold=-100, skip=3, pool=None)"; static PyMethodDef __pyx_mdef_6vision_5track_2dp_1track = {__Pyx_NAMESTR("track"), (PyCFunction)__pyx_pf_6vision_5track_2dp_1track, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6vision_5track_2dp_1track)}; static PyObject *__pyx_pf_6vision_5track_2dp_1track(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_stop = 0; PyObject *__pyx_v_model = 0; PyObject *__pyx_v_images = 0; PyObject *__pyx_v_pairwisecost = 0; PyObject *__pyx_v_upperthreshold = 0; PyObject *__pyx_v_lowerthreshold = 0; PyObject *__pyx_v_skip = 0; PyObject *__pyx_v_pool = 0; PyObject *__pyx_v_imagesize = NULL; PyObject *__pyx_v_mapper = NULL; PyObject *__pyx_v_stopframe = NULL; int __pyx_v_constrained; PyObject *__pyx_v_stopxtl = NULL; PyObject *__pyx_v_stopytl = NULL; PyObject *__pyx_v_constraints = NULL; PyObject *__pyx_v_frames = NULL; PyObject *__pyx_v_orders = NULL; PyObject *__pyx_v_costs = NULL; PyObject *__pyx_v_forwardsargs = NULL; PyObject *__pyx_v_forwards = NULL; PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_frame = NULL; PyObject *__pyx_v_path = NULL; PyObject *__pyx_r = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__stop,&__pyx_n_s__model,&__pyx_n_s__images,&__pyx_n_s__pairwisecost,&__pyx_n_s__upperthreshold,&__pyx_n_s__lowerthreshold,&__pyx_n_s__skip,&__pyx_n_s__pool,0}; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("track"); __pyx_self = __pyx_self; { PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; values[4] = __pyx_k_3; values[5] = ((PyObject *)__pyx_int_10); values[6] = ((PyObject *)__pyx_int_neg_100); values[7] = ((PyObject *)__pyx_int_3); /* "vision/track/dp.pyx":43 * return fullpath * * def track(start, stop, model, images, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* pairwisecost = 0.001, upperthreshold = 10, lowerthreshold = -100, * skip = 3, pool = None): */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6vision_5track_2dp_1track, NULL, __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__track, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
44: pairwisecost = 0.001, upperthreshold = 10, lowerthreshold = -100,
/* "vision/track/dp.pyx":44 * * def track(start, stop, model, images, * pairwisecost = 0.001, upperthreshold = 10, lowerthreshold = -100, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* skip = 3, pool = None): * */ __pyx_t_1 = PyFloat_FromDouble(0.001); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_k_3 = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0;
45: skip = 3, pool = None):
/* "vision/track/dp.pyx":45 * def track(start, stop, model, images, * pairwisecost = 0.001, upperthreshold = 10, lowerthreshold = -100, * skip = 3, pool = None): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * imagesize = images[start.frame].size */ values[8] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; switch (PyTuple_GET_SIZE(__pyx_args)) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stop); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("track", 0, 4, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__model); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("track", 0, 4, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__images); if (likely(values[3])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("track", 0, 4, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pairwisecost); if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__upperthreshold); if (value) { values[5] = value; kw_args--; } } case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lowerthreshold); if (value) { values[6] = value; kw_args--; } } case 7: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__skip); if (value) { values[7] = value; kw_args--; } } case 8: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pool); if (value) { values[8] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "track")<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_start = values[0]; __pyx_v_stop = values[1]; __pyx_v_model = values[2]; __pyx_v_images = values[3]; __pyx_v_pairwisecost = values[4]; __pyx_v_upperthreshold = values[5]; __pyx_v_lowerthreshold = values[6]; __pyx_v_skip = values[7]; __pyx_v_pool = values[8]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("track", 0, 4, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("vision.track.dp.track", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_INCREF(__pyx_v_stop);
46:
47: imagesize = images[start.frame].size
/* "vision/track/dp.pyx":47 * skip = 3, pool = None): * * imagesize = images[start.frame].size #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * if pool: */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetItem(__pyx_v_images, __pyx_t_1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_imagesize = __pyx_t_1; __pyx_t_1 = 0;
48:
49: if pool:
/* "vision/track/dp.pyx":49 * imagesize = images[start.frame].size * * if pool: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* mapper = pool.map * else: */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_pool); if (unlikely(__pyx_t_3<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) {
50: mapper = pool.map
/* "vision/track/dp.pyx":50 * * if pool: * mapper = pool.map #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* else: * mapper = map */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_pool, __pyx_n_s__map); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_mapper = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L6; } /*else*/ {
51: else:
52: mapper = map
/* "vision/track/dp.pyx":52 * mapper = pool.map * else: * mapper = map #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * try: */ __Pyx_INCREF(__pyx_builtin_map); __pyx_v_mapper = __pyx_builtin_map; } __pyx_L6:;
53:
54: try:
/* "vision/track/dp.pyx":54 * mapper = map * * try: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* stopframe = stop.frame * constrained = True */ { __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ {
55: stopframe = stop.frame
/* "vision/track/dp.pyx":55 * * try: * stopframe = stop.frame #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* constrained = True * # adjust stop for scaling reasons */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_stop, __pyx_n_s__frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_stopframe = __pyx_t_1; __pyx_t_1 = 0;
56: constrained = True
/* "vision/track/dp.pyx":56 * try: * stopframe = stop.frame * constrained = True #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* # adjust stop for scaling reasons * if stop.xtl + start.width >= imagesize[0]: */ __pyx_v_constrained = 1;
57: # adjust stop for scaling reasons
58: if stop.xtl + start.width >= imagesize[0]:
/* "vision/track/dp.pyx":58 * constrained = True * # adjust stop for scaling reasons * if stop.xtl + start.width >= imagesize[0]: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* stopxtl = imagesize[0] - start.width - 1 * else: */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_stop, __pyx_n_s__xtl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_imagesize, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_2, Py_GE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) {
59: stopxtl = imagesize[0] - start.width - 1
/* "vision/track/dp.pyx":59 * # adjust stop for scaling reasons * if stop.xtl + start.width >= imagesize[0]: * stopxtl = imagesize[0] - start.width - 1 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* else: * stopxtl = stop.xtl */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_imagesize, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Subtract(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_stopxtl = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L15; } /*else*/ {
60: else:
61: stopxtl = stop.xtl
/* "vision/track/dp.pyx":61 * stopxtl = imagesize[0] - start.width - 1 * else: * stopxtl = stop.xtl #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* if stop.ytl + start.height >= imagesize[1]: * stopytl = imagesize[1] - start.height - 1 */ __pyx_t_2 = PyObject_GetAttr(__pyx_v_stop, __pyx_n_s__xtl); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_stopxtl = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L15:;
62: if stop.ytl + start.height >= imagesize[1]:
/* "vision/track/dp.pyx":62 * else: * stopxtl = stop.xtl * if stop.ytl + start.height >= imagesize[1]: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* stopytl = imagesize[1] - start.height - 1 * else: */ __pyx_t_2 = PyObject_GetAttr(__pyx_v_stop, __pyx_n_s__ytl); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__height); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_imagesize, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) {
63: stopytl = imagesize[1] - start.height - 1
/* "vision/track/dp.pyx":63 * stopxtl = stop.xtl * if stop.ytl + start.height >= imagesize[1]: * stopytl = imagesize[1] - start.height - 1 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* else: * stopytl = stop.ytl */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_imagesize, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__height); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_stopytl = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L16; } /*else*/ {
64: else:
65: stopytl = stop.ytl
/* "vision/track/dp.pyx":65 * stopytl = imagesize[1] - start.height - 1 * else: * stopytl = stop.ytl #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* stop = Box(stopxtl, stopytl, stopxtl + start.width, * stopytl + start.height, stop.frame) */ __pyx_t_7 = PyObject_GetAttr(__pyx_v_stop, __pyx_n_s__ytl); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_v_stopytl = __pyx_t_7; __pyx_t_7 = 0; } __pyx_L16:;
66: stop = Box(stopxtl, stopytl, stopxtl + start.width,
/* "vision/track/dp.pyx":66 * else: * stopytl = stop.ytl * stop = Box(stopxtl, stopytl, stopxtl + start.width, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* stopytl + start.height, stop.frame) * constraints = [start, stop] */ __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__Box); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_v_stopxtl, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67: stopytl + start.height, stop.frame)
/* "vision/track/dp.pyx":67 * stopytl = stop.ytl * stop = Box(stopxtl, stopytl, stopxtl + start.width, * stopytl + start.height, stop.frame) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* constraints = [start, stop] * except: */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__height); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PyNumber_Add(__pyx_v_stopytl, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_v_stop, __pyx_n_s__frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyTuple_New(5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); __Pyx_INCREF(__pyx_v_stopxtl); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_stopxtl); __Pyx_GIVEREF(__pyx_v_stopxtl); __Pyx_INCREF(__pyx_v_stopytl); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_stopytl); __Pyx_GIVEREF(__pyx_v_stopytl); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_stop); __pyx_v_stop = __pyx_t_1; __pyx_t_1 = 0;
68: constraints = [start, stop]
/* "vision/track/dp.pyx":68 * stop = Box(stopxtl, stopytl, stopxtl + start.width, * stopytl + start.height, stop.frame) * constraints = [start, stop] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* except: * stopframe = stop */ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_start); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_start); __Pyx_GIVEREF(__pyx_v_start); __Pyx_INCREF(__pyx_v_stop); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_stop); __Pyx_GIVEREF(__pyx_v_stop); __pyx_v_constraints = __pyx_t_1; __pyx_t_1 = 0; } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L14_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
69: except:
/* "vision/track/dp.pyx":69 * stopytl + start.height, stop.frame) * constraints = [start, stop] * except: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* stopframe = stop * constrained = False */ /*except:*/ { __Pyx_AddTraceback("vision.track.dp.track", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_7)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_7);
70: stopframe = stop
/* "vision/track/dp.pyx":70 * constraints = [start, stop] * except: * stopframe = stop #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* constrained = False * constraints = [start] */ __Pyx_INCREF(__pyx_v_stop); __Pyx_XDECREF(__pyx_v_stopframe); __pyx_v_stopframe = __pyx_v_stop;
71: constrained = False
/* "vision/track/dp.pyx":71 * except: * stopframe = stop * constrained = False #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* constraints = [start] * */ __pyx_v_constrained = 0;
72: constraints = [start]
/* "vision/track/dp.pyx":72 * stopframe = stop * constrained = False * constraints = [start] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * logger.info("Dynamic programming from {0} to {1}".format(start.frame, */ __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); __Pyx_INCREF(__pyx_v_start); PyList_SET_ITEM(__pyx_t_8, 0, __pyx_v_start); __Pyx_GIVEREF(__pyx_v_start); __Pyx_XDECREF(((PyObject *)__pyx_v_constraints)); __pyx_v_constraints = __pyx_t_8; __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_L14_try_end:; }
73:
74: logger.info("Dynamic programming from {0} to {1}".format(start.frame,
/* "vision/track/dp.pyx":74 * constraints = [start] * * logger.info("Dynamic programming from {0} to {1}".format(start.frame, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* stopframe)) * */ __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__info); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_4), __pyx_n_s__format); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1);
75: stopframe))
/* "vision/track/dp.pyx":75 * * logger.info("Dynamic programming from {0} to {1}".format(start.frame, * stopframe)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * frames = range(start.frame, stopframe + 1) */ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_stopframe); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_stopframe); __Pyx_GIVEREF(__pyx_v_stopframe); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
76:
77: frames = range(start.frame, stopframe + 1)
/* "vision/track/dp.pyx":77 * stopframe)) * * frames = range(start.frame, stopframe + 1) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * # build dictionary of local scores */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PyNumber_Add(__pyx_v_stopframe, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_1 = 0; __pyx_t_8 = 0; __pyx_t_8 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_v_frames = __pyx_t_8; __pyx_t_8 = 0;
78:
79: # build dictionary of local scores
80: # if there is a pool, this will happen in parallel
81: logger.info("Scoring frames")
/* "vision/track/dp.pyx":81 * # build dictionary of local scores * # if there is a pool, this will happen in parallel * logger.info("Scoring frames") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* orders = [(images, start, x, model) for x in frames] * costs = dict(mapper(scoreframe, orders)) */ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "vision/track/dp.pyx":81 * # build dictionary of local scores * # if there is a pool, this will happen in parallel * logger.info("Scoring frames") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* orders = [(images, start, x, model) for x in frames] * costs = dict(mapper(scoreframe, orders)) */ __pyx_k_tuple_6 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_6)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, ((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
82: orders = [(images, start, x, model) for x in frames]
/* "vision/track/dp.pyx":82 * # if there is a pool, this will happen in parallel * logger.info("Scoring frames") * orders = [(images, start, x, model) for x in frames] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* costs = dict(mapper(scoreframe, orders)) * */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); if (PyList_CheckExact(__pyx_v_frames) || PyTuple_CheckExact(__pyx_v_frames)) { __pyx_t_9 = __pyx_v_frames; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_frames); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext; } for (;;) { if (PyList_CheckExact(__pyx_t_9)) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break; __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; } else if (PyTuple_CheckExact(__pyx_t_9)) { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break; __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; } else { __pyx_t_1 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_1)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF(__pyx_v_x); __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_images); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_images); __Pyx_GIVEREF(__pyx_v_images); __Pyx_INCREF(__pyx_v_start); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start); __Pyx_GIVEREF(__pyx_v_start); __Pyx_INCREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); __Pyx_INCREF(__pyx_v_model); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_model); __Pyx_GIVEREF(__pyx_v_model); if (unlikely(PyList_Append(__pyx_t_8, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_INCREF(((PyObject *)__pyx_t_8)); __pyx_v_orders = __pyx_t_8; __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
83: costs = dict(mapper(scoreframe, orders))
/* "vision/track/dp.pyx":83 * logger.info("Scoring frames") * orders = [(images, start, x, model) for x in frames] * costs = dict(mapper(scoreframe, orders)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * # forward and backwards passes */ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__scoreframe); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_v_orders)); PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_orders)); __Pyx_GIVEREF(((PyObject *)__pyx_v_orders)); __pyx_t_8 = 0; __pyx_t_8 = PyObject_Call(__pyx_v_mapper, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_v_costs = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0;
84:
85: # forward and backwards passes
86: # if there is a pool, this will use up to 2 cores
87: forwardsargs = [frames, imagesize, model, costs, pairwisecost,
88: upperthreshold, lowerthreshold, skip, constraints]
/* "vision/track/dp.pyx":88 * # if there is a pool, this will use up to 2 cores * forwardsargs = [frames, imagesize, model, costs, pairwisecost, * upperthreshold, lowerthreshold, skip, constraints] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* logger.info("Building forwards graph") * forwards = buildgraph(*forwardsargs) */ __pyx_t_8 = PyList_New(9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); __Pyx_INCREF(__pyx_v_frames); PyList_SET_ITEM(__pyx_t_8, 0, __pyx_v_frames); __Pyx_GIVEREF(__pyx_v_frames); __Pyx_INCREF(__pyx_v_imagesize); PyList_SET_ITEM(__pyx_t_8, 1, __pyx_v_imagesize); __Pyx_GIVEREF(__pyx_v_imagesize); __Pyx_INCREF(__pyx_v_model); PyList_SET_ITEM(__pyx_t_8, 2, __pyx_v_model); __Pyx_GIVEREF(__pyx_v_model); __Pyx_INCREF(((PyObject *)__pyx_v_costs)); PyList_SET_ITEM(__pyx_t_8, 3, ((PyObject *)__pyx_v_costs)); __Pyx_GIVEREF(((PyObject *)__pyx_v_costs)); __Pyx_INCREF(__pyx_v_pairwisecost); PyList_SET_ITEM(__pyx_t_8, 4, __pyx_v_pairwisecost); __Pyx_GIVEREF(__pyx_v_pairwisecost); __Pyx_INCREF(__pyx_v_upperthreshold); PyList_SET_ITEM(__pyx_t_8, 5, __pyx_v_upperthreshold); __Pyx_GIVEREF(__pyx_v_upperthreshold); __Pyx_INCREF(__pyx_v_lowerthreshold); PyList_SET_ITEM(__pyx_t_8, 6, __pyx_v_lowerthreshold); __Pyx_GIVEREF(__pyx_v_lowerthreshold); __Pyx_INCREF(__pyx_v_skip); PyList_SET_ITEM(__pyx_t_8, 7, __pyx_v_skip); __Pyx_GIVEREF(__pyx_v_skip); __Pyx_INCREF(((PyObject *)__pyx_v_constraints)); PyList_SET_ITEM(__pyx_t_8, 8, ((PyObject *)__pyx_v_constraints)); __Pyx_GIVEREF(((PyObject *)__pyx_v_constraints)); __pyx_v_forwardsargs = __pyx_t_8; __pyx_t_8 = 0;
89: logger.info("Building forwards graph")
/* "vision/track/dp.pyx":89 * forwardsargs = [frames, imagesize, model, costs, pairwisecost, * upperthreshold, lowerthreshold, skip, constraints] * logger.info("Building forwards graph") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* forwards = buildgraph(*forwardsargs) * */ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "vision/track/dp.pyx":89 * forwardsargs = [frames, imagesize, model, costs, pairwisecost, * upperthreshold, lowerthreshold, skip, constraints] * logger.info("Building forwards graph") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* forwards = buildgraph(*forwardsargs) * */ __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_s_7)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));
90: forwards = buildgraph(*forwardsargs)
/* "vision/track/dp.pyx":90 * upperthreshold, lowerthreshold, skip, constraints] * logger.info("Building forwards graph") * forwards = buildgraph(*forwardsargs) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * # backtrack */ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__buildgraph); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PySequence_Tuple(((PyObject *)__pyx_v_forwardsargs)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_v_forwards = __pyx_t_1; __pyx_t_1 = 0;
91:
92: # backtrack
93: logger.info("Backtracking")
/* "vision/track/dp.pyx":93 * * # backtrack * logger.info("Backtracking") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* if constrained: * x, y, frame = stop.xtl, stop.ytl, stop.frame */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "vision/track/dp.pyx":93 * * # backtrack * logger.info("Backtracking") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* if constrained: * x, y, frame = stop.xtl, stop.ytl, stop.frame */ __pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9)); __Pyx_INCREF(((PyObject *)__pyx_n_s__Backtracking)); PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_n_s__Backtracking)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Backtracking)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));
94: if constrained:
/* "vision/track/dp.pyx":94 * # backtrack * logger.info("Backtracking") * if constrained: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* x, y, frame = stop.xtl, stop.ytl, stop.frame * else: */ if (__pyx_v_constrained) {
95: x, y, frame = stop.xtl, stop.ytl, stop.frame
/* "vision/track/dp.pyx":95 * logger.info("Backtracking") * if constrained: * x, y, frame = stop.xtl, stop.ytl, stop.frame #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* else: * x, y = numpy.unravel_index(numpy.argmin(forwards[stopframe][0]), */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_stop, __pyx_n_s__xtl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyObject_GetAttr(__pyx_v_stop, __pyx_n_s__ytl); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyObject_GetAttr(__pyx_v_stop, __pyx_n_s__frame); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_v_x); __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_9; __pyx_t_9 = 0; __pyx_v_frame = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L21; } /*else*/ {
96: else:
97: x, y = numpy.unravel_index(numpy.argmin(forwards[stopframe][0]),
/* "vision/track/dp.pyx":97 * x, y, frame = stop.xtl, stop.ytl, stop.frame * else: * x, y = numpy.unravel_index(numpy.argmin(forwards[stopframe][0]), #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* forwards[stopframe][0].shape) * x = x * skip */ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__unravel_index); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__argmin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyObject_GetItem(__pyx_v_forwards, __pyx_v_stopframe); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; /* "vision/track/dp.pyx":97 * x, y, frame = stop.xtl, stop.ytl, stop.frame * else: * x, y = numpy.unravel_index(numpy.argmin(forwards[stopframe][0]), #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* forwards[stopframe][0].shape) * x = x * skip */ __Pyx_XDECREF(__pyx_v_x); __pyx_v_x = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_y = __pyx_t_9; __pyx_t_9 = 0;
98: forwards[stopframe][0].shape)
/* "vision/track/dp.pyx":98 * else: * x, y = numpy.unravel_index(numpy.argmin(forwards[stopframe][0]), * forwards[stopframe][0].shape) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* x = x * skip * y = y * skip */ __pyx_t_8 = PyObject_GetItem(__pyx_v_forwards, __pyx_v_stopframe); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { PyObject* sequence = __pyx_t_8; if (likely(PyTuple_CheckExact(sequence))) { if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); } else { if (unlikely(PyList_GET_SIZE(sequence) != 2)) { if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L22_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L22_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_7), 2)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L23_unpacking_done; __pyx_L22_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L23_unpacking_done:; }
99: x = x * skip
/* "vision/track/dp.pyx":99 * x, y = numpy.unravel_index(numpy.argmin(forwards[stopframe][0]), * forwards[stopframe][0].shape) * x = x * skip #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* y = y * skip * frame = stopframe */ __pyx_t_8 = PyNumber_Multiply(__pyx_v_x, __pyx_v_skip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_v_x); __pyx_v_x = __pyx_t_8; __pyx_t_8 = 0;
100: y = y * skip
/* "vision/track/dp.pyx":100 * forwards[stopframe][0].shape) * x = x * skip * y = y * skip #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* frame = stopframe * path = [] */ __pyx_t_8 = PyNumber_Multiply(__pyx_v_y, __pyx_v_skip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_v_y); __pyx_v_y = __pyx_t_8; __pyx_t_8 = 0;
101: frame = stopframe
/* "vision/track/dp.pyx":101 * x = x * skip * y = y * skip * frame = stopframe #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* path = [] * while frame > start.frame: */ __Pyx_INCREF(__pyx_v_stopframe); __pyx_v_frame = __pyx_v_stopframe; } __pyx_L21:;
102: path = []
/* "vision/track/dp.pyx":102 * y = y * skip * frame = stopframe * path = [] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* while frame > start.frame: * path.append(annotations.Box(x, y, */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); __pyx_v_path = __pyx_t_8; __pyx_t_8 = 0;
103: while frame > start.frame:
/* "vision/track/dp.pyx":103 * frame = stopframe * path = [] * while frame > start.frame: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* path.append(annotations.Box(x, y, * x + start.width, */ while (1) { __pyx_t_8 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__frame); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyObject_RichCompare(__pyx_v_frame, __pyx_t_8, Py_GT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (!__pyx_t_3) break;
104: path.append(annotations.Box(x, y,
/* "vision/track/dp.pyx":104 * path = [] * while frame > start.frame: * path.append(annotations.Box(x, y, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* x + start.width, * y + start.height, */ if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
105: x + start.width,
/* "vision/track/dp.pyx":105 * while frame > start.frame: * path.append(annotations.Box(x, y, * x + start.width, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* y + start.height, * frame)) */ __pyx_t_9 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__width); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyNumber_Add(__pyx_v_x, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
106: y + start.height,
/* "vision/track/dp.pyx":106 * path.append(annotations.Box(x, y, * x + start.width, * y + start.height, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* frame)) * x, y = (forwards[frame][1][x // skip, y // skip] * skip, */ __pyx_t_9 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__height); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = PyNumber_Add(__pyx_v_y, __pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
107: frame))
/* "vision/track/dp.pyx":107 * x + start.width, * y + start.height, * frame)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* x, y = (forwards[frame][1][x // skip, y // skip] * skip, * forwards[frame][2][x // skip, y // skip] * skip) */ __pyx_t_9 = PyTuple_New(5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); __Pyx_INCREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); __Pyx_INCREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_frame); PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_v_frame); __Pyx_GIVEREF(__pyx_v_frame); __pyx_t_8 = 0; __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6vision_11annotations_Box)), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_t_13 = PyList_Append(__pyx_v_path, __pyx_t_1); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
108: x, y = (forwards[frame][1][x // skip, y // skip] * skip,
/* "vision/track/dp.pyx":108 * y + start.height, * frame)) * x, y = (forwards[frame][1][x // skip, y // skip] * skip, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* forwards[frame][2][x // skip, y // skip] * skip) * frame = frame - 1 */ __pyx_t_1 = PyObject_GetItem(__pyx_v_forwards, __pyx_v_frame); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_FloorDivide(__pyx_v_x, __pyx_v_skip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PyNumber_FloorDivide(__pyx_v_y, __pyx_v_skip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_7)); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_1 = 0; __pyx_t_8 = 0; __pyx_t_8 = PyObject_GetItem(__pyx_t_9, ((PyObject *)__pyx_t_7)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __pyx_t_7 = PyNumber_Multiply(__pyx_t_8, __pyx_v_skip); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
109: forwards[frame][2][x // skip, y // skip] * skip)
/* "vision/track/dp.pyx":109 * frame)) * x, y = (forwards[frame][1][x // skip, y // skip] * skip, * forwards[frame][2][x // skip, y // skip] * skip) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* frame = frame - 1 * path.append(start) */ __pyx_t_8 = PyObject_GetItem(__pyx_v_forwards, __pyx_v_frame); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyNumber_FloorDivide(__pyx_v_x, __pyx_v_skip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = PyNumber_FloorDivide(__pyx_v_y, __pyx_v_skip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_8 = 0; __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetItem(__pyx_t_9, ((PyObject *)__pyx_t_2)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_skip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_x); __pyx_v_x = __pyx_t_7; __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_y); __pyx_v_y = __pyx_t_2; __pyx_t_2 = 0;
110: frame = frame - 1
/* "vision/track/dp.pyx":110 * x, y = (forwards[frame][1][x // skip, y // skip] * skip, * forwards[frame][2][x // skip, y // skip] * skip) * frame = frame - 1 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* path.append(start) * path.reverse() */ __pyx_t_2 = PyNumber_Subtract(__pyx_v_frame, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_frame); __pyx_v_frame = __pyx_t_2; __pyx_t_2 = 0; }
111: path.append(start)
/* "vision/track/dp.pyx":111 * forwards[frame][2][x // skip, y // skip] * skip) * frame = frame - 1 * path.append(start) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* path.reverse() * return path */ if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_13 = PyList_Append(__pyx_v_path, __pyx_v_start); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112: path.reverse()
/* "vision/track/dp.pyx":112 * frame = frame - 1 * path.append(start) * path.reverse() #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return path * */ if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "reverse"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_13 = PyList_Reverse(__pyx_v_path); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113: return path
/* "vision/track/dp.pyx":113 * path.append(start) * path.reverse() * return path #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def buildgraph(frames, imagesize, model, costs, */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_path)); __pyx_r = ((PyObject *)__pyx_v_path); goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("vision.track.dp.track", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_imagesize); __Pyx_XDECREF(__pyx_v_mapper); __Pyx_XDECREF(__pyx_v_stopframe); __Pyx_XDECREF(__pyx_v_stopxtl); __Pyx_XDECREF(__pyx_v_stopytl); __Pyx_XDECREF(__pyx_v_constraints); __Pyx_XDECREF(__pyx_v_frames); __Pyx_XDECREF(__pyx_v_orders); __Pyx_XDECREF(__pyx_v_costs); __Pyx_XDECREF(__pyx_v_forwardsargs); __Pyx_XDECREF(__pyx_v_forwards); __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_frame); __Pyx_XDECREF(__pyx_v_path); __Pyx_XDECREF(__pyx_v_stop); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
114:
115: def buildgraph(frames, imagesize, model, costs,
/* "vision/track/dp.pyx":115 * return path * * def buildgraph(frames, imagesize, model, costs, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* double pairwisecost, double upperthreshold, * double lowerthreshold, int skip, constraints): */ static PyObject *__pyx_pf_6vision_5track_2dp_2buildgraph(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6vision_5track_2dp_2buildgraph[] = "buildgraph(frames, imagesize, model, costs, double pairwisecost, double upperthreshold, double lowerthreshold, int skip, constraints)"; static PyMethodDef __pyx_mdef_6vision_5track_2dp_2buildgraph = {__Pyx_NAMESTR("buildgraph"), (PyCFunction)__pyx_pf_6vision_5track_2dp_2buildgraph, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6vision_5track_2dp_2buildgraph)}; static PyObject *__pyx_pf_6vision_5track_2dp_2buildgraph(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_frames = 0; PyObject *__pyx_v_imagesize = 0; PyObject *__pyx_v_model = 0; PyObject *__pyx_v_costs = 0; double __pyx_v_pairwisecost; double __pyx_v_upperthreshold; double __pyx_v_lowerthreshold; int __pyx_v_skip; PyObject *__pyx_v_constraints = 0; double __pyx_v_cost; double __pyx_v_wr; double __pyx_v_hr; int __pyx_v_width; int __pyx_v_height; int __pyx_v_usablewidth; int __pyx_v_usableheight; PyArrayObject *__pyx_v_relevantcosts = 0; PyArrayObject *__pyx_v_current = 0; PyArrayObject *__pyx_v_xpointer = 0; PyArrayObject *__pyx_v_ypointer = 0; struct __pyx_obj_6vision_11annotations_Box *__pyx_v_constraint = 0; struct __pyx_obj_6vision_11annotations_Box *__pyx_v_start = 0; double __pyx_v_Huge; PyObject *__pyx_v_graph = NULL; PyObject *__pyx_v_frame = NULL; long __pyx_v_x; long __pyx_v_y; Py_buffer __pyx_bstruct_current; Py_ssize_t __pyx_bstride_0_current = 0; Py_ssize_t __pyx_bstride_1_current = 0; Py_ssize_t __pyx_bshape_0_current = 0; Py_ssize_t __pyx_bshape_1_current = 0; Py_buffer __pyx_bstruct_relevantcosts; Py_ssize_t __pyx_bstride_0_relevantcosts = 0; Py_ssize_t __pyx_bstride_1_relevantcosts = 0; Py_ssize_t __pyx_bshape_0_relevantcosts = 0; Py_ssize_t __pyx_bshape_1_relevantcosts = 0; Py_buffer __pyx_bstruct_xpointer; Py_ssize_t __pyx_bstride_0_xpointer = 0; Py_ssize_t __pyx_bstride_1_xpointer = 0; Py_ssize_t __pyx_bshape_0_xpointer = 0; Py_ssize_t __pyx_bshape_1_xpointer = 0; Py_buffer __pyx_bstruct_ypointer; Py_ssize_t __pyx_bstride_0_ypointer = 0; Py_ssize_t __pyx_bstride_1_ypointer = 0; Py_ssize_t __pyx_bshape_0_ypointer = 0; Py_ssize_t __pyx_bshape_1_ypointer = 0; PyObject *__pyx_r = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__frames,&__pyx_n_s__imagesize,&__pyx_n_s__model,&__pyx_n_s__costs,&__pyx_n_s__pairwisecost,&__pyx_n_s__upperthreshold,&__pyx_n_s__lowerthreshold,&__pyx_n_s__skip,&__pyx_n_s__constraints,0}; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("buildgraph"); __pyx_self = __pyx_self; { PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; switch (PyTuple_GET_SIZE(__pyx_args)) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frames); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__imagesize); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("buildgraph", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__model); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("buildgraph", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__costs); if (likely(values[3])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("buildgraph", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pairwisecost); if (likely(values[4])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("buildgraph", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__upperthreshold); if (likely(values[5])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("buildgraph", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lowerthreshold); if (likely(values[6])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("buildgraph", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__skip); if (likely(values[7])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("buildgraph", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 8: values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__constraints); if (likely(values[8])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("buildgraph", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "buildgraph")<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); values[8] = PyTuple_GET_ITEM(__pyx_args, 8); } __pyx_v_frames = values[0]; __pyx_v_imagesize = values[1]; __pyx_v_model = values[2]; __pyx_v_costs = values[3]; __pyx_v_pairwisecost = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_pairwisecost == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_upperthreshold = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_upperthreshold == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_lowerthreshold = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_lowerthreshold == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_skip = __Pyx_PyInt_AsInt(values[7]); if (unlikely((__pyx_v_skip == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_constraints = values[8]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("buildgraph", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("vision.track.dp.buildgraph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_bstruct_relevantcosts.buf = NULL; __pyx_bstruct_current.buf = NULL; __pyx_bstruct_xpointer.buf = NULL; __pyx_bstruct_ypointer.buf = NULL; /* "vision/track/dp.pyx":115 * return path * * def buildgraph(frames, imagesize, model, costs, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* double pairwisecost, double upperthreshold, * double lowerthreshold, int skip, constraints): */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6vision_5track_2dp_2buildgraph, NULL, __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__buildgraph, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
116: double pairwisecost, double upperthreshold,
117: double lowerthreshold, int skip, constraints):
118:
119: cdef double cost, wr, hr
120: cdef int width, height, usablewidth, usableheight
121: cdef numpy.ndarray[numpy.double_t, ndim=2] relevantcosts
122: cdef numpy.ndarray[numpy.double_t, ndim=2] current
123: cdef numpy.ndarray[numpy.int_t, ndim=2] xpointer, ypointer
124: cdef annotations.Box constraint
125: cdef annotations.Box start = constraints[0]
/* "vision/track/dp.pyx":125 * cdef numpy.ndarray[numpy.int_t, ndim=2] xpointer, ypointer * cdef annotations.Box constraint * cdef annotations.Box start = constraints[0] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * cdef double Huge = 1e200 */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_constraints, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6vision_11annotations_Box))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_start = ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_t_1); __pyx_t_1 = 0;
126:
127: cdef double Huge = 1e200
/* "vision/track/dp.pyx":127 * cdef annotations.Box start = constraints[0] * * cdef double Huge = 1e200 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * width, height = imagesize */ __pyx_v_Huge = 1e200;
128:
129: width, height = imagesize
/* "vision/track/dp.pyx":129 * cdef double Huge = 1e200 * * width, height = imagesize #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* wr = model.dim[0] / (<
double>start.width) * hr = model.dim[1] / (<
double>start.height) */ if ((likely(PyTuple_CheckExact(__pyx_v_imagesize))) || (PyList_CheckExact(__pyx_v_imagesize))) { PyObject* sequence = __pyx_v_imagesize; if (likely(PyTuple_CheckExact(sequence))) { if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { if (unlikely(PyList_GET_SIZE(sequence) != 2)) { if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_imagesize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_width = __pyx_t_5; __pyx_v_height = __pyx_t_6;
130: wr = model.dim[0] / (<double>start.width)
/* "vision/track/dp.pyx":130 * * width, height = imagesize * wr = model.dim[0] / (<
double>start.width) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* hr = model.dim[1] / (<
double>start.height) * usablewidth =<
int>ceil((width - start.width) /<
double>(skip)) */ __pyx_t_2 = PyObject_GetAttr(__pyx_v_model, __pyx_n_s__dim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_start), __pyx_n_s__width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_t_7)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_wr = __pyx_t_7;
131: hr = model.dim[1] / (<double>start.height)
/* "vision/track/dp.pyx":131 * width, height = imagesize * wr = model.dim[0] / (<
double>start.width) * hr = model.dim[1] / (<
double>start.height) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* usablewidth =<
int>ceil((width - start.width) /<
double>(skip)) * usableheight =<
int>ceil((height - start.height) /<
double>(skip)) */ __pyx_t_3 = PyObject_GetAttr(__pyx_v_model, __pyx_n_s__dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_start), __pyx_n_s__height); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyFloat_FromDouble(((double)__pyx_t_7)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_hr = __pyx_t_7;
132: usablewidth = <int>ceil((width - start.width) / <double>(skip))
/* "vision/track/dp.pyx":132 * wr = model.dim[0] / (<
double>start.width) * hr = model.dim[1] / (<
double>start.height) * usablewidth =<
int>ceil((width - start.width) /<
double>(skip)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* usableheight =<
int>ceil((height - start.height) /<
double>(skip)) * */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__ceil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyInt_FromLong(__pyx_v_width); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_start), __pyx_n_s__width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_v_skip)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_usablewidth = ((int)__pyx_t_6);
133: usableheight = <int>ceil((height - start.height) / <double>(skip))
/* "vision/track/dp.pyx":133 * hr = model.dim[1] / (<
double>start.height) * usablewidth =<
int>ceil((width - start.width) /<
double>(skip)) * usableheight =<
int>ceil((height - start.height) /<
double>(skip)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * graph = {} */ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ceil); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyInt_FromLong(__pyx_v_height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_start), __pyx_n_s__height); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_v_skip)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_usableheight = ((int)__pyx_t_6);
134:
135: graph = {}
/* "vision/track/dp.pyx":135 * usableheight =<
int>ceil((height - start.height) /<
double>(skip)) * * graph = {} #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * # walk along linear path */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_v_graph = __pyx_t_2; __pyx_t_2 = 0;
136:
137: # walk along linear path
138: for frame in frames:
/* "vision/track/dp.pyx":138 * * # walk along linear path * for frame in frames: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* if frame == frames[0]: * current = numpy.zeros((usablewidth, usableheight), */ if (PyList_CheckExact(__pyx_v_frames) || PyTuple_CheckExact(__pyx_v_frames)) { __pyx_t_2 = __pyx_v_frames; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_frames); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; } for (;;) { if (PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break; __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; } else if (PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break; __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; } else { __pyx_t_1 = __pyx_t_10(__pyx_t_2); if (unlikely(!__pyx_t_1)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF(__pyx_v_frame); __pyx_v_frame = __pyx_t_1; __pyx_t_1 = 0;
139: if frame == frames[0]:
/* "vision/track/dp.pyx":139 * # walk along linear path * for frame in frames: * if frame == frames[0]: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* current = numpy.zeros((usablewidth, usableheight), * dtype = numpy.double) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_frames, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_RichCompare(__pyx_v_frame, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_11) {
140: current = numpy.zeros((usablewidth, usableheight),
/* "vision/track/dp.pyx":140 * for frame in frames: * if frame == frames[0]: * current = numpy.zeros((usablewidth, usableheight), #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* dtype = numpy.double) * xpointer = None */ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyInt_FromLong(__pyx_v_usablewidth); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PyInt_FromLong(__pyx_v_usableheight); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_12)); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_3 = 0; __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_12)); __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_12));
141: dtype = numpy.double)
/* "vision/track/dp.pyx":141 * if frame == frames[0]: * current = numpy.zeros((usablewidth, usableheight), * dtype = numpy.double) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* xpointer = None * ypointer = None */ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__dtype), __pyx_t_13)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = ((PyArrayObject *)__pyx_t_13); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_current); __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_current, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); if (unlikely(__pyx_t_6<
0)) { PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_current, (PyObject*)__pyx_v_current, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); __Pyx_RaiseBufferFallbackError(); } else { PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17); } } __pyx_bstride_0_current = __pyx_bstruct_current.strides[0]; __pyx_bstride_1_current = __pyx_bstruct_current.strides[1]; __pyx_bshape_0_current = __pyx_bstruct_current.shape[0]; __pyx_bshape_1_current = __pyx_bstruct_current.shape[1]; if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_14 = 0; __Pyx_XDECREF(((PyObject *)__pyx_v_current)); __pyx_v_current = ((PyArrayObject *)__pyx_t_13); __pyx_t_13 = 0;
142: xpointer = None
/* "vision/track/dp.pyx":142 * current = numpy.zeros((usablewidth, usableheight), * dtype = numpy.double) * xpointer = None #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* ypointer = None * else: */ __pyx_t_18 = ((PyArrayObject *)Py_None); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_xpointer); __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_xpointer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); if (unlikely(__pyx_t_6<
0)) { PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_xpointer, (PyObject*)__pyx_v_xpointer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15); __Pyx_RaiseBufferFallbackError(); } else { PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15); } } __pyx_bstride_0_xpointer = __pyx_bstruct_xpointer.strides[0]; __pyx_bstride_1_xpointer = __pyx_bstruct_xpointer.strides[1]; __pyx_bshape_0_xpointer = __pyx_bstruct_xpointer.shape[0]; __pyx_bshape_1_xpointer = __pyx_bstruct_xpointer.shape[1]; if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_18 = 0; __Pyx_INCREF(Py_None); __Pyx_XDECREF(((PyObject *)__pyx_v_xpointer)); __pyx_v_xpointer = ((PyArrayObject *)Py_None);
143: ypointer = None
/* "vision/track/dp.pyx":143 * dtype = numpy.double) * xpointer = None * ypointer = None #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* else: * current, xpointer, ypointer = pairwise.quadratic(current, */ __pyx_t_18 = ((PyArrayObject *)Py_None); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ypointer); __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_ypointer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); if (unlikely(__pyx_t_6<
0)) { PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_ypointer, (PyObject*)__pyx_v_ypointer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); __Pyx_RaiseBufferFallbackError(); } else { PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17); } } __pyx_bstride_0_ypointer = __pyx_bstruct_ypointer.strides[0]; __pyx_bstride_1_ypointer = __pyx_bstruct_ypointer.strides[1]; __pyx_bshape_0_ypointer = __pyx_bstruct_ypointer.shape[0]; __pyx_bshape_1_ypointer = __pyx_bstruct_ypointer.shape[1]; if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_18 = 0; __Pyx_INCREF(Py_None); __Pyx_XDECREF(((PyObject *)__pyx_v_ypointer)); __pyx_v_ypointer = ((PyArrayObject *)Py_None); goto __pyx_L10; } /*else*/ {
144: else:
145: current, xpointer, ypointer = pairwise.quadratic(current,
/* "vision/track/dp.pyx":145 * ypointer = None * else: * current, xpointer, ypointer = pairwise.quadratic(current, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* pairwisecost) * */ __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__pairwise); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __pyx_t_12 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__quadratic); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_v_current)) { __Pyx_RaiseUnboundLocalError("current"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "vision/track/dp.pyx":145 * ypointer = None * else: * current, xpointer, ypointer = pairwise.quadratic(current, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* pairwisecost) * */ if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_current); __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_current, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); if (unlikely(__pyx_t_6<
0)) { PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_current, (PyObject*)__pyx_v_current, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15); __Pyx_RaiseBufferFallbackError(); } else { PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15); } } __pyx_bstride_0_current = __pyx_bstruct_current.strides[0]; __pyx_bstride_1_current = __pyx_bstruct_current.strides[1]; __pyx_bshape_0_current = __pyx_bstruct_current.shape[0]; __pyx_bshape_1_current = __pyx_bstruct_current.shape[1]; if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_current)); __pyx_v_current = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; __pyx_t_18 = ((PyArrayObject *)__pyx_t_12); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_xpointer); __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_xpointer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); if (unlikely(__pyx_t_6<
0)) { PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_xpointer, (PyObject*)__pyx_v_xpointer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); __Pyx_RaiseBufferFallbackError(); } else { PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17); } } __pyx_bstride_0_xpointer = __pyx_bstruct_xpointer.strides[0]; __pyx_bstride_1_xpointer = __pyx_bstruct_xpointer.strides[1]; __pyx_bshape_0_xpointer = __pyx_bstruct_xpointer.shape[0]; __pyx_bshape_1_xpointer = __pyx_bstruct_xpointer.shape[1]; if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_18 = 0; __Pyx_XDECREF(((PyObject *)__pyx_v_xpointer)); __pyx_v_xpointer = ((PyArrayObject *)__pyx_t_12); __pyx_t_12 = 0; __pyx_t_18 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ypointer); __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_ypointer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); if (unlikely(__pyx_t_6<
0)) { PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_ypointer, (PyObject*)__pyx_v_ypointer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15); __Pyx_RaiseBufferFallbackError(); } else { PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15); } } __pyx_bstride_0_ypointer = __pyx_bstruct_ypointer.strides[0]; __pyx_bstride_1_ypointer = __pyx_bstruct_ypointer.strides[1]; __pyx_bshape_0_ypointer = __pyx_bstruct_ypointer.shape[0]; __pyx_bshape_1_ypointer = __pyx_bstruct_ypointer.shape[1]; if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_18 = 0; __Pyx_XDECREF(((PyObject *)__pyx_v_ypointer)); __pyx_v_ypointer = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; } __pyx_L10:;
146: pairwisecost)
__pyx_t_13 = PyFloat_FromDouble(__pyx_v_pairwisecost); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "vision/track/dp.pyx":146 * else: * current, xpointer, ypointer = pairwise.quadratic(current, * pairwisecost) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * for constraint in constraints: */ __Pyx_GOTREF(__pyx_t_13); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); __Pyx_INCREF(((PyObject *)__pyx_v_current)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_current)); __Pyx_GIVEREF(((PyObject *)__pyx_v_current)); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_13))) || (PyList_CheckExact(__pyx_t_13))) { PyObject* sequence = __pyx_t_13; if (likely(PyTuple_CheckExact(sequence))) { if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); } else { if (unlikely(PyList_GET_SIZE(sequence) != 3)) { if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_8 = PyList_GET_ITEM(sequence, 0); __pyx_t_12 = PyList_GET_ITEM(sequence, 1); __pyx_t_1 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_8 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_8)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_12 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_12)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); index = 2; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 3)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L12_unpacking_done; __pyx_L11_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L12_unpacking_done:; }
147:
148: for constraint in constraints:
/* "vision/track/dp.pyx":148 * pairwisecost) * * for constraint in constraints: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* if constraint.frame == frame: * current = numpy.ones((usablewidth, usableheight), */ if (PyList_CheckExact(__pyx_v_constraints) || PyTuple_CheckExact(__pyx_v_constraints)) { __pyx_t_13 = __pyx_v_constraints; __Pyx_INCREF(__pyx_t_13); __pyx_t_19 = 0; __pyx_t_20 = NULL; } else { __pyx_t_19 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_v_constraints); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __pyx_t_20 = Py_TYPE(__pyx_t_13)->tp_iternext; } for (;;) { if (PyList_CheckExact(__pyx_t_13)) { if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_13)) break; __pyx_t_1 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_19); __Pyx_INCREF(__pyx_t_1); __pyx_t_19++; } else if (PyTuple_CheckExact(__pyx_t_13)) { if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_13)) break; __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_19); __Pyx_INCREF(__pyx_t_1); __pyx_t_19++; } else { __pyx_t_1 = __pyx_t_20(__pyx_t_13); if (unlikely(!__pyx_t_1)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6vision_11annotations_Box))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF(((PyObject *)__pyx_v_constraint)); __pyx_v_constraint = ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_t_1); __pyx_t_1 = 0;
149: if constraint.frame == frame:
/* "vision/track/dp.pyx":149 * * for constraint in constraints: * if constraint.frame == frame: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* current = numpy.ones((usablewidth, usableheight), * dtype = numpy.double) */ __pyx_t_1 = PyInt_FromLong(__pyx_v_constraint->frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = PyObject_RichCompare(__pyx_t_1, __pyx_v_frame, Py_EQ); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_11<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_11) {
150: current = numpy.ones((usablewidth, usableheight),
/* "vision/track/dp.pyx":150 * for constraint in constraints: * if constraint.frame == frame: * current = numpy.ones((usablewidth, usableheight), #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* dtype = numpy.double) * current = current * Huge */ __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_1 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__ones); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyInt_FromLong(__pyx_v_usablewidth); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_8 = PyInt_FromLong(__pyx_v_usableheight); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_12 = 0; __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3));
151: dtype = numpy.double)
/* "vision/track/dp.pyx":151 * if constraint.frame == frame: * current = numpy.ones((usablewidth, usableheight), * dtype = numpy.double) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* current = current * Huge * #print "image", width, height */ __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_21 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__double); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_21)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __pyx_t_21 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (!(likely(((__pyx_t_21) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_21, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = ((PyArrayObject *)__pyx_t_21); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_current); __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_current, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); if (unlikely(__pyx_t_6<
0)) { PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_current, (PyObject*)__pyx_v_current, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); __Pyx_RaiseBufferFallbackError(); } else { PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17); } } __pyx_bstride_0_current = __pyx_bstruct_current.strides[0]; __pyx_bstride_1_current = __pyx_bstruct_current.strides[1]; __pyx_bshape_0_current = __pyx_bstruct_current.shape[0]; __pyx_bshape_1_current = __pyx_bstruct_current.shape[1]; if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_current)); __pyx_v_current = ((PyArrayObject *)__pyx_t_21); __pyx_t_21 = 0;
152: current = current * Huge
/* "vision/track/dp.pyx":152 * current = numpy.ones((usablewidth, usableheight), * dtype = numpy.double) * current = current * Huge #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* #print "image", width, height * #print "usable", usablewidth, usableheight */ __pyx_t_21 = PyFloat_FromDouble(__pyx_v_Huge); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_21); __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_current), __pyx_t_21); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_current); __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_current, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); if (unlikely(__pyx_t_6<
0)) { PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_current, (PyObject*)__pyx_v_current, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15); __Pyx_RaiseBufferFallbackError(); } else { PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15); } } __pyx_bstride_0_current = __pyx_bstruct_current.strides[0]; __pyx_bstride_1_current = __pyx_bstruct_current.strides[1]; __pyx_bshape_0_current = __pyx_bstruct_current.shape[0]; __pyx_bshape_1_current = __pyx_bstruct_current.shape[1]; if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_current)); __pyx_v_current = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0;
153: #print "image", width, height
154: #print "usable", usablewidth, usableheight
155: #print "constraint", constraint.xtl, constraint.ytl, constraint
156: #print "start", start.width, start.height, str(start)
157: #print "ratio", wr, hr
158: #print "skip", skip
159: current[constraint.xtl // skip, constraint.ytl // skip] = 0
/* "vision/track/dp.pyx":159 * #print "ratio", wr, hr * #print "skip", skip * current[constraint.xtl // skip, constraint.ytl // skip] = 0 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* break * else: */ __pyx_t_6 = (__pyx_v_constraint->xtl / __pyx_v_skip); __pyx_t_5 = (__pyx_v_constraint->ytl / __pyx_v_skip); if (__pyx_t_6<
0) __pyx_t_6 += __pyx_bshape_0_current; if (__pyx_t_5<
0) __pyx_t_5 += __pyx_bshape_1_current; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_current.buf, __pyx_t_6, __pyx_bstride_0_current, __pyx_t_5, __pyx_bstride_1_current) = 0.0;
160: break
/* "vision/track/dp.pyx":160 * #print "skip", skip * current[constraint.xtl // skip, constraint.ytl // skip] = 0 * break #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* else: * relevantcosts = costs[frame] */ goto __pyx_L14_break; goto __pyx_L15; } __pyx_L15:; } /*else*/ {
161: else:
162: relevantcosts = costs[frame]
/* "vision/track/dp.pyx":162 * break * else: * relevantcosts = costs[frame] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * for x in range(0, usablewidth): */ __pyx_t_3 = PyObject_GetItem(__pyx_v_costs, __pyx_v_frame); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_22 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_relevantcosts); __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_relevantcosts, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); if (unlikely(__pyx_t_23<
0)) { PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_relevantcosts, (PyObject*)__pyx_v_relevantcosts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17); __Pyx_RaiseBufferFallbackError(); } else { PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17); } } __pyx_bstride_0_relevantcosts = __pyx_bstruct_relevantcosts.strides[0]; __pyx_bstride_1_relevantcosts = __pyx_bstruct_relevantcosts.strides[1]; __pyx_bshape_0_relevantcosts = __pyx_bstruct_relevantcosts.shape[0]; __pyx_bshape_1_relevantcosts = __pyx_bstruct_relevantcosts.shape[1]; if (unlikely(__pyx_t_23<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_22 = 0; __Pyx_XDECREF(((PyObject *)__pyx_v_relevantcosts)); __pyx_v_relevantcosts = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0;
163:
164: for x in range(0, usablewidth):
/* "vision/track/dp.pyx":164 * relevantcosts = costs[frame] * * for x in range(0, usablewidth): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* for y in range(0, usableheight): * cost = relevantcosts[<
int>(x*wr*skip),<
int>(y*hr*skip)] */ __pyx_t_23 = __pyx_v_usablewidth; for (__pyx_t_24 = 0; __pyx_t_24<
__pyx_t_23; __pyx_t_24+=1) { __pyx_v_x = __pyx_t_24;
165: for y in range(0, usableheight):
/* "vision/track/dp.pyx":165 * * for x in range(0, usablewidth): * for y in range(0, usableheight): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cost = relevantcosts[<
int>(x*wr*skip),<
int>(y*hr*skip)] * cost = min(cost, upperthreshold) */ __pyx_t_25 = __pyx_v_usableheight; for (__pyx_t_26 = 0; __pyx_t_26<
__pyx_t_25; __pyx_t_26+=1) { __pyx_v_y = __pyx_t_26;
166: cost = relevantcosts[<int>(x*wr*skip), <int>(y*hr*skip)]
/* "vision/track/dp.pyx":166 * for x in range(0, usablewidth): * for y in range(0, usableheight): * cost = relevantcosts[<
int>(x*wr*skip),<
int>(y*hr*skip)] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cost = min(cost, upperthreshold) * cost = max(cost, lowerthreshold) */ __pyx_t_27 = ((int)((__pyx_v_x * __pyx_v_wr) * __pyx_v_skip)); __pyx_t_28 = ((int)((__pyx_v_y * __pyx_v_hr) * __pyx_v_skip)); if (__pyx_t_27<
0) __pyx_t_27 += __pyx_bshape_0_relevantcosts; if (__pyx_t_28<
0) __pyx_t_28 += __pyx_bshape_1_relevantcosts; __pyx_v_cost = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_relevantcosts.buf, __pyx_t_27, __pyx_bstride_0_relevantcosts, __pyx_t_28, __pyx_bstride_1_relevantcosts));
167: cost = min(cost, upperthreshold)
/* "vision/track/dp.pyx":167 * for y in range(0, usableheight): * cost = relevantcosts[<
int>(x*wr*skip),<
int>(y*hr*skip)] * cost = min(cost, upperthreshold) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cost = max(cost, lowerthreshold) * current[x, y] += cost */ __pyx_t_7 = __pyx_v_upperthreshold; __pyx_t_29 = __pyx_v_cost; if ((__pyx_t_7<
__pyx_t_29)) { __pyx_t_30 = __pyx_t_7; } else { __pyx_t_30 = __pyx_t_29; } __pyx_v_cost = __pyx_t_30;
168: cost = max(cost, lowerthreshold)
/* "vision/track/dp.pyx":168 * cost = relevantcosts[<
int>(x*wr*skip),<
int>(y*hr*skip)] * cost = min(cost, upperthreshold) * cost = max(cost, lowerthreshold) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* current[x, y] += cost * */ __pyx_t_30 = __pyx_v_lowerthreshold; __pyx_t_7 = __pyx_v_cost; if ((__pyx_t_30 > __pyx_t_7)) { __pyx_t_29 = __pyx_t_30; } else { __pyx_t_29 = __pyx_t_7; } __pyx_v_cost = __pyx_t_29;
169: current[x, y] += cost
/* "vision/track/dp.pyx":169 * cost = min(cost, upperthreshold) * cost = max(cost, lowerthreshold) * current[x, y] += cost #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * graph[frame] = current, xpointer, ypointer */ __pyx_t_31 = __pyx_v_x; __pyx_t_32 = __pyx_v_y; if (__pyx_t_31<
0) __pyx_t_31 += __pyx_bshape_0_current; if (__pyx_t_32<
0) __pyx_t_32 += __pyx_bshape_1_current; *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_current.buf, __pyx_t_31, __pyx_bstride_0_current, __pyx_t_32, __pyx_bstride_1_current) += __pyx_v_cost; } } } __pyx_L14_break:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
170:
171: graph[frame] = current, xpointer, ypointer
/* "vision/track/dp.pyx":171 * current[x, y] += cost * * graph[frame] = current, xpointer, ypointer #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return graph * */ __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_13)); __Pyx_INCREF(((PyObject *)__pyx_v_current)); PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_current)); __Pyx_GIVEREF(((PyObject *)__pyx_v_current)); __Pyx_INCREF(((PyObject *)__pyx_v_xpointer)); PyTuple_SET_ITEM(__pyx_t_13, 1, ((PyObject *)__pyx_v_xpointer)); __Pyx_GIVEREF(((PyObject *)__pyx_v_xpointer)); __Pyx_INCREF(((PyObject *)__pyx_v_ypointer)); PyTuple_SET_ITEM(__pyx_t_13, 2, ((PyObject *)__pyx_v_ypointer)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ypointer)); if (PyDict_SetItem(((PyObject *)__pyx_v_graph), __pyx_v_frame, ((PyObject *)__pyx_t_13))<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
172: return graph
/* "vision/track/dp.pyx":172 * * graph[frame] = current, xpointer, ypointer * return graph #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def scoreframe(workorder): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_graph)); __pyx_r = ((PyObject *)__pyx_v_graph); goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_21); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_current); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_relevantcosts); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_xpointer); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ypointer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} __Pyx_AddTraceback("vision.track.dp.buildgraph", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_current); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_relevantcosts); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_xpointer); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ypointer); __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_relevantcosts); __Pyx_XDECREF((PyObject *)__pyx_v_current); __Pyx_XDECREF((PyObject *)__pyx_v_xpointer); __Pyx_XDECREF((PyObject *)__pyx_v_ypointer); __Pyx_XDECREF((PyObject *)__pyx_v_constraint); __Pyx_XDECREF((PyObject *)__pyx_v_start); __Pyx_XDECREF(__pyx_v_graph); __Pyx_XDECREF(__pyx_v_frame); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
173:
174: def scoreframe(workorder):
/* "vision/track/dp.pyx":174 * return graph * * def scoreframe(workorder): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Convolves a learned weight vector against an image. This method */ static PyObject *__pyx_pf_6vision_5track_2dp_3scoreframe(PyObject *__pyx_self, PyObject *__pyx_v_workorder); /*proto*/ static char __pyx_doc_6vision_5track_2dp_3scoreframe[] = "scoreframe(workorder)\n\n Convolves a learned weight vector against an image. This method\n should take a workorder tuple because it can be used in multiprocessing.\n "; static PyMethodDef __pyx_mdef_6vision_5track_2dp_3scoreframe = {__Pyx_NAMESTR("scoreframe"), (PyCFunction)__pyx_pf_6vision_5track_2dp_3scoreframe, METH_O, __Pyx_DOCSTR(__pyx_doc_6vision_5track_2dp_3scoreframe)}; static PyObject *__pyx_pf_6vision_5track_2dp_3scoreframe(PyObject *__pyx_self, PyObject *__pyx_v_workorder) { PyObject *__pyx_v_images = NULL; PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_frame = NULL; PyObject *__pyx_v_model = NULL; PyObject *__pyx_v_image = NULL; PyObject *__pyx_v_width = NULL; PyObject *__pyx_v_height = NULL; PyObject *__pyx_v_wr = NULL; PyObject *__pyx_v_hr = NULL; PyObject *__pyx_v_rimage = NULL; PyObject *__pyx_v_cost = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scoreframe"); __pyx_self = __pyx_self; /* "vision/track/dp.pyx":174 * return graph * * def scoreframe(workorder): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Convolves a learned weight vector against an image. This method */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6vision_5track_2dp_3scoreframe, NULL, __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__scoreframe, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
175: """
176: Convolves a learned weight vector against an image. This method
177: should take a workorder tuple because it can be used in multiprocessing.
178: """
179: images, start, frame, model = workorder
/* "vision/track/dp.pyx":179 * should take a workorder tuple because it can be used in multiprocessing. * """ * images, start, frame, model = workorder #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * logger.debug("Scoring frame {0}".format(frame)) */ if ((likely(PyTuple_CheckExact(__pyx_v_workorder))) || (PyList_CheckExact(__pyx_v_workorder))) { PyObject* sequence = __pyx_v_workorder; if (likely(PyTuple_CheckExact(sequence))) { if (unlikely(PyTuple_GET_SIZE(sequence) != 4)) { if (PyTuple_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); } else { if (unlikely(PyList_GET_SIZE(sequence) != 4)) { if (PyList_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_4 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_workorder); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 3; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 4)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __pyx_v_images = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_start = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_frame = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_model = __pyx_t_4; __pyx_t_4 = 0;
180:
181: logger.debug("Scoring frame {0}".format(frame))
/* "vision/track/dp.pyx":181 * images, start, frame, model = workorder * * logger.debug("Scoring frame {0}".format(frame)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * # resize image to so box has 'dim' in the resized space */ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__debug); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_10), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_frame); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_frame); __Pyx_GIVEREF(__pyx_v_frame); __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
182:
183: # resize image to so box has 'dim' in the resized space
184: image = images[frame]
/* "vision/track/dp.pyx":184 * * # resize image to so box has 'dim' in the resized space * image = images[frame] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* width, height = image.size * wr = model.dim[0] /<
double>(start.width) */ __pyx_t_1 = PyObject_GetItem(__pyx_v_images, __pyx_v_frame); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_image = __pyx_t_1; __pyx_t_1 = 0;
185: width, height = image.size
/* "vision/track/dp.pyx":185 * # resize image to so box has 'dim' in the resized space * image = images[frame] * width, height = image.size #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* wr = model.dim[0] /<
double>(start.width) * hr = model.dim[1] /<
double>(start.height) */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_image, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; if (likely(PyTuple_CheckExact(sequence))) { if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { if (unlikely(PyList_GET_SIZE(sequence) != 2)) { if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 2)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __pyx_v_width = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_height = __pyx_t_3; __pyx_t_3 = 0;
186: wr = model.dim[0] / <double>(start.width)
/* "vision/track/dp.pyx":186 * image = images[frame] * width, height = image.size * wr = model.dim[0] /<
double>(start.width) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* hr = model.dim[1] /<
double>(start.height) * rimage = image.resize((int(ceil(width * wr)), int(ceil(height * hr))), 2) */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_model, __pyx_n_s__dim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_t_7)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_wr = __pyx_t_2; __pyx_t_2 = 0;
187: hr = model.dim[1] / <double>(start.height)
/* "vision/track/dp.pyx":187 * width, height = image.size * wr = model.dim[0] /<
double>(start.width) * hr = model.dim[1] /<
double>(start.height) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* rimage = image.resize((int(ceil(width * wr)), int(ceil(height * hr))), 2) * */ __pyx_t_2 = PyObject_GetAttr(__pyx_v_model, __pyx_n_s__dim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_v_start, __pyx_n_s__height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_t_7)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_hr = __pyx_t_3; __pyx_t_3 = 0;
188: rimage = image.resize((int(ceil(width * wr)), int(ceil(height * hr))), 2)
/* "vision/track/dp.pyx":188 * wr = model.dim[0] /<
double>(start.width) * hr = model.dim[1] /<
double>(start.height) * rimage = image.resize((int(ceil(width * wr)), int(ceil(height * hr))), 2) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * cost = convolution.hogrgbmean(rimage, model.dim, */ __pyx_t_3 = PyObject_GetAttr(__pyx_v_image, __pyx_n_s__resize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ceil); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Multiply(__pyx_v_width, __pyx_v_wr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ceil); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyNumber_Multiply(__pyx_v_height, __pyx_v_hr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_5)); __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); __Pyx_INCREF(__pyx_int_2); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); __pyx_t_5 = 0; __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_rimage = __pyx_t_5; __pyx_t_5 = 0;
189:
190: cost = convolution.hogrgbmean(rimage, model.dim,
/* "vision/track/dp.pyx":190 * rimage = image.resize((int(ceil(width * wr)), int(ceil(height * hr))), 2) * * cost = convolution.hogrgbmean(rimage, model.dim, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* model.hogweights(), * model.rgbweights(), */ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__convolution); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__hogrgbmean); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_GetAttr(__pyx_v_model, __pyx_n_s__dim); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); /* "vision/track/dp.pyx":190 * rimage = image.resize((int(ceil(width * wr)), int(ceil(height * hr))), 2) * * cost = convolution.hogrgbmean(rimage, model.dim, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* model.hogweights(), * model.rgbweights(), */ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4));
191: model.hogweights(),
/* "vision/track/dp.pyx":191 * * cost = convolution.hogrgbmean(rimage, model.dim, * model.hogweights(), #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* model.rgbweights(), * # rgbbin = model.rgbbin, */ __pyx_t_3 = PyObject_GetAttr(__pyx_v_model, __pyx_n_s__hogweights); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
192: model.rgbweights(),
/* "vision/track/dp.pyx":192 * cost = convolution.hogrgbmean(rimage, model.dim, * model.hogweights(), * model.rgbweights(), #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* # rgbbin = model.rgbbin, * hogbin = model.hogbin) */ __pyx_t_3 = PyObject_GetAttr(__pyx_v_model, __pyx_n_s__rgbweights); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(__pyx_v_rimage); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_rimage); __Pyx_GIVEREF(__pyx_v_rimage); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0;
193: # rgbbin = model.rgbbin,
194: hogbin = model.hogbin)
/* "vision/track/dp.pyx":194 * model.rgbweights(), * # rgbbin = model.rgbbin, * hogbin = model.hogbin) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * if debug: */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_model, __pyx_n_s__hogbin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__hogbin), __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_v_cost = __pyx_t_1; __pyx_t_1 = 0;
195:
196: if debug:
/* "vision/track/dp.pyx":196 * hogbin = model.hogbin) * * if debug: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* pylab.set_cmap("gray") * pylab.title("min = {0}, max = {1}".format(cost.min(), cost.max())) */ if (__pyx_v_6vision_5track_2dp_debug) {
197: pylab.set_cmap("gray")
/* "vision/track/dp.pyx":197 * * if debug: * pylab.set_cmap("gray") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* pylab.title("min = {0}, max = {1}".format(cost.min(), cost.max())) * pylab.imshow(cost.transpose()) */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pylab); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__set_cmap); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "vision/track/dp.pyx":197 * * if debug: * pylab.set_cmap("gray") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* pylab.title("min = {0}, max = {1}".format(cost.min(), cost.max())) * pylab.imshow(cost.transpose()) */ __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_11)); __Pyx_INCREF(((PyObject *)__pyx_n_s__gray)); PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_n_s__gray)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__gray)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));
198: pylab.title("min = {0}, max = {1}".format(cost.min(), cost.max()))
/* "vision/track/dp.pyx":198 * if debug: * pylab.set_cmap("gray") * pylab.title("min = {0}, max = {1}".format(cost.min(), cost.max())) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* pylab.imshow(cost.transpose()) * pylab.savefig("tmp/cost{0}.png".format(frame)) */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pylab); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__title); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_12), __pyx_n_s__format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_GetAttr(__pyx_v_cost, __pyx_n_s__min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_GetAttr(__pyx_v_cost, __pyx_n_s__max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
199: pylab.imshow(cost.transpose())
/* "vision/track/dp.pyx":199 * pylab.set_cmap("gray") * pylab.title("min = {0}, max = {1}".format(cost.min(), cost.max())) * pylab.imshow(cost.transpose()) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* pylab.savefig("tmp/cost{0}.png".format(frame)) * pylab.clf() */ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__pylab); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__imshow); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_GetAttr(__pyx_v_cost, __pyx_n_s__transpose); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
200: pylab.savefig("tmp/cost{0}.png".format(frame))
/* "vision/track/dp.pyx":200 * pylab.title("min = {0}, max = {1}".format(cost.min(), cost.max())) * pylab.imshow(cost.transpose()) * pylab.savefig("tmp/cost{0}.png".format(frame)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* pylab.clf() * */ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__pylab); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__savefig); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_13), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(__pyx_v_frame); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_frame); __Pyx_GIVEREF(__pyx_v_frame); __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
201: pylab.clf()
/* "vision/track/dp.pyx":201 * pylab.imshow(cost.transpose()) * pylab.savefig("tmp/cost{0}.png".format(frame)) * pylab.clf() #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * return frame, cost */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pylab); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__clf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L9; } __pyx_L9:;
202:
203: return frame, cost
/* "vision/track/dp.pyx":203 * pylab.clf() * * return frame, cost #<
<
<
<
<
<
<
<
<
<
<
<
<
<
*/ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_frame); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_frame); __Pyx_GIVEREF(__pyx_v_frame); __Pyx_INCREF(__pyx_v_cost); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_cost); __Pyx_GIVEREF(__pyx_v_cost); __pyx_r = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("vision.track.dp.scoreframe", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_images); __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_frame); __Pyx_XDECREF(__pyx_v_model); __Pyx_XDECREF(__pyx_v_image); __Pyx_XDECREF(__pyx_v_width); __Pyx_XDECREF(__pyx_v_height); __Pyx_XDECREF(__pyx_v_wr); __Pyx_XDECREF(__pyx_v_hr); __Pyx_XDECREF(__pyx_v_rimage); __Pyx_XDECREF(__pyx_v_cost); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }