Generated by Cython 0.15.1 on Tue Jan 31 14:40:01 2012
Raw output: annotations.c
1: import math
/* "vision/annotations.pyx":1 * import math #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* import numpy * import re */ __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__math), 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__math, __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/annotations.pyx":1 * import math #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* import numpy * import re */ __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: import numpy
/* "vision/annotations.pyx":2 * import math * import numpy #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* import re * import Image */ __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); 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__numpy, __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;
3: import re
/* "vision/annotations.pyx":3 * import math * import numpy * import re #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* import Image * */ __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__re), 0, -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); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__re, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4: import Image
/* "vision/annotations.pyx":4 * import numpy * import re * import Image #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * cimport numpy */ __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__Image), 0, -1); 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__Image, __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;
5:
6: cimport numpy
7: cimport cython
8:
9: cdef extern from "math.h":
10: double sqrt(double i)
11:
12: cdef class Box(object):
13: """
14: A unlabeled bounding box not bound to a frame.
15: """
16: @cython.profile(False)
17: def __init__(self, int xtl, int ytl, int xbr, int ybr,
/* "vision/annotations.pyx":17 * """ * @cython.profile(False) * def __init__(self, int xtl, int ytl, int xbr, int ybr, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* int frame = 0, int lost = 0, int occluded = 0, * int generated = 0, attributes = None): */ static int __pyx_pf_6vision_11annotations_3Box___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box___init__[] = "\n Initializes the bounding box.\n "; struct wrapperbase __pyx_wrapperbase_6vision_11annotations_3Box___init__; static int __pyx_pf_6vision_11annotations_3Box___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_xtl; int __pyx_v_ytl; int __pyx_v_xbr; int __pyx_v_ybr; int __pyx_v_frame; int __pyx_v_lost; int __pyx_v_occluded; int __pyx_v_generated; PyObject *__pyx_v_attributes = 0; int __pyx_r; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__xtl,&__pyx_n_s__ytl,&__pyx_n_s__xbr,&__pyx_n_s__ybr,&__pyx_n_s__frame,&__pyx_n_s__lost,&__pyx_n_s__occluded,&__pyx_n_s__generated,&__pyx_n_s__attributes,0}; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__"); { PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
18: int frame = 0, int lost = 0, int occluded = 0,
19: int generated = 0, attributes = None):
/* "vision/annotations.pyx":19 * def __init__(self, int xtl, int ytl, int xbr, int ybr, * int frame = 0, int lost = 0, int occluded = 0, * int generated = 0, attributes = None): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Initializes the bounding box. */ 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__xtl); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ytl); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xbr); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ybr); if (likely(values[3])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frame); if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lost); if (value) { values[5] = value; kw_args--; } } case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__occluded); if (value) { values[6] = value; kw_args--; } } case 7: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__generated); if (value) { values[7] = value; kw_args--; } } case 8: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__attributes); 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), "__init__")<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __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_xtl = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_xtl == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_ytl = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_ytl == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_xbr = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_xbr == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_ybr = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_ybr == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} if (values[4]) { __pyx_v_frame = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_frame == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_frame = ((int)0); } if (values[5]) { __pyx_v_lost = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_lost == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_lost = ((int)0); } if (values[6]) { __pyx_v_occluded = __Pyx_PyInt_AsInt(values[6]); if (unlikely((__pyx_v_occluded == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_occluded = ((int)0); } if (values[7]) { __pyx_v_generated = __Pyx_PyInt_AsInt(values[7]); if (unlikely((__pyx_v_generated == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_generated = ((int)0); } __pyx_v_attributes = values[8]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("vision.annotations.Box.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __Pyx_INCREF(__pyx_v_attributes);
20: """
21: Initializes the bounding box.
22: """
23: if xbr <= xtl:
/* "vision/annotations.pyx":23 * Initializes the bounding box. * """ * if xbr<
= xtl: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* raise TypeError("xbr must be > xtl") * elif ybr<
= ytl: */ __pyx_t_1 = (__pyx_v_xbr<
= __pyx_v_xtl); if (__pyx_t_1) {
24: raise TypeError("xbr must be > xtl")
/* "vision/annotations.pyx":24 * """ * if xbr<
= xtl: * raise TypeError("xbr must be > xtl") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif ybr<
= ytl: * raise TypeError("ybr must be > ytl") */ __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } /* "vision/annotations.pyx":24 * """ * if xbr<
= xtl: * raise TypeError("xbr must be > xtl") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif ybr<
= ytl: * raise TypeError("ybr must be > ytl") */ __pyx_k_tuple_2 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_2)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_kp_s_1)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
25: elif ybr <= ytl:
/* "vision/annotations.pyx":25 * if xbr<
= xtl: * raise TypeError("xbr must be > xtl") * elif ybr<
= ytl: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* raise TypeError("ybr must be > ytl") * elif xtl<
0: */ __pyx_t_1 = (__pyx_v_ybr<
= __pyx_v_ytl); if (__pyx_t_1) {
26: raise TypeError("ybr must be > ytl")
/* "vision/annotations.pyx":26 * raise TypeError("xbr must be > xtl") * elif ybr<
= ytl: * raise TypeError("ybr must be > ytl") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif xtl<
0: * raise TypeError("xtl must be nonnegative") */ __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } /* "vision/annotations.pyx":26 * raise TypeError("xbr must be > xtl") * elif ybr<
= ytl: * raise TypeError("ybr must be > ytl") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif xtl<
0: * raise TypeError("xtl must be nonnegative") */ __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_4)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_kp_s_3)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));
27: elif xtl < 0:
/* "vision/annotations.pyx":27 * elif ybr<
= ytl: * raise TypeError("ybr must be > ytl") * elif xtl<
0: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* raise TypeError("xtl must be nonnegative") * elif ytl<
0: */ __pyx_t_1 = (__pyx_v_xtl<
0); if (__pyx_t_1) {
28: raise TypeError("xtl must be nonnegative")
/* "vision/annotations.pyx":28 * raise TypeError("ybr must be > ytl") * elif xtl<
0: * raise TypeError("xtl must be nonnegative") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif ytl<
0: * raise TypeError("ytl must be nonnegative") */ __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } /* "vision/annotations.pyx":28 * raise TypeError("ybr must be > ytl") * elif xtl<
0: * raise TypeError("xtl must be nonnegative") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif ytl<
0: * raise TypeError("ytl must be nonnegative") */ __pyx_k_tuple_6 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __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));
29: elif ytl < 0:
/* "vision/annotations.pyx":29 * elif xtl<
0: * raise TypeError("xtl must be nonnegative") * elif ytl<
0: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* raise TypeError("ytl must be nonnegative") * */ __pyx_t_1 = (__pyx_v_ytl<
0); if (__pyx_t_1) {
30: raise TypeError("ytl must be nonnegative")
/* "vision/annotations.pyx":30 * raise TypeError("xtl must be nonnegative") * elif ytl<
0: * raise TypeError("ytl must be nonnegative") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * self.xtl = xtl */ __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; /* "vision/annotations.pyx":30 * raise TypeError("xtl must be nonnegative") * elif ytl<
0: * raise TypeError("ytl must be nonnegative") #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * self.xtl = xtl */ __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __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));
31:
32: self.xtl = xtl
/* "vision/annotations.pyx":32 * raise TypeError("ytl must be nonnegative") * * self.xtl = xtl #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.ytl = ytl * self.xbr = xbr */ ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl = __pyx_v_xtl;
33: self.ytl = ytl
/* "vision/annotations.pyx":33 * * self.xtl = xtl * self.ytl = ytl #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.xbr = xbr * self.ybr = ybr */ ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl = __pyx_v_ytl;
34: self.xbr = xbr
/* "vision/annotations.pyx":34 * self.xtl = xtl * self.ytl = ytl * self.xbr = xbr #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.ybr = ybr * self.frame = frame */ ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xbr = __pyx_v_xbr;
35: self.ybr = ybr
/* "vision/annotations.pyx":35 * self.ytl = ytl * self.xbr = xbr * self.ybr = ybr #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.frame = frame * self.lost = lost */ ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ybr = __pyx_v_ybr;
36: self.frame = frame
/* "vision/annotations.pyx":36 * self.xbr = xbr * self.ybr = ybr * self.frame = frame #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.lost = lost * self.occluded = occluded */ ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->frame = __pyx_v_frame;
37: self.lost = lost
/* "vision/annotations.pyx":37 * self.ybr = ybr * self.frame = frame * self.lost = lost #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.occluded = occluded * self.generated = generated */ ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->lost = __pyx_v_lost;
38: self.occluded = occluded
/* "vision/annotations.pyx":38 * self.frame = frame * self.lost = lost * self.occluded = occluded #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.generated = generated * */ ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->occluded = __pyx_v_occluded;
39: self.generated = generated
/* "vision/annotations.pyx":39 * self.lost = lost * self.occluded = occluded * self.generated = generated #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * if attributes is None: */ ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->generated = __pyx_v_generated;
40:
41: if attributes is None:
/* "vision/annotations.pyx":41 * self.generated = generated * * if attributes is None: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* attributes = [] * self.attributes = attributes */ __pyx_t_1 = (__pyx_v_attributes == Py_None); if (__pyx_t_1) {
42: attributes = []
/* "vision/annotations.pyx":42 * * if attributes is None: * attributes = [] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.attributes = attributes * */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_DECREF(__pyx_v_attributes); __pyx_v_attributes = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L7; } __pyx_L7:;
43: self.attributes = attributes
/* "vision/annotations.pyx":43 * if attributes is None: * attributes = [] * self.attributes = attributes #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * @property */ __Pyx_INCREF(__pyx_v_attributes); __Pyx_GIVEREF(__pyx_v_attributes); __Pyx_GOTREF(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); __Pyx_DECREF(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes = __pyx_v_attributes; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("vision.annotations.Box.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_attributes); __Pyx_RefNannyFinishContext(); return __pyx_r; }
44:
45: @property
46: def width(self):
/* "vision/annotations.pyx":46 * * @property * def width(self): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return self.xbr - self.xtl * */ static PyObject *__pyx_pf_6vision_11annotations_3Box_1width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_1width[] = "Box.width(self)"; static PyObject *__pyx_pf_6vision_11annotations_3Box_1width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("width"); /* "vision/annotations.pyx":46 * * @property * def width(self): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return self.xbr - self.xtl * */ __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_6vision_11annotations_Box, __pyx_n_s__width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __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_builtin_property, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6vision_11annotations_Box->tp_dict, __pyx_n_s__width, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6vision_11annotations_Box);
47: return self.xbr - self.xtl
/* "vision/annotations.pyx":47 * @property * def width(self): * return self.xbr - self.xtl #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromLong((((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xbr - ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl)); 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_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.annotations.Box.width", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
48:
49: @property
50: def height(self):
/* "vision/annotations.pyx":50 * * @property * def height(self): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return self.ybr - self.ytl * */ static PyObject *__pyx_pf_6vision_11annotations_3Box_2height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_2height[] = "Box.height(self)"; static PyObject *__pyx_pf_6vision_11annotations_3Box_2height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("height"); /* "vision/annotations.pyx":50 * * @property * def height(self): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return self.ybr - self.ytl * */ __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_6vision_11annotations_Box, __pyx_n_s__height); 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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __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_builtin_property, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6vision_11annotations_Box->tp_dict, __pyx_n_s__height, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6vision_11annotations_Box);
51: return self.ybr - self.ytl
/* "vision/annotations.pyx":51 * @property * def height(self): * return self.ybr - self.ytl #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromLong((((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ybr - ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __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.annotations.Box.height", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
52:
53: @property
54: def center(self):
/* "vision/annotations.pyx":54 * * @property * def center(self): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Calculates the center of the bounding box. */ static PyObject *__pyx_pf_6vision_11annotations_3Box_3center(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_3center[] = "Box.center(self)\n\n Calculates the center of the bounding box.\n "; static PyObject *__pyx_pf_6vision_11annotations_3Box_3center(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("center"); /* "vision/annotations.pyx":54 * * @property * def center(self): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Calculates the center of the bounding box. */ __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_6vision_11annotations_Box, __pyx_n_s__center); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __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_builtin_property, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6vision_11annotations_Box->tp_dict, __pyx_n_s__center, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6vision_11annotations_Box);
55: """
56: Calculates the center of the bounding box.
57: """
58: return self.xtl+self.width/2, self.ytl+self.height/2
/* "vision/annotations.pyx":58 * Calculates the center of the bounding box. * """ * return self.xtl+self.width/2, self.ytl+self.height/2 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__height); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __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_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_r = ((PyObject *)__pyx_t_4); __pyx_t_4 = 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_AddTraceback("vision.annotations.Box.center", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
59:
60: @property
61: def area(self):
/* "vision/annotations.pyx":61 * * @property * def area(self): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return (self.xbr - self.xtl) * (self.ybr - self.ytl) * */ static PyObject *__pyx_pf_6vision_11annotations_3Box_4area(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_4area[] = "Box.area(self)"; static PyObject *__pyx_pf_6vision_11annotations_3Box_4area(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("area"); /* "vision/annotations.pyx":61 * * @property * def area(self): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return (self.xbr - self.xtl) * (self.ybr - self.ytl) * */ __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_6vision_11annotations_Box, __pyx_n_s__area); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __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_builtin_property, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6vision_11annotations_Box->tp_dict, __pyx_n_s__area, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_6vision_11annotations_Box);
62: return (self.xbr - self.xtl) * (self.ybr - self.ytl)
/* "vision/annotations.pyx":62 * @property * def area(self): * return (self.xbr - self.xtl) * (self.ybr - self.ytl) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def distance(self, oth): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromLong(((((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xbr - ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl) * (((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ybr - ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __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.annotations.Box.area", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
63:
64: def distance(self, oth):
/* "vision/annotations.pyx":64 * return (self.xbr - self.xtl) * (self.ybr - self.ytl) * * def distance(self, oth): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Calculate the Euclidean distance between boxes. */ static PyObject *__pyx_pf_6vision_11annotations_3Box_5distance(PyObject *__pyx_v_self, PyObject *__pyx_v_oth); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_5distance[] = "Box.distance(self, oth)\n\n Calculate the Euclidean distance between boxes.\n "; static PyObject *__pyx_pf_6vision_11annotations_3Box_5distance(PyObject *__pyx_v_self, PyObject *__pyx_v_oth) { PyObject *__pyx_v_scenter = NULL; PyObject *__pyx_v_ocenter = NULL; PyObject *__pyx_v_diff = NULL; PyObject *__pyx_v_sum = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("distance");
65: """
66: Calculate the Euclidean distance between boxes.
67: """
68: scenter = abs(self.xbr + self.xtl) / 2, \
/* "vision/annotations.pyx":68 * Calculate the Euclidean distance between boxes. * """ * scenter = abs(self.xbr + self.xtl) / 2, \ #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* abs(self.ybr + self.ytl) / 2 * ocenter = abs(oth.xbr + oth.xtl) / 2, \ */ __pyx_t_1 = PyInt_FromLong((((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xbr + ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
69: abs(self.ybr + self.ytl) / 2
/* "vision/annotations.pyx":69 * """ * scenter = abs(self.xbr + self.xtl) / 2, \ * abs(self.ybr + self.ytl) / 2 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* ocenter = abs(oth.xbr + oth.xtl) / 2, \ * abs(oth.ybr + oth.ytl) / 2 */ __pyx_t_2 = PyInt_FromLong((((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ybr + ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __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 = 68; __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); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_scenter = __pyx_t_3; __pyx_t_3 = 0;
70: ocenter = abs(oth.xbr + oth.xtl) / 2, \
/* "vision/annotations.pyx":70 * scenter = abs(self.xbr + self.xtl) / 2, \ * abs(self.ybr + self.ytl) / 2 * ocenter = abs(oth.xbr + oth.xtl) / 2, \ #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* abs(oth.ybr + oth.ytl) / 2 * diff = scenter[0] - ocenter[0], \ */ __pyx_t_3 = PyObject_GetAttr(__pyx_v_oth, __pyx_n_s__xbr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_GetAttr(__pyx_v_oth, __pyx_n_s__xtl); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __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_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71: abs(oth.ybr + oth.ytl) / 2
/* "vision/annotations.pyx":71 * abs(self.ybr + self.ytl) / 2 * ocenter = abs(oth.xbr + oth.xtl) / 2, \ * abs(oth.ybr + oth.ytl) / 2 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* diff = scenter[0] - ocenter[0], \ * scenter[1] - ocenter[1] */ __pyx_t_2 = PyObject_GetAttr(__pyx_v_oth, __pyx_n_s__ybr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_GetAttr(__pyx_v_oth, __pyx_n_s__ytl); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __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(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __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); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_v_ocenter = __pyx_t_3; __pyx_t_3 = 0;
72: diff = scenter[0] - ocenter[0], \
/* "vision/annotations.pyx":72 * ocenter = abs(oth.xbr + oth.xtl) / 2, \ * abs(oth.ybr + oth.ytl) / 2 * diff = scenter[0] - ocenter[0], \ #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* scenter[1] - ocenter[1] * sum = diff[0]**2 + diff[1]**2 */ __pyx_t_3 = PyNumber_Subtract(PyTuple_GET_ITEM(__pyx_v_scenter, 0), PyTuple_GET_ITEM(__pyx_v_ocenter, 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3);
73: scenter[1] - ocenter[1]
/* "vision/annotations.pyx":73 * abs(oth.ybr + oth.ytl) / 2 * diff = scenter[0] - ocenter[0], \ * scenter[1] - ocenter[1] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* sum = diff[0]**2 + diff[1]**2 * return math.sqrt(sum) */ __pyx_t_4 = PyNumber_Subtract(PyTuple_GET_ITEM(__pyx_v_scenter, 1), PyTuple_GET_ITEM(__pyx_v_ocenter, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __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 = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_v_diff = __pyx_t_1; __pyx_t_1 = 0;
74: sum = diff[0]**2 + diff[1]**2
/* "vision/annotations.pyx":74 * diff = scenter[0] - ocenter[0], \ * scenter[1] - ocenter[1] * sum = diff[0]**2 + diff[1]**2 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return math.sqrt(sum) * */ __pyx_t_1 = PyNumber_Power(PyTuple_GET_ITEM(__pyx_v_diff, 0), __pyx_int_2, Py_None); 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_t_4 = PyNumber_Power(PyTuple_GET_ITEM(__pyx_v_diff, 1), __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __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_4); __pyx_t_4 = 0; __pyx_v_sum = __pyx_t_3; __pyx_t_3 = 0;
75: return math.sqrt(sum)
/* "vision/annotations.pyx":75 * scenter[1] - ocenter[1] * sum = diff[0]**2 + diff[1]**2 * return math.sqrt(sum) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def intersects(self, oth): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__math); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__sqrt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __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(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(__pyx_v_sum); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_sum); __Pyx_GIVEREF(__pyx_v_sum); __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 = 75; __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_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_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("vision.annotations.Box.distance", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_scenter); __Pyx_XDECREF(__pyx_v_ocenter); __Pyx_XDECREF(__pyx_v_diff); __Pyx_XDECREF(__pyx_v_sum); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
76:
77: def intersects(self, oth):
/* "vision/annotations.pyx":77 * return math.sqrt(sum) * * def intersects(self, oth): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Determines if there is any overlap between two boxes. */ static PyObject *__pyx_pf_6vision_11annotations_3Box_6intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_oth); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_6intersects[] = "Box.intersects(self, oth)\n\n Determines if there is any overlap between two boxes.\n "; static PyObject *__pyx_pf_6vision_11annotations_3Box_6intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_oth) { PyObject *__pyx_v_xlap = NULL; PyObject *__pyx_v_ylap = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("intersects");
78: """
79: Determines if there is any overlap between two boxes.
80: """
81: xlap = max(self.xtl, oth.xtl) <= min(self.xbr, oth.xbr)
/* "vision/annotations.pyx":81 * Determines if there is any overlap between two boxes. * """ * xlap = max(self.xtl, oth.xtl)<
= min(self.xbr, oth.xbr) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* ylap = max(self.ytl, oth.ytl)<
= min(self.ybr, oth.ybr) * return xlap and ylap */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_oth, __pyx_n_s__xtl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl; __pyx_t_4 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; } else { __pyx_t_5 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_v_oth, __pyx_n_s__xbr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xbr; __pyx_t_4 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; } else { __pyx_t_7 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __pyx_t_7; __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __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_5); __pyx_t_5 = 0; __pyx_v_xlap = __pyx_t_1; __pyx_t_1 = 0;
82: ylap = max(self.ytl, oth.ytl) <= min(self.ybr, oth.ybr)
/* "vision/annotations.pyx":82 * """ * xlap = max(self.xtl, oth.xtl)<
= min(self.xbr, oth.xbr) * ylap = max(self.ytl, oth.ytl)<
= min(self.ybr, oth.ybr) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return xlap and ylap * */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_oth, __pyx_n_s__ytl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl; __pyx_t_3 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; } else { __pyx_t_7 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __pyx_t_7; __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_v_oth, __pyx_n_s__ybr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ybr; __pyx_t_3 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = __pyx_t_1; } else { __pyx_t_4 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __pyx_t_4; __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_ylap = __pyx_t_1; __pyx_t_1 = 0;
83: return xlap and ylap
/* "vision/annotations.pyx":83 * xlap = max(self.xtl, oth.xtl)<
= min(self.xbr, oth.xbr) * ylap = max(self.ytl, oth.ytl)<
= min(self.ybr, oth.ybr) * return xlap and ylap #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def percentoverlap(self, oth): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_xlap); if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) { __Pyx_INCREF(__pyx_v_ylap); __pyx_t_1 = __pyx_v_ylap; } else { __Pyx_INCREF(__pyx_v_xlap); __pyx_t_1 = __pyx_v_xlap; } __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_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("vision.annotations.Box.intersects", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_xlap); __Pyx_XDECREF(__pyx_v_ylap); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
84:
85: def percentoverlap(self, oth):
/* "vision/annotations.pyx":85 * return xlap and ylap * * def percentoverlap(self, oth): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Calculates the percent of boxes that overlap. */ static PyObject *__pyx_pf_6vision_11annotations_3Box_7percentoverlap(PyObject *__pyx_v_self, PyObject *__pyx_v_oth); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_7percentoverlap[] = "Box.percentoverlap(self, oth)\n\n Calculates the percent of boxes that overlap.\n "; static PyObject *__pyx_pf_6vision_11annotations_3Box_7percentoverlap(PyObject *__pyx_v_self, PyObject *__pyx_v_oth) { PyObject *__pyx_v_xdiff = NULL; PyObject *__pyx_v_ydiff = NULL; PyObject *__pyx_v_uni = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("percentoverlap");
86: """
87: Calculates the percent of boxes that overlap.
88: """
89: xdiff = min(self.xbr, oth.xbr) - max(self.xtl, oth.xtl)
/* "vision/annotations.pyx":89 * Calculates the percent of boxes that overlap. * """ * xdiff = min(self.xbr, oth.xbr) - max(self.xtl, oth.xtl) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* ydiff = min(self.ybr, oth.ybr) - max(self.ytl, oth.ytl) * */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_oth, __pyx_n_s__xbr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xbr; __pyx_t_4 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; } else { __pyx_t_5 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __pyx_t_5; __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_v_oth, __pyx_n_s__xtl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl; __pyx_t_4 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; } else { __pyx_t_7 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __pyx_t_7; __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __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_5); __pyx_t_5 = 0; __pyx_v_xdiff = __pyx_t_1; __pyx_t_1 = 0;
90: ydiff = min(self.ybr, oth.ybr) - max(self.ytl, oth.ytl)
/* "vision/annotations.pyx":90 * """ * xdiff = min(self.xbr, oth.xbr) - max(self.xtl, oth.xtl) * ydiff = min(self.ybr, oth.ybr) - max(self.ytl, oth.ytl) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * if xdiff<
= 0 or ydiff<
= 0: */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_oth, __pyx_n_s__ybr); 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_t_2 = ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ybr; __pyx_t_3 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; } else { __pyx_t_7 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __pyx_t_7; __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_v_oth, __pyx_n_s__ytl); 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_t_2 = ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl; __pyx_t_3 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = __pyx_t_1; } else { __pyx_t_4 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __pyx_t_4; __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); 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_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_ydiff = __pyx_t_1; __pyx_t_1 = 0;
91:
92: if xdiff <= 0 or ydiff <= 0:
/* "vision/annotations.pyx":92 * ydiff = min(self.ybr, oth.ybr) - max(self.ytl, oth.ytl) * * if xdiff<
= 0 or ydiff<
= 0: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return 0 * */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_xdiff, __pyx_int_0, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_6) { __pyx_t_1 = PyObject_RichCompare(__pyx_v_ydiff, __pyx_int_0, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __pyx_t_8; } else { __pyx_t_9 = __pyx_t_6; } if (__pyx_t_9) {
93: return 0
/* "vision/annotations.pyx":93 * * if xdiff<
= 0 or ydiff<
= 0: * return 0 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * uni = self.area + oth.area - xdiff * ydiff */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; goto __pyx_L5; } __pyx_L5:;
94:
95: uni = self.area + oth.area - xdiff * ydiff
/* "vision/annotations.pyx":95 * return 0 * * uni = self.area + oth.area - xdiff * ydiff #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return float(xdiff * ydiff) / float(uni) * */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__area); 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_7 = PyObject_GetAttr(__pyx_v_oth, __pyx_n_s__area); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyNumber_Multiply(__pyx_v_xdiff, __pyx_v_ydiff); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_uni = __pyx_t_1; __pyx_t_1 = 0;
96: return float(xdiff * ydiff) / float(uni)
/* "vision/annotations.pyx":96 * * uni = self.area + oth.area - xdiff * ydiff * return float(xdiff * ydiff) / float(uni) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def resize(self, xratio, yratio = None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyNumber_Multiply(__pyx_v_xdiff, __pyx_v_ydiff); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_t_1); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyObject_AsDouble(__pyx_v_uni); if (unlikely(__pyx_t_11 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyFloat_FromDouble((__pyx_t_10 / __pyx_t_11)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __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_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("vision.annotations.Box.percentoverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_xdiff); __Pyx_XDECREF(__pyx_v_ydiff); __Pyx_XDECREF(__pyx_v_uni); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
97:
98: def resize(self, xratio, yratio = None):
/* "vision/annotations.pyx":98 * return float(xdiff * ydiff) / float(uni) * * def resize(self, xratio, yratio = None): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Resizes the box by the xratio and yratio. If no yratio is specified, */ static PyObject *__pyx_pf_6vision_11annotations_3Box_8resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_8resize[] = "Box.resize(self, xratio, yratio=None)\n\n Resizes the box by the xratio and yratio. If no yratio is specified,\n defaults to the xratio.\n "; static PyObject *__pyx_pf_6vision_11annotations_3Box_8resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_xratio = 0; PyObject *__pyx_v_yratio = 0; PyObject *__pyx_r = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__xratio,&__pyx_n_s__yratio,0}; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("resize"); { PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; switch (PyTuple_GET_SIZE(__pyx_args)) { 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__xratio); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__yratio); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "resize")<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_xratio = values[0]; __pyx_v_yratio = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("resize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("vision.annotations.Box.resize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_INCREF(__pyx_v_yratio);
99: """
100: Resizes the box by the xratio and yratio. If no yratio is specified,
101: defaults to the xratio.
102: """
103: if yratio is None:
/* "vision/annotations.pyx":103 * defaults to the xratio. * """ * if yratio is None: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* yratio = xratio * */ __pyx_t_1 = (__pyx_v_yratio == Py_None); if (__pyx_t_1) {
104: yratio = xratio
/* "vision/annotations.pyx":104 * """ * if yratio is None: * yratio = xratio #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * return Box(self.xtl, self.ytl, */ __Pyx_INCREF(__pyx_v_xratio); __Pyx_DECREF(__pyx_v_yratio); __pyx_v_yratio = __pyx_v_xratio; goto __pyx_L6; } __pyx_L6:;
105:
106: return Box(self.xtl, self.ytl,
/* "vision/annotations.pyx":106 * yratio = xratio * * return Box(self.xtl, self.ytl, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.xtl +<
int> (self.width * xratio), * self.ytl +<
int> (self.height * yratio), */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3);
107: self.xtl + <int> (self.width * xratio),
/* "vision/annotations.pyx":107 * * return Box(self.xtl, self.ytl, * self.xtl +<
int> (self.width * xratio), #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.ytl +<
int> (self.height * yratio), * self.frame, self.lost, self.occluded, self.generated, */ __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__width); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_v_xratio); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyInt_FromLong((((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl + ((int)__pyx_t_6))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5);
108: self.ytl + <int> (self.height * yratio),
/* "vision/annotations.pyx":108 * return Box(self.xtl, self.ytl, * self.xtl +<
int> (self.width * xratio), * self.ytl +<
int> (self.height * yratio), #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.frame, self.lost, self.occluded, self.generated, * list(self.attributes)) */ __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__height); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_v_yratio); 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_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyInt_FromLong((((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl + ((int)__pyx_t_6))); 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);
109: self.frame, self.lost, self.occluded, self.generated,
/* "vision/annotations.pyx":109 * self.xtl +<
int> (self.width * xratio), * self.ytl +<
int> (self.height * yratio), * self.frame, self.lost, self.occluded, self.generated, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* list(self.attributes)) * */ __pyx_t_4 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->frame); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->lost); 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_9 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->occluded); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->generated); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10);
110: list(self.attributes))
/* "vision/annotations.pyx":110 * self.ytl +<
int> (self.height * yratio), * self.frame, self.lost, self.occluded, self.generated, * list(self.attributes)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def transform(self, xratio, yratio = None): */ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_11)); __Pyx_INCREF(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); PyTuple_SET_ITEM(__pyx_t_11, 0, ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); __Pyx_GIVEREF(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; __pyx_t_11 = PyTuple_New(9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_11)); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_7 = 0; __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_12 = 0; __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6vision_11annotations_Box)), ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; __pyx_r = __pyx_t_12; __pyx_t_12 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("vision.annotations.Box.resize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_yratio); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
111:
112: def transform(self, xratio, yratio = None):
/* "vision/annotations.pyx":112 * list(self.attributes)) * * def transform(self, xratio, yratio = None): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Transforms the space that the box exists in by an x and y ratio. If */ static PyObject *__pyx_pf_6vision_11annotations_3Box_9transform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_9transform[] = "Box.transform(self, xratio, yratio=None)\n\n Transforms the space that the box exists in by an x and y ratio. If\n the y ratio is not specified, defaults to the xratio.\n "; static PyObject *__pyx_pf_6vision_11annotations_3Box_9transform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_xratio = 0; PyObject *__pyx_v_yratio = 0; int __pyx_v_xtl; int __pyx_v_ytl; int __pyx_v_xbr; int __pyx_v_ybr; PyObject *__pyx_r = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__xratio,&__pyx_n_s__yratio,0}; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transform"); { PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; switch (PyTuple_GET_SIZE(__pyx_args)) { 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__xratio); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__yratio); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "transform")<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_xratio = values[0]; __pyx_v_yratio = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("transform", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("vision.annotations.Box.transform", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_INCREF(__pyx_v_yratio);
113: """
114: Transforms the space that the box exists in by an x and y ratio. If
115: the y ratio is not specified, defaults to the xratio.
116: """
117: if yratio is None:
/* "vision/annotations.pyx":117 * the y ratio is not specified, defaults to the xratio. * """ * if yratio is None: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* yratio = xratio * */ __pyx_t_1 = (__pyx_v_yratio == Py_None); if (__pyx_t_1) {
118: yratio = xratio
/* "vision/annotations.pyx":118 * """ * if yratio is None: * yratio = xratio #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * cdef int xtl =<
int>(self.xtl * xratio) */ __Pyx_INCREF(__pyx_v_xratio); __Pyx_DECREF(__pyx_v_yratio); __pyx_v_yratio = __pyx_v_xratio; goto __pyx_L6; } __pyx_L6:;
119:
120: cdef int xtl = <int>(self.xtl * xratio)
/* "vision/annotations.pyx":120 * yratio = xratio * * cdef int xtl =<
int>(self.xtl * xratio) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef int ytl =<
int>(self.ytl * yratio) * cdef int xbr =<
int>(self.xbr * xratio) */ __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_v_xratio); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_xtl = ((int)__pyx_t_4);
121: cdef int ytl = <int>(self.ytl * yratio)
/* "vision/annotations.pyx":121 * * cdef int xtl =<
int>(self.xtl * xratio) * cdef int ytl =<
int>(self.ytl * yratio) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef int xbr =<
int>(self.xbr * xratio) * cdef int ybr =<
int>(self.ybr * yratio) */ __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_v_yratio); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ytl = ((int)__pyx_t_4);
122: cdef int xbr = <int>(self.xbr * xratio)
/* "vision/annotations.pyx":122 * cdef int xtl =<
int>(self.xtl * xratio) * cdef int ytl =<
int>(self.ytl * yratio) * cdef int xbr =<
int>(self.xbr * xratio) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef int ybr =<
int>(self.ybr * yratio) * */ __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xbr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_v_xratio); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_xbr = ((int)__pyx_t_4);
123: cdef int ybr = <int>(self.ybr * yratio)
/* "vision/annotations.pyx":123 * cdef int ytl =<
int>(self.ytl * yratio) * cdef int xbr =<
int>(self.xbr * xratio) * cdef int ybr =<
int>(self.ybr * yratio) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * if xbr<
= xtl: */ __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ybr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_v_yratio); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ybr = ((int)__pyx_t_4);
124:
125: if xbr <= xtl:
/* "vision/annotations.pyx":125 * cdef int ybr =<
int>(self.ybr * yratio) * * if xbr<
= xtl: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* xbr += 1 * if ybr<
= ytl: */ __pyx_t_1 = (__pyx_v_xbr<
= __pyx_v_xtl); if (__pyx_t_1) {
126: xbr += 1
/* "vision/annotations.pyx":126 * * if xbr<
= xtl: * xbr += 1 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* if ybr<
= ytl: * ybr += 1 */ __pyx_v_xbr = (__pyx_v_xbr + 1); goto __pyx_L7; } __pyx_L7:;
127: if ybr <= ytl:
/* "vision/annotations.pyx":127 * if xbr<
= xtl: * xbr += 1 * if ybr<
= ytl: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* ybr += 1 * */ __pyx_t_1 = (__pyx_v_ybr<
= __pyx_v_ytl); if (__pyx_t_1) {
128: ybr += 1
/* "vision/annotations.pyx":128 * xbr += 1 * if ybr<
= ytl: * ybr += 1 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * return Box(xtl, ytl, xbr, ybr, */ __pyx_v_ybr = (__pyx_v_ybr + 1); goto __pyx_L8; } __pyx_L8:;
129:
130: return Box(xtl, ytl, xbr, ybr,
/* "vision/annotations.pyx":130 * ybr += 1 * * return Box(xtl, ytl, xbr, ybr, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.frame, self.lost, self.occluded, self.generated, * list(self.attributes)) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyInt_FromLong(__pyx_v_xtl); 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 = PyInt_FromLong(__pyx_v_ytl); 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_t_5 = PyInt_FromLong(__pyx_v_xbr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyInt_FromLong(__pyx_v_ybr); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6);
131: self.frame, self.lost, self.occluded, self.generated,
/* "vision/annotations.pyx":131 * * return Box(xtl, ytl, xbr, ybr, * self.frame, self.lost, self.occluded, self.generated, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* list(self.attributes)) * */ __pyx_t_7 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->frame); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->lost); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->occluded); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->generated); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10);
132: list(self.attributes))
/* "vision/annotations.pyx":132 * return Box(xtl, ytl, xbr, ybr, * self.frame, self.lost, self.occluded, self.generated, * list(self.attributes)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def average(self, other): */ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_11)); __Pyx_INCREF(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); PyTuple_SET_ITEM(__pyx_t_11, 0, ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); __Pyx_GIVEREF(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; __pyx_t_11 = PyTuple_New(9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_11)); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_12 = 0; __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6vision_11annotations_Box)), ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; __pyx_r = __pyx_t_12; __pyx_t_12 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("vision.annotations.Box.transform", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_yratio); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
133:
134: def average(self, other):
/* "vision/annotations.pyx":134 * list(self.attributes)) * * def average(self, other): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return Box((self.xtl + other.xtl) / 2, * (self.ytl + other.ytl) / 2, */ static PyObject *__pyx_pf_6vision_11annotations_3Box_10average(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_10average[] = "Box.average(self, other)"; static PyObject *__pyx_pf_6vision_11annotations_3Box_10average(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("average");
135: return Box((self.xtl + other.xtl) / 2,
/* "vision/annotations.pyx":135 * * def average(self, other): * return Box((self.xtl + other.xtl) / 2, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* (self.ytl + other.ytl) / 2, * (self.xbr + other.xbr) / 2, */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__xtl); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __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_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
136: (self.ytl + other.ytl) / 2,
/* "vision/annotations.pyx":136 * def average(self, other): * return Box((self.xtl + other.xtl) / 2, * (self.ytl + other.ytl) / 2, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* (self.xbr + other.xbr) / 2, * (self.ybr + other.ybr) / 2, */ __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__ytl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
137: (self.xbr + other.xbr) / 2,
/* "vision/annotations.pyx":137 * return Box((self.xtl + other.xtl) / 2, * (self.ytl + other.ytl) / 2, * (self.xbr + other.xbr) / 2, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* (self.ybr + other.ybr) / 2, * (self.frame + other.frame) / 2, */ __pyx_t_4 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xbr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__xbr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
138: (self.ybr + other.ybr) / 2,
/* "vision/annotations.pyx":138 * (self.ytl + other.ytl) / 2, * (self.xbr + other.xbr) / 2, * (self.ybr + other.ybr) / 2, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* (self.frame + other.frame) / 2, * self.lost or other.lost, */ __pyx_t_5 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ybr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__ybr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
139: (self.frame + other.frame) / 2,
/* "vision/annotations.pyx":139 * (self.xbr + other.xbr) / 2, * (self.ybr + other.ybr) / 2, * (self.frame + other.frame) / 2, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.lost or other.lost, * self.occluded or other.occluded, */ __pyx_t_6 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->frame); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__frame); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
140: self.lost or other.lost,
/* "vision/annotations.pyx":140 * (self.ybr + other.ybr) / 2, * (self.frame + other.frame) / 2, * self.lost or other.lost, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.occluded or other.occluded, * self.generated, */ __pyx_t_7 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->lost); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_8) { __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__lost); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __pyx_t_6; __pyx_t_6 = 0; } else { __pyx_t_9 = __pyx_t_7; __pyx_t_7 = 0; }
141: self.occluded or other.occluded,
/* "vision/annotations.pyx":141 * (self.frame + other.frame) / 2, * self.lost or other.lost, * self.occluded or other.occluded, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.generated, * list(self.attributes)) */ __pyx_t_7 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->occluded); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_8) { __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__occluded); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = __pyx_t_6; __pyx_t_6 = 0; } else { __pyx_t_10 = __pyx_t_7; __pyx_t_7 = 0; }
142: self.generated,
/* "vision/annotations.pyx":142 * self.lost or other.lost, * self.occluded or other.occluded, * self.generated, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* list(self.attributes)) * */ __pyx_t_7 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->generated); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7);
143: list(self.attributes))
/* "vision/annotations.pyx":143 * self.occluded or other.occluded, * self.generated, * list(self.attributes)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def __str__(self): */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __Pyx_INCREF(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); PyTuple_SET_ITEM(__pyx_t_6, 0, ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); __Pyx_GIVEREF(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_6, 7, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 8, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_7 = 0; __pyx_t_11 = 0; __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6vision_11annotations_Box)), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __pyx_r = __pyx_t_11; __pyx_t_11 = 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_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("vision.annotations.Box.average", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
144:
145: def __str__(self):
/* "vision/annotations.pyx":145 * list(self.attributes)) * * def __str__(self): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Returns a string representation. */ static PyObject *__pyx_pf_6vision_11annotations_3Box_11__str__(PyObject *__pyx_v_self); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_11__str__[] = "\n Returns a string representation.\n "; struct wrapperbase __pyx_wrapperbase_6vision_11annotations_3Box_11__str__; static PyObject *__pyx_pf_6vision_11annotations_3Box_11__str__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__");
146: """
147: Returns a string representation.
148: """
149: return "Box({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})".format(
/* "vision/annotations.pyx":149 * Returns a string representation. * """ * return "Box({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})".format( #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.xtl, self.ytl, self.xbr, self.ybr, * self.frame, self.lost, self.occluded, self.generated, */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_9), __pyx_n_s__format); 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);
150: self.xtl, self.ytl, self.xbr, self.ybr,
/* "vision/annotations.pyx":150 * """ * return "Box({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})".format( * self.xtl, self.ytl, self.xbr, self.ybr, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.frame, self.lost, self.occluded, self.generated, * repr(self.attributes)) */ __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xbr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ybr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5);
151: self.frame, self.lost, self.occluded, self.generated,
/* "vision/annotations.pyx":151 * return "Box({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})".format( * self.xtl, self.ytl, self.xbr, self.ybr, * self.frame, self.lost, self.occluded, self.generated, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* repr(self.attributes)) * */ __pyx_t_6 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->frame); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->lost); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->occluded); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->generated); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9);
152: repr(self.attributes))
/* "vision/annotations.pyx":152 * self.xtl, self.ytl, self.xbr, self.ybr, * self.frame, self.lost, self.occluded, self.generated, * repr(self.attributes)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def __repr__(self): */ __pyx_t_10 = ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes; __Pyx_INCREF(__pyx_t_10); __pyx_t_11 = PyObject_Repr(__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyTuple_New(9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_11 = 0; __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __pyx_r = __pyx_t_11; __pyx_t_11 = 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_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("vision.annotations.Box.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
153:
154: def __repr__(self):
/* "vision/annotations.pyx":154 * repr(self.attributes)) * * def __repr__(self): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Returns a string representation. */ static PyObject *__pyx_pf_6vision_11annotations_3Box_12__repr__(PyObject *__pyx_v_self); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_12__repr__[] = "\n Returns a string representation.\n "; struct wrapperbase __pyx_wrapperbase_6vision_11annotations_3Box_12__repr__; static PyObject *__pyx_pf_6vision_11annotations_3Box_12__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__");
155: """
156: Returns a string representation.
157: """
158: return str(self)
/* "vision/annotations.pyx":158 * Returns a string representation. * """ * return str(self) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def __richcmp__(self, other, int t): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 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_AddTraceback("vision.annotations.Box.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
159:
160: def __richcmp__(self, other, int t):
/* "vision/annotations.pyx":160 * return str(self) * * def __richcmp__(self, other, int t): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * A comparator to see if boxes are equal or not. */ static PyObject *__pyx_pf_6vision_11annotations_3Box_13__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_t); /*proto*/ static PyObject *__pyx_pf_6vision_11annotations_3Box_13__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_t) { PyObject *__pyx_v_equality = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__");
161: """
162: A comparator to see if boxes are equal or not.
163: """
164: if not isinstance(other, Box):
/* "vision/annotations.pyx":164 * A comparator to see if boxes are equal or not. * """ * if not isinstance(other, Box): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return False * */ __pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_6vision_11annotations_Box)); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) {
165: return False
/* "vision/annotations.pyx":165 * """ * if not isinstance(other, Box): * return False #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * equality = self.xtl is other.xtl and \ */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; goto __pyx_L5; } __pyx_L5:;
166:
167: equality = self.xtl is other.xtl and \
/* "vision/annotations.pyx":167 * return False * * equality = self.xtl is other.xtl and \ #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.ytl is other.ytl and \ * self.xbr is other.xbr and \ */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__xtl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__xtl); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = (__pyx_t_1 == __pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) {
168: self.ytl is other.ytl and \
/* "vision/annotations.pyx":168 * * equality = self.xtl is other.xtl and \ * self.ytl is other.ytl and \ #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.xbr is other.xbr and \ * self.ybr is other.ybr and \ */ __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ytl); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__ytl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_4 == __pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) {
169: self.xbr is other.xbr and \
/* "vision/annotations.pyx":169 * equality = self.xtl is other.xtl and \ * self.ytl is other.ytl and \ * self.xbr is other.xbr and \ #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.ybr is other.ybr and \ * self.frame is other.frame and \ */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__xbr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__xbr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = (__pyx_t_1 == __pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) {
170: self.ybr is other.ybr and \
/* "vision/annotations.pyx":170 * self.ytl is other.ytl and \ * self.xbr is other.xbr and \ * self.ybr is other.ybr and \ #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.frame is other.frame and \ * self.lost is other.lost */ __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ybr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__ybr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = (__pyx_t_4 == __pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) {
171: self.frame is other.frame and \
/* "vision/annotations.pyx":171 * self.xbr is other.xbr and \ * self.ybr is other.ybr and \ * self.frame is other.frame and \ #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.lost is other.lost * */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__frame); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = (__pyx_t_1 == __pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) {
172: self.lost is other.lost
/* "vision/annotations.pyx":172 * self.ybr is other.ybr and \ * self.frame is other.frame and \ * self.lost is other.lost #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * if t == 0: return self.frame<
other.frame */ __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lost); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__lost); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = (__pyx_t_4 == __pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __pyx_t_8; } else { __pyx_t_9 = __pyx_t_7; } __pyx_t_7 = __pyx_t_9; } else { __pyx_t_7 = __pyx_t_6; } __pyx_t_6 = __pyx_t_7; } else { __pyx_t_6 = __pyx_t_5; } __pyx_t_5 = __pyx_t_6; } else { __pyx_t_5 = __pyx_t_2; } __pyx_t_2 = __pyx_t_5; } else { __pyx_t_2 = __pyx_t_3; } __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_equality = __pyx_t_1; __pyx_t_1 = 0;
173:
174: if t == 0: return self.frame < other.frame
/* "vision/annotations.pyx":174 * self.lost is other.lost * * if t == 0: return self.frame<
other.frame #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif t == 1: return self.frame<
= other.frame * elif t == 2: return equality */ case 0: __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__frame); 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); __pyx_t_4 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__frame); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; break;
175: elif t == 1: return self.frame <= other.frame
/* "vision/annotations.pyx":175 * * if t == 0: return self.frame<
other.frame * elif t == 1: return self.frame<
= other.frame #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif t == 2: return equality * elif t == 3: return not equality */ case 1: __Pyx_XDECREF(__pyx_r); __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__frame); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__frame); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_4, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; break;
176: elif t == 2: return equality
/* "vision/annotations.pyx":176 * if t == 0: return self.frame<
other.frame * elif t == 1: return self.frame<
= other.frame * elif t == 2: return equality #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif t == 3: return not equality * elif t == 4: return self.frame > other.frame */ case 2: __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_equality); __pyx_r = __pyx_v_equality; goto __pyx_L0; break;
177: elif t == 3: return not equality
/* "vision/annotations.pyx":177 * elif t == 1: return self.frame<
= other.frame * elif t == 2: return equality * elif t == 3: return not equality #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif t == 4: return self.frame > other.frame * elif t == 5: return self.frame >= other.frame */ case 3: __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_equality); if (unlikely(__pyx_t_2<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; break;
178: elif t == 4: return self.frame > other.frame
/* "vision/annotations.pyx":178 * elif t == 2: return equality * elif t == 3: return not equality * elif t == 4: return self.frame > other.frame #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif t == 5: return self.frame >= other.frame * else: return False */ case 4: __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__frame); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; break;
179: elif t == 5: return self.frame >= other.frame
/* "vision/annotations.pyx":179 * elif t == 3: return not equality * elif t == 4: return self.frame > other.frame * elif t == 5: return self.frame >= other.frame #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* else: return False * */ switch (__pyx_v_t) { /* "vision/annotations.pyx":179 * elif t == 3: return not equality * elif t == 4: return self.frame > other.frame * elif t == 5: return self.frame >= other.frame #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* else: return False * */ case 5: __Pyx_XDECREF(__pyx_r); __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__frame); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__frame); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_4, Py_GE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; break; default:
180: else: return False
/* "vision/annotations.pyx":180 * elif t == 4: return self.frame > other.frame * elif t == 5: return self.frame >= other.frame * else: return False #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def __reduce__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; break; } __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("vision.annotations.Box.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_equality); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
181:
182: def __reduce__(self):
/* "vision/annotations.pyx":182 * else: return False * * def __reduce__(self): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Provides support to serialize the box. */ static PyObject *__pyx_pf_6vision_11annotations_3Box_14__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_14__reduce__[] = "Box.__reduce__(self)\n\n Provides support to serialize the box.\n "; static PyObject *__pyx_pf_6vision_11annotations_3Box_14__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__");
183: """
184: Provides support to serialize the box.
185: """
186: return (Box, (self.xtl, self.ytl, self.xbr, self.ybr,
/* "vision/annotations.pyx":186 * Provides support to serialize the box. * """ * return (Box, (self.xtl, self.ytl, self.xbr, self.ybr, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.frame, self.lost, self.occluded, self.generated, * list(self.attributes))) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl); 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 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl); 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_t_3 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xbr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ybr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4);
187: self.frame, self.lost, self.occluded, self.generated,
/* "vision/annotations.pyx":187 * """ * return (Box, (self.xtl, self.ytl, self.xbr, self.ybr, * self.frame, self.lost, self.occluded, self.generated, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* list(self.attributes))) * */ __pyx_t_5 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->frame); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->lost); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->occluded); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->generated); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8);
188: list(self.attributes)))
/* "vision/annotations.pyx":188 * return (Box, (self.xtl, self.ytl, self.xbr, self.ybr, * self.frame, self.lost, self.occluded, self.generated, * list(self.attributes))) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def __getitem__(self, a): */ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); __Pyx_INCREF(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); PyTuple_SET_ITEM(__pyx_t_9, 0, ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); __Pyx_GIVEREF(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_t_9 = PyTuple_New(9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __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_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 8, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_10 = 0; __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6vision_11annotations_Box))); PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)((PyObject*)__pyx_ptype_6vision_11annotations_Box))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6vision_11annotations_Box))); PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_t_9)); __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_r = ((PyObject *)__pyx_t_10); __pyx_t_10 = 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_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("vision.annotations.Box.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
189:
190: def __getitem__(self, a):
/* "vision/annotations.pyx":190 * list(self.attributes))) * * def __getitem__(self, a): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Allows accessing bounding box as if its a tuple */ static PyObject *__pyx_pf_6vision_11annotations_3Box_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_a); /*proto*/ static char __pyx_doc_6vision_11annotations_3Box_15__getitem__[] = "\n Allows accessing bounding box as if its a tuple\n "; struct wrapperbase __pyx_wrapperbase_6vision_11annotations_3Box_15__getitem__; static PyObject *__pyx_pf_6vision_11annotations_3Box_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_a) { PyObject *__pyx_v_tuple = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__");
191: """
192: Allows accessing bounding box as if its a tuple
193: """
194: tuple = (self.xtl, self.ytl, self.xbr, self.ybr,
/* "vision/annotations.pyx":194 * Allows accessing bounding box as if its a tuple * """ * tuple = (self.xtl, self.ytl, self.xbr, self.ybr, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.frame, self.lost, self.occluded, self.generated, * list(self.attributes)) */ __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xtl); 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); __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ytl); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->xbr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->ybr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4);
195: self.frame, self.lost, self.occluded, self.generated,
/* "vision/annotations.pyx":195 * """ * tuple = (self.xtl, self.ytl, self.xbr, self.ybr, * self.frame, self.lost, self.occluded, self.generated, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* list(self.attributes)) * return tuple[a] */ __pyx_t_5 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->frame); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->lost); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->occluded); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyInt_FromLong(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->generated); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8);
196: list(self.attributes))
/* "vision/annotations.pyx":196 * tuple = (self.xtl, self.ytl, self.xbr, self.ybr, * self.frame, self.lost, self.occluded, self.generated, * list(self.attributes)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return tuple[a] * */ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); __Pyx_INCREF(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); PyTuple_SET_ITEM(__pyx_t_9, 0, ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); __Pyx_GIVEREF(((struct __pyx_obj_6vision_11annotations_Box *)__pyx_v_self)->attributes); __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_t_9 = PyTuple_New(9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __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_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 8, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_10 = 0; __pyx_v_tuple = __pyx_t_9; __pyx_t_9 = 0;
197: return tuple[a]
/* "vision/annotations.pyx":197 * self.frame, self.lost, self.occluded, self.generated, * list(self.attributes)) * return tuple[a] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def readpaths(pointer): */ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_tuple), __pyx_v_a); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_r = __pyx_t_9; __pyx_t_9 = 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_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("vision.annotations.Box.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tuple); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
198:
199: def readpaths(pointer):
/* "vision/annotations.pyx":199 * return tuple[a] * * def readpaths(pointer): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Reads a path file, typically coming from vatic. */ static PyObject *__pyx_pf_6vision_11annotations_readpaths(PyObject *__pyx_self, PyObject *__pyx_v_pointer); /*proto*/ static char __pyx_doc_6vision_11annotations_readpaths[] = "readpaths(pointer)\n\n Reads a path file, typically coming from vatic.\n "; static PyMethodDef __pyx_mdef_6vision_11annotations_readpaths = {__Pyx_NAMESTR("readpaths"), (PyCFunction)__pyx_pf_6vision_11annotations_readpaths, METH_O, __Pyx_DOCSTR(__pyx_doc_6vision_11annotations_readpaths)}; static PyObject *__pyx_pf_6vision_11annotations_readpaths(PyObject *__pyx_self, PyObject *__pyx_v_pointer) { PyObject *__pyx_v_paths = NULL; PyObject *__pyx_v_lastid = NULL; PyObject *__pyx_v_currentpath = NULL; PyObject *__pyx_v_currentlabel = NULL; PyObject *__pyx_v_line = NULL; PyObject *__pyx_v_id = NULL; PyObject *__pyx_v_xtl = NULL; PyObject *__pyx_v_ytl = NULL; PyObject *__pyx_v_xbr = NULL; PyObject *__pyx_v_ybr = NULL; PyObject *__pyx_v_frame = NULL; PyObject *__pyx_v_lost = NULL; PyObject *__pyx_v_occ = NULL; PyObject *__pyx_v_gen = NULL; PyObject *__pyx_v_label = NULL; PyObject *__pyx_v_attributes = NULL; struct __pyx_obj_6vision_11annotations_Box *__pyx_v_box = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("readpaths"); __pyx_self = __pyx_self; /* "vision/annotations.pyx":199 * return tuple[a] * * def readpaths(pointer): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * Reads a path file, typically coming from vatic. */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6vision_11annotations_readpaths, NULL, __pyx_n_s_35); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__readpaths, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
200: """
201: Reads a path file, typically coming from vatic.
202: """
203: paths = []
/* "vision/annotations.pyx":203 * Reads a path file, typically coming from vatic. * """ * paths = [] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* lastid = None * currentpath = [] */ __pyx_t_1 = PyList_New(0); 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_v_paths = __pyx_t_1; __pyx_t_1 = 0;
204: lastid = None
/* "vision/annotations.pyx":204 * """ * paths = [] * lastid = None #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* currentpath = [] * currentlabel = None */ __Pyx_INCREF(Py_None); __pyx_v_lastid = Py_None;
205: currentpath = []
/* "vision/annotations.pyx":205 * paths = [] * lastid = None * currentpath = [] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* currentlabel = None * for line in pointer: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_currentpath = __pyx_t_1; __pyx_t_1 = 0;
206: currentlabel = None
/* "vision/annotations.pyx":206 * lastid = None * currentpath = [] * currentlabel = None #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* for line in pointer: * line = re.match("(\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) " */ __Pyx_INCREF(Py_None); __pyx_v_currentlabel = Py_None;
207: for line in pointer:
/* "vision/annotations.pyx":207 * currentpath = [] * currentlabel = None * for line in pointer: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* line = re.match("(\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) " * "(\d+) \"(.+)\"( \".+\")*?", line) */ if (PyList_CheckExact(__pyx_v_pointer) || PyTuple_CheckExact(__pyx_v_pointer)) { __pyx_t_1 = __pyx_v_pointer; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pointer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else if (PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; } else { __pyx_t_4 = __pyx_t_3(__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 = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF(__pyx_v_line); __pyx_v_line = __pyx_t_4; __pyx_t_4 = 0;
208: line = re.match("(\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) "
/* "vision/annotations.pyx":208 * currentlabel = None * for line in pointer: * line = re.match("(\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) " #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* "(\d+) \"(.+)\"( \".+\")*?", line) * id, xtl, ytl, xbr, ybr, frame, lost, occ, gen, label, attributes = line.groups() */ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__match); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
209: "(\d+) \"(.+)\"( \".+\")*?", line)
/* "vision/annotations.pyx":209 * for line in pointer: * line = re.match("(\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) " * "(\d+) \"(.+)\"( \".+\")*?", line) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* id, xtl, ytl, xbr, ybr, frame, lost, occ, gen, label, attributes = line.groups() * box = Box(int(xtl), int(ytl), int(xbr), int(ybr), */ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_10)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); __Pyx_INCREF(__pyx_v_line); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_line); __Pyx_GIVEREF(__pyx_v_line); __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_line); __pyx_v_line = __pyx_t_6; __pyx_t_6 = 0;
210: id, xtl, ytl, xbr, ybr, frame, lost, occ, gen, label, attributes = line.groups()
/* "vision/annotations.pyx":210 * line = re.match("(\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) " * "(\d+) \"(.+)\"( \".+\")*?", line) * id, xtl, ytl, xbr, ybr, frame, lost, occ, gen, label, attributes = line.groups() #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* box = Box(int(xtl), int(ytl), int(xbr), int(ybr), * int(frame), int(lost), int(occ), int(gen)) */ __pyx_t_6 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__groups); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; 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) != 11)) { if (PyTuple_GET_SIZE(sequence) > 11) __Pyx_RaiseTooManyValuesError(11); else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 4); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 5); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 6); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 7); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 8); __pyx_t_14 = PyTuple_GET_ITEM(sequence, 9); __pyx_t_15 = PyTuple_GET_ITEM(sequence, 10); } else { if (unlikely(PyList_GET_SIZE(sequence) != 11)) { if (PyList_GET_SIZE(sequence) > 11) __Pyx_RaiseTooManyValuesError(11); else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); __pyx_t_8 = PyList_GET_ITEM(sequence, 3); __pyx_t_9 = PyList_GET_ITEM(sequence, 4); __pyx_t_10 = PyList_GET_ITEM(sequence, 5); __pyx_t_11 = PyList_GET_ITEM(sequence, 6); __pyx_t_12 = PyList_GET_ITEM(sequence, 7); __pyx_t_13 = PyList_GET_ITEM(sequence, 8); __pyx_t_14 = PyList_GET_ITEM(sequence, 9); __pyx_t_15 = PyList_GET_ITEM(sequence, 10); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_16 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_7 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 3; __pyx_t_8 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 4; __pyx_t_9 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 5; __pyx_t_10 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_10)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 6; __pyx_t_11 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_11)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); index = 7; __pyx_t_12 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_12)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); index = 8; __pyx_t_13 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_13)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); index = 9; __pyx_t_14 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_14)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); index = 10; __pyx_t_15 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_15)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_15); if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 11)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __Pyx_XDECREF(__pyx_v_id); __pyx_v_id = __pyx_t_6; __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_v_xtl); __pyx_v_xtl = __pyx_t_5; __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_v_ytl); __pyx_v_ytl = __pyx_t_7; __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_v_xbr); __pyx_v_xbr = __pyx_t_8; __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_v_ybr); __pyx_v_ybr = __pyx_t_9; __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_v_frame); __pyx_v_frame = __pyx_t_10; __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_v_lost); __pyx_v_lost = __pyx_t_11; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_v_occ); __pyx_v_occ = __pyx_t_12; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_v_gen); __pyx_v_gen = __pyx_t_13; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_v_label); __pyx_v_label = __pyx_t_14; __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_v_attributes); __pyx_v_attributes = __pyx_t_15; __pyx_t_15 = 0;
211: box = Box(int(xtl), int(ytl), int(xbr), int(ybr),
/* "vision/annotations.pyx":211 * "(\d+) \"(.+)\"( \".+\")*?", line) * id, xtl, ytl, xbr, ybr, frame, lost, occ, gen, label, attributes = line.groups() * box = Box(int(xtl), int(ytl), int(xbr), int(ybr), #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* int(frame), int(lost), int(occ), int(gen)) * if lastid != id: */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(__pyx_v_xtl); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_xtl); __Pyx_GIVEREF(__pyx_v_xtl); __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __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 = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(__pyx_v_ytl); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ytl); __Pyx_GIVEREF(__pyx_v_ytl); __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __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 = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(__pyx_v_xbr); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_xbr); __Pyx_GIVEREF(__pyx_v_xbr); __pyx_t_13 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __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 = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(__pyx_v_ybr); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ybr); __Pyx_GIVEREF(__pyx_v_ybr); __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
212: int(frame), int(lost), int(occ), int(gen))
/* "vision/annotations.pyx":212 * id, xtl, ytl, xbr, ybr, frame, lost, occ, gen, label, attributes = line.groups() * box = Box(int(xtl), int(ytl), int(xbr), int(ybr), * int(frame), int(lost), int(occ), int(gen)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* if lastid != id: * if lastid != None: */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(__pyx_v_frame); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_frame); __Pyx_GIVEREF(__pyx_v_frame); __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __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 = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(__pyx_v_lost); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lost); __Pyx_GIVEREF(__pyx_v_lost); __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __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 = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(__pyx_v_occ); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_occ); __Pyx_GIVEREF(__pyx_v_occ); __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __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 = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(__pyx_v_gen); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_gen); __Pyx_GIVEREF(__pyx_v_gen); __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6vision_11annotations_Box)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_XDECREF(((PyObject *)__pyx_v_box)); __pyx_v_box = ((struct __pyx_obj_6vision_11annotations_Box *)__pyx_t_8); __pyx_t_8 = 0;
213: if lastid != id:
/* "vision/annotations.pyx":213 * box = Box(int(xtl), int(ytl), int(xbr), int(ybr), * int(frame), int(lost), int(occ), int(gen)) * if lastid != id: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* if lastid != None: * paths.append((currentlabel, currentpath)) */ __pyx_t_8 = PyObject_RichCompare(__pyx_v_lastid, __pyx_v_id, Py_NE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_18<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_18) {
214: if lastid != None:
/* "vision/annotations.pyx":214 * int(frame), int(lost), int(occ), int(gen)) * if lastid != id: * if lastid != None: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* paths.append((currentlabel, currentpath)) * lastid = id */ __pyx_t_8 = PyObject_RichCompare(__pyx_v_lastid, Py_None, Py_NE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_18<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_18) {
215: paths.append((currentlabel, currentpath))
/* "vision/annotations.pyx":215 * if lastid != id: * if lastid != None: * paths.append((currentlabel, currentpath)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* lastid = id * currentpath = [] */ if (unlikely(((PyObject *)__pyx_v_paths) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); __Pyx_INCREF(__pyx_v_currentlabel); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_currentlabel); __Pyx_GIVEREF(__pyx_v_currentlabel); __Pyx_INCREF(((PyObject *)__pyx_v_currentpath)); PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_v_currentpath)); __Pyx_GIVEREF(((PyObject *)__pyx_v_currentpath)); __pyx_t_19 = PyList_Append(__pyx_v_paths, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; goto __pyx_L10; } __pyx_L10:;
216: lastid = id
/* "vision/annotations.pyx":216 * if lastid != None: * paths.append((currentlabel, currentpath)) * lastid = id #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* currentpath = [] * currentlabel = None */ __Pyx_INCREF(__pyx_v_id); __Pyx_DECREF(__pyx_v_lastid); __pyx_v_lastid = __pyx_v_id;
217: currentpath = []
/* "vision/annotations.pyx":217 * paths.append((currentlabel, currentpath)) * lastid = id * currentpath = [] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* currentlabel = None * currentpath.append(box) */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); __Pyx_DECREF(((PyObject *)__pyx_v_currentpath)); __pyx_v_currentpath = __pyx_t_8; __pyx_t_8 = 0;
218: currentlabel = None
/* "vision/annotations.pyx":218 * lastid = id * currentpath = [] * currentlabel = None #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* currentpath.append(box) * currentlabel = label */ __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_v_currentlabel); __pyx_v_currentlabel = Py_None; goto __pyx_L9; } __pyx_L9:;
219: currentpath.append(box)
/* "vision/annotations.pyx":219 * currentpath = [] * currentlabel = None * currentpath.append(box) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* currentlabel = label * paths.append((currentlabel, currentpath)) */ if (unlikely(((PyObject *)__pyx_v_currentpath) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_19 = PyList_Append(__pyx_v_currentpath, ((PyObject *)__pyx_v_box)); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
220: currentlabel = label
/* "vision/annotations.pyx":220 * currentlabel = None * currentpath.append(box) * currentlabel = label #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* paths.append((currentlabel, currentpath)) * return paths */ __Pyx_INCREF(__pyx_v_label); __Pyx_DECREF(__pyx_v_currentlabel); __pyx_v_currentlabel = __pyx_v_label; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
221: paths.append((currentlabel, currentpath))
/* "vision/annotations.pyx":221 * currentpath.append(box) * currentlabel = label * paths.append((currentlabel, currentpath)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return paths * */ if (unlikely(((PyObject *)__pyx_v_paths) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_currentlabel); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_currentlabel); __Pyx_GIVEREF(__pyx_v_currentlabel); __Pyx_INCREF(((PyObject *)__pyx_v_currentpath)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_currentpath)); __Pyx_GIVEREF(((PyObject *)__pyx_v_currentpath)); __pyx_t_19 = PyList_Append(__pyx_v_paths, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
222: return paths
/* "vision/annotations.pyx":222 * currentlabel = label * paths.append((currentlabel, currentpath)) * return paths #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * class frameiterator(object): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_paths)); __pyx_r = ((PyObject *)__pyx_v_paths); 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_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_AddTraceback("vision.annotations.readpaths", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_paths); __Pyx_XDECREF(__pyx_v_lastid); __Pyx_XDECREF(__pyx_v_currentpath); __Pyx_XDECREF(__pyx_v_currentlabel); __Pyx_XDECREF(__pyx_v_line); __Pyx_XDECREF(__pyx_v_id); __Pyx_XDECREF(__pyx_v_xtl); __Pyx_XDECREF(__pyx_v_ytl); __Pyx_XDECREF(__pyx_v_xbr); __Pyx_XDECREF(__pyx_v_ybr); __Pyx_XDECREF(__pyx_v_frame); __Pyx_XDECREF(__pyx_v_lost); __Pyx_XDECREF(__pyx_v_occ); __Pyx_XDECREF(__pyx_v_gen); __Pyx_XDECREF(__pyx_v_label); __Pyx_XDECREF(__pyx_v_attributes); __Pyx_XDECREF((PyObject *)__pyx_v_box); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
223:
224: class frameiterator(object):
/* "vision/annotations.pyx":224 * return paths * * class frameiterator(object): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * A simple iterator to produce frames. */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); /* "vision/annotations.pyx":224 * return paths * * class frameiterator(object): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* """ * A simple iterator to produce frames. */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_builtin_object); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); __Pyx_GIVEREF(__pyx_builtin_object); if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_36))<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1), __pyx_n_s__frameiterator, __pyx_n_s_35); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__frameiterator, __pyx_t_3)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
225: """
226: A simple iterator to produce frames.
227: """
228: def __init__(self, base):
/* "vision/annotations.pyx":228 * A simple iterator to produce frames. * """ * def __init__(self, base): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.base = base * */ static PyObject *__pyx_pf_6vision_11annotations_13frameiterator___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6vision_11annotations_13frameiterator___init__[] = "frameiterator.__init__(self, base)"; static PyMethodDef __pyx_mdef_6vision_11annotations_13frameiterator___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_6vision_11annotations_13frameiterator___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6vision_11annotations_13frameiterator___init__)}; static PyObject *__pyx_pf_6vision_11annotations_13frameiterator___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_base = 0; PyObject *__pyx_r = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__base,0}; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__"); __pyx_self = __pyx_self; { PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; switch (PyTuple_GET_SIZE(__pyx_args)) { 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__self); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__base); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __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), "__init__")<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_base = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("vision.annotations.frameiterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; /* "vision/annotations.pyx":228 * A simple iterator to produce frames. * """ * def __init__(self, base): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.base = base * */ __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6vision_11annotations_13frameiterator___init__, NULL, __pyx_n_s_35); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____init__, __pyx_t_2)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
229: self.base = base
/* "vision/annotations.pyx":229 * """ * def __init__(self, base): * self.base = base #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def path(self, frame): */ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__base, __pyx_v_base)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("vision.annotations.frameiterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
230:
231: def path(self, frame):
/* "vision/annotations.pyx":231 * self.base = base * * def path(self, frame): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* l1 = frame / 10000 * l2 = frame / 100 */ static PyObject *__pyx_pf_6vision_11annotations_13frameiterator_1path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6vision_11annotations_13frameiterator_1path[] = "frameiterator.path(self, frame)"; static PyMethodDef __pyx_mdef_6vision_11annotations_13frameiterator_1path = {__Pyx_NAMESTR("path"), (PyCFunction)__pyx_pf_6vision_11annotations_13frameiterator_1path, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6vision_11annotations_13frameiterator_1path)}; static PyObject *__pyx_pf_6vision_11annotations_13frameiterator_1path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_frame = 0; PyObject *__pyx_v_l1 = NULL; PyObject *__pyx_v_l2 = NULL; PyObject *__pyx_v_path = NULL; PyObject *__pyx_r = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__frame,0}; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("path"); __pyx_self = __pyx_self; { PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; switch (PyTuple_GET_SIZE(__pyx_args)) { 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__self); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frame); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("path", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __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), "path")<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_frame = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("path", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("vision.annotations.frameiterator.path", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; /* "vision/annotations.pyx":231 * self.base = base * * def path(self, frame): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* l1 = frame / 10000 * l2 = frame / 100 */ __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6vision_11annotations_13frameiterator_1path, NULL, __pyx_n_s_35); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s__path, __pyx_t_2)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
232: l1 = frame / 10000
/* "vision/annotations.pyx":232 * * def path(self, frame): * l1 = frame / 10000 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* l2 = frame / 100 * path = "{0}/{1}/{2}.jpg".format(l1, l2, frame) */ __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_frame, __pyx_int_10000); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_l1 = __pyx_t_1; __pyx_t_1 = 0;
233: l2 = frame / 100
/* "vision/annotations.pyx":233 * def path(self, frame): * l1 = frame / 10000 * l2 = frame / 100 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* path = "{0}/{1}/{2}.jpg".format(l1, l2, frame) * path = "{0}/{1}".format(self.base, path) */ __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_frame, __pyx_int_100); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_l2 = __pyx_t_1; __pyx_t_1 = 0;
234: path = "{0}/{1}/{2}.jpg".format(l1, l2, frame)
/* "vision/annotations.pyx":234 * l1 = frame / 10000 * l2 = frame / 100 * path = "{0}/{1}/{2}.jpg".format(l1, l2, frame) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* path = "{0}/{1}".format(self.base, path) * return path */ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_11), __pyx_n_s__format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_l1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_l1); __Pyx_GIVEREF(__pyx_v_l1); __Pyx_INCREF(__pyx_v_l2); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_l2); __Pyx_GIVEREF(__pyx_v_l2); __Pyx_INCREF(__pyx_v_frame); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_frame); __Pyx_GIVEREF(__pyx_v_frame); __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 = 234; __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_v_path = __pyx_t_3; __pyx_t_3 = 0;
235: path = "{0}/{1}".format(self.base, path)
/* "vision/annotations.pyx":235 * l2 = frame / 100 * path = "{0}/{1}/{2}.jpg".format(l1, l2, frame) * path = "{0}/{1}".format(self.base, path) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return path * */ __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_12), __pyx_n_s__format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __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_INCREF(__pyx_v_path); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); __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 = 235; __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_DECREF(__pyx_v_path); __pyx_v_path = __pyx_t_2; __pyx_t_2 = 0;
236: return path
/* "vision/annotations.pyx":236 * path = "{0}/{1}/{2}.jpg".format(l1, l2, frame) * path = "{0}/{1}".format(self.base, path) * return path #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * def __getitem__(self, frame): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_path); __pyx_r = __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_3); __Pyx_AddTraceback("vision.annotations.frameiterator.path", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_l1); __Pyx_XDECREF(__pyx_v_l2); __Pyx_XDECREF(__pyx_v_path); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
237:
238: def __getitem__(self, frame):
/* "vision/annotations.pyx":238 * return path * * def __getitem__(self, frame): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return Image.open(self.path(frame)) * */ static PyObject *__pyx_pf_6vision_11annotations_13frameiterator_2__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6vision_11annotations_13frameiterator_2__getitem__[] = "frameiterator.__getitem__(self, frame)"; static PyMethodDef __pyx_mdef_6vision_11annotations_13frameiterator_2__getitem__ = {__Pyx_NAMESTR("__getitem__"), (PyCFunction)__pyx_pf_6vision_11annotations_13frameiterator_2__getitem__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6vision_11annotations_13frameiterator_2__getitem__)}; static PyObject *__pyx_pf_6vision_11annotations_13frameiterator_2__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_frame = 0; PyObject *__pyx_r = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__frame,0}; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__"); __pyx_self = __pyx_self; { PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; switch (PyTuple_GET_SIZE(__pyx_args)) { 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__self); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frame); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __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), "__getitem__")<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_frame = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("vision.annotations.frameiterator.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; /* "vision/annotations.pyx":238 * return path * * def __getitem__(self, frame): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return Image.open(self.path(frame)) * */ __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6vision_11annotations_13frameiterator_2__getitem__, NULL, __pyx_n_s_35); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____getitem__, __pyx_t_2)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
239: return Image.open(self.path(frame))
/* "vision/annotations.pyx":239 * * def __getitem__(self, frame): * return Image.open(self.path(frame)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* * class flatframeiterator(frameiterator): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Image); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__open); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __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_v_self, __pyx_n_s__path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __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_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __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 = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 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_AddTraceback("vision.annotations.frameiterator.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
240:
241: class flatframeiterator(frameiterator):
/* "vision/annotations.pyx":241 * return Image.open(self.path(frame)) * * class flatframeiterator(frameiterator): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* def path(self, frame): * return "{0}/{1:05d}.jpg".format(self.base, frame) */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); /* "vision/annotations.pyx":241 * return Image.open(self.path(frame)) * * class flatframeiterator(frameiterator): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* def path(self, frame): * return "{0}/{1:05d}.jpg".format(self.base, frame) */ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__frameiterator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __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 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1), __pyx_n_s__flatframeiterator, __pyx_n_s_35); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__flatframeiterator, __pyx_t_3)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
242: def path(self, frame):
/* "vision/annotations.pyx":242 * * class flatframeiterator(frameiterator): * def path(self, frame): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return "{0}/{1:05d}.jpg".format(self.base, frame) */ static PyObject *__pyx_pf_6vision_11annotations_17flatframeiterator_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6vision_11annotations_17flatframeiterator_path[] = "flatframeiterator.path(self, frame)"; static PyMethodDef __pyx_mdef_6vision_11annotations_17flatframeiterator_path = {__Pyx_NAMESTR("path"), (PyCFunction)__pyx_pf_6vision_11annotations_17flatframeiterator_path, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6vision_11annotations_17flatframeiterator_path)}; static PyObject *__pyx_pf_6vision_11annotations_17flatframeiterator_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_frame = 0; PyObject *__pyx_r = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__frame,0}; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("path"); __pyx_self = __pyx_self; { PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; switch (PyTuple_GET_SIZE(__pyx_args)) { 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__self); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frame); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("path", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __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), "path")<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_frame = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("path", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("vision.annotations.flatframeiterator.path", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; /* "vision/annotations.pyx":242 * * class flatframeiterator(frameiterator): * def path(self, frame): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return "{0}/{1:05d}.jpg".format(self.base, frame) */ __pyx_t_3 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6vision_11annotations_17flatframeiterator_path, NULL, __pyx_n_s_35); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s__path, __pyx_t_3)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
243: return "{0}/{1:05d}.jpg".format(self.base, frame)
/* "vision/annotations.pyx":243 * class flatframeiterator(frameiterator): * def path(self, frame): * return "{0}/{1:05d}.jpg".format(self.base, frame) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
*/ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_13), __pyx_n_s__format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __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); __Pyx_INCREF(__pyx_v_frame); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_frame); __Pyx_GIVEREF(__pyx_v_frame); __pyx_t_2 = 0; __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 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_AddTraceback("vision.annotations.flatframeiterator.path", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }