Add files using upload-large-folder tool
Browse files- .venv/lib/python3.13/site-packages/sympy/printing/jscode.py +332 -0
- .venv/lib/python3.13/site-packages/sympy/printing/numpy.py +541 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/000078.json +30 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/000428.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001014.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001151.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001239.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001393.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001444.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001501.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001669.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/002415.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/002946.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/003029.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/003183.json +18 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/003204.json +18 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/003479.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/003654.json +30 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004191.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004216.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004353.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004646.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004703.json +42 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004892.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004938.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/005780.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/005811.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/006006.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/006381.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/006456.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/006694.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/006905.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/007617.json +30 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/007986.json +30 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/008018.json +18 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/008448.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/009074.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/009131.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/009259.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/009424.json +18 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/009561.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/009609.json +30 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/010078.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/010255.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/010310.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/010428.json +18 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/010582.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/010605.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/011239.json +5 -0
- video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/011393.json +5 -0
.venv/lib/python3.13/site-packages/sympy/printing/jscode.py
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Javascript code printer
|
| 3 |
+
|
| 4 |
+
The JavascriptCodePrinter converts single SymPy expressions into single
|
| 5 |
+
Javascript expressions, using the functions defined in the Javascript
|
| 6 |
+
Math object where possible.
|
| 7 |
+
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
from __future__ import annotations
|
| 11 |
+
from typing import Any
|
| 12 |
+
|
| 13 |
+
from sympy.core import S
|
| 14 |
+
from sympy.core.numbers import equal_valued
|
| 15 |
+
from sympy.printing.codeprinter import CodePrinter
|
| 16 |
+
from sympy.printing.precedence import precedence, PRECEDENCE
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
# dictionary mapping SymPy function to (argument_conditions, Javascript_function).
|
| 20 |
+
# Used in JavascriptCodePrinter._print_Function(self)
|
| 21 |
+
known_functions = {
|
| 22 |
+
'Abs': 'Math.abs',
|
| 23 |
+
'acos': 'Math.acos',
|
| 24 |
+
'acosh': 'Math.acosh',
|
| 25 |
+
'asin': 'Math.asin',
|
| 26 |
+
'asinh': 'Math.asinh',
|
| 27 |
+
'atan': 'Math.atan',
|
| 28 |
+
'atan2': 'Math.atan2',
|
| 29 |
+
'atanh': 'Math.atanh',
|
| 30 |
+
'ceiling': 'Math.ceil',
|
| 31 |
+
'cos': 'Math.cos',
|
| 32 |
+
'cosh': 'Math.cosh',
|
| 33 |
+
'exp': 'Math.exp',
|
| 34 |
+
'floor': 'Math.floor',
|
| 35 |
+
'log': 'Math.log',
|
| 36 |
+
'Max': 'Math.max',
|
| 37 |
+
'Min': 'Math.min',
|
| 38 |
+
'sign': 'Math.sign',
|
| 39 |
+
'sin': 'Math.sin',
|
| 40 |
+
'sinh': 'Math.sinh',
|
| 41 |
+
'tan': 'Math.tan',
|
| 42 |
+
'tanh': 'Math.tanh',
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
class JavascriptCodePrinter(CodePrinter):
|
| 47 |
+
""""A Printer to convert Python expressions to strings of JavaScript code
|
| 48 |
+
"""
|
| 49 |
+
printmethod = '_javascript'
|
| 50 |
+
language = 'JavaScript'
|
| 51 |
+
|
| 52 |
+
_default_settings: dict[str, Any] = dict(CodePrinter._default_settings, **{
|
| 53 |
+
'precision': 17,
|
| 54 |
+
'user_functions': {},
|
| 55 |
+
'contract': True,
|
| 56 |
+
})
|
| 57 |
+
|
| 58 |
+
def __init__(self, settings={}):
|
| 59 |
+
CodePrinter.__init__(self, settings)
|
| 60 |
+
self.known_functions = dict(known_functions)
|
| 61 |
+
userfuncs = settings.get('user_functions', {})
|
| 62 |
+
self.known_functions.update(userfuncs)
|
| 63 |
+
|
| 64 |
+
def _rate_index_position(self, p):
|
| 65 |
+
return p*5
|
| 66 |
+
|
| 67 |
+
def _get_statement(self, codestring):
|
| 68 |
+
return "%s;" % codestring
|
| 69 |
+
|
| 70 |
+
def _get_comment(self, text):
|
| 71 |
+
return "// {}".format(text)
|
| 72 |
+
|
| 73 |
+
def _declare_number_const(self, name, value):
|
| 74 |
+
return "var {} = {};".format(name, value.evalf(self._settings['precision']))
|
| 75 |
+
|
| 76 |
+
def _format_code(self, lines):
|
| 77 |
+
return self.indent_code(lines)
|
| 78 |
+
|
| 79 |
+
def _traverse_matrix_indices(self, mat):
|
| 80 |
+
rows, cols = mat.shape
|
| 81 |
+
return ((i, j) for i in range(rows) for j in range(cols))
|
| 82 |
+
|
| 83 |
+
def _get_loop_opening_ending(self, indices):
|
| 84 |
+
open_lines = []
|
| 85 |
+
close_lines = []
|
| 86 |
+
loopstart = "for (var %(varble)s=%(start)s; %(varble)s<%(end)s; %(varble)s++){"
|
| 87 |
+
for i in indices:
|
| 88 |
+
# Javascript arrays start at 0 and end at dimension-1
|
| 89 |
+
open_lines.append(loopstart % {
|
| 90 |
+
'varble': self._print(i.label),
|
| 91 |
+
'start': self._print(i.lower),
|
| 92 |
+
'end': self._print(i.upper + 1)})
|
| 93 |
+
close_lines.append("}")
|
| 94 |
+
return open_lines, close_lines
|
| 95 |
+
|
| 96 |
+
def _print_Pow(self, expr):
|
| 97 |
+
PREC = precedence(expr)
|
| 98 |
+
if equal_valued(expr.exp, -1):
|
| 99 |
+
return '1/%s' % (self.parenthesize(expr.base, PREC))
|
| 100 |
+
elif equal_valued(expr.exp, 0.5):
|
| 101 |
+
return 'Math.sqrt(%s)' % self._print(expr.base)
|
| 102 |
+
elif expr.exp == S.One/3:
|
| 103 |
+
return 'Math.cbrt(%s)' % self._print(expr.base)
|
| 104 |
+
else:
|
| 105 |
+
return 'Math.pow(%s, %s)' % (self._print(expr.base),
|
| 106 |
+
self._print(expr.exp))
|
| 107 |
+
|
| 108 |
+
def _print_Rational(self, expr):
|
| 109 |
+
p, q = int(expr.p), int(expr.q)
|
| 110 |
+
return '%d/%d' % (p, q)
|
| 111 |
+
|
| 112 |
+
def _print_Mod(self, expr):
|
| 113 |
+
num, den = expr.args
|
| 114 |
+
PREC = precedence(expr)
|
| 115 |
+
snum, sden = [self.parenthesize(arg, PREC) for arg in expr.args]
|
| 116 |
+
# % is remainder (same sign as numerator), not modulo (same sign as
|
| 117 |
+
# denominator), in js. Hence, % only works as modulo if both numbers
|
| 118 |
+
# have the same sign
|
| 119 |
+
if (num.is_nonnegative and den.is_nonnegative or
|
| 120 |
+
num.is_nonpositive and den.is_nonpositive):
|
| 121 |
+
return f"{snum} % {sden}"
|
| 122 |
+
return f"(({snum} % {sden}) + {sden}) % {sden}"
|
| 123 |
+
|
| 124 |
+
def _print_Relational(self, expr):
|
| 125 |
+
lhs_code = self._print(expr.lhs)
|
| 126 |
+
rhs_code = self._print(expr.rhs)
|
| 127 |
+
op = expr.rel_op
|
| 128 |
+
return "{} {} {}".format(lhs_code, op, rhs_code)
|
| 129 |
+
|
| 130 |
+
def _print_Indexed(self, expr):
|
| 131 |
+
# calculate index for 1d array
|
| 132 |
+
dims = expr.shape
|
| 133 |
+
elem = S.Zero
|
| 134 |
+
offset = S.One
|
| 135 |
+
for i in reversed(range(expr.rank)):
|
| 136 |
+
elem += expr.indices[i]*offset
|
| 137 |
+
offset *= dims[i]
|
| 138 |
+
return "%s[%s]" % (self._print(expr.base.label), self._print(elem))
|
| 139 |
+
|
| 140 |
+
def _print_Exp1(self, expr):
|
| 141 |
+
return "Math.E"
|
| 142 |
+
|
| 143 |
+
def _print_Pi(self, expr):
|
| 144 |
+
return 'Math.PI'
|
| 145 |
+
|
| 146 |
+
def _print_Infinity(self, expr):
|
| 147 |
+
return 'Number.POSITIVE_INFINITY'
|
| 148 |
+
|
| 149 |
+
def _print_NegativeInfinity(self, expr):
|
| 150 |
+
return 'Number.NEGATIVE_INFINITY'
|
| 151 |
+
|
| 152 |
+
def _print_Piecewise(self, expr):
|
| 153 |
+
from sympy.codegen.ast import Assignment
|
| 154 |
+
if expr.args[-1].cond != True:
|
| 155 |
+
# We need the last conditional to be a True, otherwise the resulting
|
| 156 |
+
# function may not return a result.
|
| 157 |
+
raise ValueError("All Piecewise expressions must contain an "
|
| 158 |
+
"(expr, True) statement to be used as a default "
|
| 159 |
+
"condition. Without one, the generated "
|
| 160 |
+
"expression may not evaluate to anything under "
|
| 161 |
+
"some condition.")
|
| 162 |
+
lines = []
|
| 163 |
+
if expr.has(Assignment):
|
| 164 |
+
for i, (e, c) in enumerate(expr.args):
|
| 165 |
+
if i == 0:
|
| 166 |
+
lines.append("if (%s) {" % self._print(c))
|
| 167 |
+
elif i == len(expr.args) - 1 and c == True:
|
| 168 |
+
lines.append("else {")
|
| 169 |
+
else:
|
| 170 |
+
lines.append("else if (%s) {" % self._print(c))
|
| 171 |
+
code0 = self._print(e)
|
| 172 |
+
lines.append(code0)
|
| 173 |
+
lines.append("}")
|
| 174 |
+
return "\n".join(lines)
|
| 175 |
+
else:
|
| 176 |
+
# The piecewise was used in an expression, need to do inline
|
| 177 |
+
# operators. This has the downside that inline operators will
|
| 178 |
+
# not work for statements that span multiple lines (Matrix or
|
| 179 |
+
# Indexed expressions).
|
| 180 |
+
ecpairs = ["((%s) ? (\n%s\n)\n" % (self._print(c), self._print(e))
|
| 181 |
+
for e, c in expr.args[:-1]]
|
| 182 |
+
last_line = ": (\n%s\n)" % self._print(expr.args[-1].expr)
|
| 183 |
+
return ": ".join(ecpairs) + last_line + " ".join([")"*len(ecpairs)])
|
| 184 |
+
|
| 185 |
+
def _print_MatrixElement(self, expr):
|
| 186 |
+
return "{}[{}]".format(self.parenthesize(expr.parent,
|
| 187 |
+
PRECEDENCE["Atom"], strict=True),
|
| 188 |
+
expr.j + expr.i*expr.parent.shape[1])
|
| 189 |
+
|
| 190 |
+
def indent_code(self, code):
|
| 191 |
+
"""Accepts a string of code or a list of code lines"""
|
| 192 |
+
|
| 193 |
+
if isinstance(code, str):
|
| 194 |
+
code_lines = self.indent_code(code.splitlines(True))
|
| 195 |
+
return ''.join(code_lines)
|
| 196 |
+
|
| 197 |
+
tab = " "
|
| 198 |
+
inc_token = ('{', '(', '{\n', '(\n')
|
| 199 |
+
dec_token = ('}', ')')
|
| 200 |
+
|
| 201 |
+
code = [ line.lstrip(' \t') for line in code ]
|
| 202 |
+
|
| 203 |
+
increase = [ int(any(map(line.endswith, inc_token))) for line in code ]
|
| 204 |
+
decrease = [ int(any(map(line.startswith, dec_token)))
|
| 205 |
+
for line in code ]
|
| 206 |
+
|
| 207 |
+
pretty = []
|
| 208 |
+
level = 0
|
| 209 |
+
for n, line in enumerate(code):
|
| 210 |
+
if line in ('', '\n'):
|
| 211 |
+
pretty.append(line)
|
| 212 |
+
continue
|
| 213 |
+
level -= decrease[n]
|
| 214 |
+
pretty.append("%s%s" % (tab*level, line))
|
| 215 |
+
level += increase[n]
|
| 216 |
+
return pretty
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
def jscode(expr, assign_to=None, **settings):
|
| 220 |
+
"""Converts an expr to a string of javascript code
|
| 221 |
+
|
| 222 |
+
Parameters
|
| 223 |
+
==========
|
| 224 |
+
|
| 225 |
+
expr : Expr
|
| 226 |
+
A SymPy expression to be converted.
|
| 227 |
+
assign_to : optional
|
| 228 |
+
When given, the argument is used as the name of the variable to which
|
| 229 |
+
the expression is assigned. Can be a string, ``Symbol``,
|
| 230 |
+
``MatrixSymbol``, or ``Indexed`` type. This is helpful in case of
|
| 231 |
+
line-wrapping, or for expressions that generate multi-line statements.
|
| 232 |
+
precision : integer, optional
|
| 233 |
+
The precision for numbers such as pi [default=15].
|
| 234 |
+
user_functions : dict, optional
|
| 235 |
+
A dictionary where keys are ``FunctionClass`` instances and values are
|
| 236 |
+
their string representations. Alternatively, the dictionary value can
|
| 237 |
+
be a list of tuples i.e. [(argument_test, js_function_string)]. See
|
| 238 |
+
below for examples.
|
| 239 |
+
human : bool, optional
|
| 240 |
+
If True, the result is a single string that may contain some constant
|
| 241 |
+
declarations for the number symbols. If False, the same information is
|
| 242 |
+
returned in a tuple of (symbols_to_declare, not_supported_functions,
|
| 243 |
+
code_text). [default=True].
|
| 244 |
+
contract: bool, optional
|
| 245 |
+
If True, ``Indexed`` instances are assumed to obey tensor contraction
|
| 246 |
+
rules and the corresponding nested loops over indices are generated.
|
| 247 |
+
Setting contract=False will not generate loops, instead the user is
|
| 248 |
+
responsible to provide values for the indices in the code.
|
| 249 |
+
[default=True].
|
| 250 |
+
|
| 251 |
+
Examples
|
| 252 |
+
========
|
| 253 |
+
|
| 254 |
+
>>> from sympy import jscode, symbols, Rational, sin, ceiling, Abs
|
| 255 |
+
>>> x, tau = symbols("x, tau")
|
| 256 |
+
>>> jscode((2*tau)**Rational(7, 2))
|
| 257 |
+
'8*Math.sqrt(2)*Math.pow(tau, 7/2)'
|
| 258 |
+
>>> jscode(sin(x), assign_to="s")
|
| 259 |
+
's = Math.sin(x);'
|
| 260 |
+
|
| 261 |
+
Custom printing can be defined for certain types by passing a dictionary of
|
| 262 |
+
"type" : "function" to the ``user_functions`` kwarg. Alternatively, the
|
| 263 |
+
dictionary value can be a list of tuples i.e. [(argument_test,
|
| 264 |
+
js_function_string)].
|
| 265 |
+
|
| 266 |
+
>>> custom_functions = {
|
| 267 |
+
... "ceiling": "CEIL",
|
| 268 |
+
... "Abs": [(lambda x: not x.is_integer, "fabs"),
|
| 269 |
+
... (lambda x: x.is_integer, "ABS")]
|
| 270 |
+
... }
|
| 271 |
+
>>> jscode(Abs(x) + ceiling(x), user_functions=custom_functions)
|
| 272 |
+
'fabs(x) + CEIL(x)'
|
| 273 |
+
|
| 274 |
+
``Piecewise`` expressions are converted into conditionals. If an
|
| 275 |
+
``assign_to`` variable is provided an if statement is created, otherwise
|
| 276 |
+
the ternary operator is used. Note that if the ``Piecewise`` lacks a
|
| 277 |
+
default term, represented by ``(expr, True)`` then an error will be thrown.
|
| 278 |
+
This is to prevent generating an expression that may not evaluate to
|
| 279 |
+
anything.
|
| 280 |
+
|
| 281 |
+
>>> from sympy import Piecewise
|
| 282 |
+
>>> expr = Piecewise((x + 1, x > 0), (x, True))
|
| 283 |
+
>>> print(jscode(expr, tau))
|
| 284 |
+
if (x > 0) {
|
| 285 |
+
tau = x + 1;
|
| 286 |
+
}
|
| 287 |
+
else {
|
| 288 |
+
tau = x;
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
Support for loops is provided through ``Indexed`` types. With
|
| 292 |
+
``contract=True`` these expressions will be turned into loops, whereas
|
| 293 |
+
``contract=False`` will just print the assignment expression that should be
|
| 294 |
+
looped over:
|
| 295 |
+
|
| 296 |
+
>>> from sympy import Eq, IndexedBase, Idx
|
| 297 |
+
>>> len_y = 5
|
| 298 |
+
>>> y = IndexedBase('y', shape=(len_y,))
|
| 299 |
+
>>> t = IndexedBase('t', shape=(len_y,))
|
| 300 |
+
>>> Dy = IndexedBase('Dy', shape=(len_y-1,))
|
| 301 |
+
>>> i = Idx('i', len_y-1)
|
| 302 |
+
>>> e=Eq(Dy[i], (y[i+1]-y[i])/(t[i+1]-t[i]))
|
| 303 |
+
>>> jscode(e.rhs, assign_to=e.lhs, contract=False)
|
| 304 |
+
'Dy[i] = (y[i + 1] - y[i])/(t[i + 1] - t[i]);'
|
| 305 |
+
|
| 306 |
+
Matrices are also supported, but a ``MatrixSymbol`` of the same dimensions
|
| 307 |
+
must be provided to ``assign_to``. Note that any expression that can be
|
| 308 |
+
generated normally can also exist inside a Matrix:
|
| 309 |
+
|
| 310 |
+
>>> from sympy import Matrix, MatrixSymbol
|
| 311 |
+
>>> mat = Matrix([x**2, Piecewise((x + 1, x > 0), (x, True)), sin(x)])
|
| 312 |
+
>>> A = MatrixSymbol('A', 3, 1)
|
| 313 |
+
>>> print(jscode(mat, A))
|
| 314 |
+
A[0] = Math.pow(x, 2);
|
| 315 |
+
if (x > 0) {
|
| 316 |
+
A[1] = x + 1;
|
| 317 |
+
}
|
| 318 |
+
else {
|
| 319 |
+
A[1] = x;
|
| 320 |
+
}
|
| 321 |
+
A[2] = Math.sin(x);
|
| 322 |
+
"""
|
| 323 |
+
|
| 324 |
+
return JavascriptCodePrinter(settings).doprint(expr, assign_to)
|
| 325 |
+
|
| 326 |
+
|
| 327 |
+
def print_jscode(expr, **settings):
|
| 328 |
+
"""Prints the Javascript representation of the given expression.
|
| 329 |
+
|
| 330 |
+
See jscode for the meaning of the optional arguments.
|
| 331 |
+
"""
|
| 332 |
+
print(jscode(expr, **settings))
|
.venv/lib/python3.13/site-packages/sympy/printing/numpy.py
ADDED
|
@@ -0,0 +1,541 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from sympy.core import S
|
| 2 |
+
from sympy.core.function import Lambda
|
| 3 |
+
from sympy.core.power import Pow
|
| 4 |
+
from .pycode import PythonCodePrinter, _known_functions_math, _print_known_const, _print_known_func, _unpack_integral_limits, ArrayPrinter
|
| 5 |
+
from .codeprinter import CodePrinter
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
_not_in_numpy = 'erf erfc factorial gamma loggamma'.split()
|
| 9 |
+
_in_numpy = [(k, v) for k, v in _known_functions_math.items() if k not in _not_in_numpy]
|
| 10 |
+
_known_functions_numpy = dict(_in_numpy, **{
|
| 11 |
+
'acos': 'arccos',
|
| 12 |
+
'acosh': 'arccosh',
|
| 13 |
+
'asin': 'arcsin',
|
| 14 |
+
'asinh': 'arcsinh',
|
| 15 |
+
'atan': 'arctan',
|
| 16 |
+
'atan2': 'arctan2',
|
| 17 |
+
'atanh': 'arctanh',
|
| 18 |
+
'exp2': 'exp2',
|
| 19 |
+
'sign': 'sign',
|
| 20 |
+
'logaddexp': 'logaddexp',
|
| 21 |
+
'logaddexp2': 'logaddexp2',
|
| 22 |
+
'isinf': 'isinf',
|
| 23 |
+
'isnan': 'isnan',
|
| 24 |
+
|
| 25 |
+
})
|
| 26 |
+
_known_constants_numpy = {
|
| 27 |
+
'Exp1': 'e',
|
| 28 |
+
'Pi': 'pi',
|
| 29 |
+
'EulerGamma': 'euler_gamma',
|
| 30 |
+
'NaN': 'nan',
|
| 31 |
+
'Infinity': 'inf',
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
_numpy_known_functions = {k: 'numpy.' + v for k, v in _known_functions_numpy.items()}
|
| 35 |
+
_numpy_known_constants = {k: 'numpy.' + v for k, v in _known_constants_numpy.items()}
|
| 36 |
+
|
| 37 |
+
class NumPyPrinter(ArrayPrinter, PythonCodePrinter):
|
| 38 |
+
"""
|
| 39 |
+
Numpy printer which handles vectorized piecewise functions,
|
| 40 |
+
logical operators, etc.
|
| 41 |
+
"""
|
| 42 |
+
|
| 43 |
+
_module = 'numpy'
|
| 44 |
+
_kf = _numpy_known_functions
|
| 45 |
+
_kc = _numpy_known_constants
|
| 46 |
+
|
| 47 |
+
def __init__(self, settings=None):
|
| 48 |
+
"""
|
| 49 |
+
`settings` is passed to CodePrinter.__init__()
|
| 50 |
+
`module` specifies the array module to use, currently 'NumPy', 'CuPy'
|
| 51 |
+
or 'JAX'.
|
| 52 |
+
"""
|
| 53 |
+
self.language = "Python with {}".format(self._module)
|
| 54 |
+
self.printmethod = "_{}code".format(self._module)
|
| 55 |
+
|
| 56 |
+
self._kf = {**PythonCodePrinter._kf, **self._kf}
|
| 57 |
+
|
| 58 |
+
super().__init__(settings=settings)
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
def _print_seq(self, seq):
|
| 62 |
+
"General sequence printer: converts to tuple"
|
| 63 |
+
# Print tuples here instead of lists because numba supports
|
| 64 |
+
# tuples in nopython mode.
|
| 65 |
+
delimiter=', '
|
| 66 |
+
return '({},)'.format(delimiter.join(self._print(item) for item in seq))
|
| 67 |
+
|
| 68 |
+
def _print_NegativeInfinity(self, expr):
|
| 69 |
+
return '-' + self._print(S.Infinity)
|
| 70 |
+
|
| 71 |
+
def _print_MatMul(self, expr):
|
| 72 |
+
"Matrix multiplication printer"
|
| 73 |
+
if expr.as_coeff_matrices()[0] is not S.One:
|
| 74 |
+
expr_list = expr.as_coeff_matrices()[1]+[(expr.as_coeff_matrices()[0])]
|
| 75 |
+
return '({})'.format(').dot('.join(self._print(i) for i in expr_list))
|
| 76 |
+
return '({})'.format(').dot('.join(self._print(i) for i in expr.args))
|
| 77 |
+
|
| 78 |
+
def _print_MatPow(self, expr):
|
| 79 |
+
"Matrix power printer"
|
| 80 |
+
return '{}({}, {})'.format(self._module_format(self._module + '.linalg.matrix_power'),
|
| 81 |
+
self._print(expr.args[0]), self._print(expr.args[1]))
|
| 82 |
+
|
| 83 |
+
def _print_Inverse(self, expr):
|
| 84 |
+
"Matrix inverse printer"
|
| 85 |
+
return '{}({})'.format(self._module_format(self._module + '.linalg.inv'),
|
| 86 |
+
self._print(expr.args[0]))
|
| 87 |
+
|
| 88 |
+
def _print_DotProduct(self, expr):
|
| 89 |
+
# DotProduct allows any shape order, but numpy.dot does matrix
|
| 90 |
+
# multiplication, so we have to make sure it gets 1 x n by n x 1.
|
| 91 |
+
arg1, arg2 = expr.args
|
| 92 |
+
if arg1.shape[0] != 1:
|
| 93 |
+
arg1 = arg1.T
|
| 94 |
+
if arg2.shape[1] != 1:
|
| 95 |
+
arg2 = arg2.T
|
| 96 |
+
|
| 97 |
+
return "%s(%s, %s)" % (self._module_format(self._module + '.dot'),
|
| 98 |
+
self._print(arg1),
|
| 99 |
+
self._print(arg2))
|
| 100 |
+
|
| 101 |
+
def _print_MatrixSolve(self, expr):
|
| 102 |
+
return "%s(%s, %s)" % (self._module_format(self._module + '.linalg.solve'),
|
| 103 |
+
self._print(expr.matrix),
|
| 104 |
+
self._print(expr.vector))
|
| 105 |
+
|
| 106 |
+
def _print_ZeroMatrix(self, expr):
|
| 107 |
+
return '{}({})'.format(self._module_format(self._module + '.zeros'),
|
| 108 |
+
self._print(expr.shape))
|
| 109 |
+
|
| 110 |
+
def _print_OneMatrix(self, expr):
|
| 111 |
+
return '{}({})'.format(self._module_format(self._module + '.ones'),
|
| 112 |
+
self._print(expr.shape))
|
| 113 |
+
|
| 114 |
+
def _print_FunctionMatrix(self, expr):
|
| 115 |
+
from sympy.abc import i, j
|
| 116 |
+
lamda = expr.lamda
|
| 117 |
+
if not isinstance(lamda, Lambda):
|
| 118 |
+
lamda = Lambda((i, j), lamda(i, j))
|
| 119 |
+
return '{}(lambda {}: {}, {})'.format(self._module_format(self._module + '.fromfunction'),
|
| 120 |
+
', '.join(self._print(arg) for arg in lamda.args[0]),
|
| 121 |
+
self._print(lamda.args[1]), self._print(expr.shape))
|
| 122 |
+
|
| 123 |
+
def _print_HadamardProduct(self, expr):
|
| 124 |
+
func = self._module_format(self._module + '.multiply')
|
| 125 |
+
return ''.join('{}({}, '.format(func, self._print(arg)) \
|
| 126 |
+
for arg in expr.args[:-1]) + "{}{}".format(self._print(expr.args[-1]),
|
| 127 |
+
')' * (len(expr.args) - 1))
|
| 128 |
+
|
| 129 |
+
def _print_KroneckerProduct(self, expr):
|
| 130 |
+
func = self._module_format(self._module + '.kron')
|
| 131 |
+
return ''.join('{}({}, '.format(func, self._print(arg)) \
|
| 132 |
+
for arg in expr.args[:-1]) + "{}{}".format(self._print(expr.args[-1]),
|
| 133 |
+
')' * (len(expr.args) - 1))
|
| 134 |
+
|
| 135 |
+
def _print_Adjoint(self, expr):
|
| 136 |
+
return '{}({}({}))'.format(
|
| 137 |
+
self._module_format(self._module + '.conjugate'),
|
| 138 |
+
self._module_format(self._module + '.transpose'),
|
| 139 |
+
self._print(expr.args[0]))
|
| 140 |
+
|
| 141 |
+
def _print_DiagonalOf(self, expr):
|
| 142 |
+
vect = '{}({})'.format(
|
| 143 |
+
self._module_format(self._module + '.diag'),
|
| 144 |
+
self._print(expr.arg))
|
| 145 |
+
return '{}({}, (-1, 1))'.format(
|
| 146 |
+
self._module_format(self._module + '.reshape'), vect)
|
| 147 |
+
|
| 148 |
+
def _print_DiagMatrix(self, expr):
|
| 149 |
+
return '{}({})'.format(self._module_format(self._module + '.diagflat'),
|
| 150 |
+
self._print(expr.args[0]))
|
| 151 |
+
|
| 152 |
+
def _print_DiagonalMatrix(self, expr):
|
| 153 |
+
return '{}({}, {}({}, {}))'.format(self._module_format(self._module + '.multiply'),
|
| 154 |
+
self._print(expr.arg), self._module_format(self._module + '.eye'),
|
| 155 |
+
self._print(expr.shape[0]), self._print(expr.shape[1]))
|
| 156 |
+
|
| 157 |
+
def _print_Piecewise(self, expr):
|
| 158 |
+
"Piecewise function printer"
|
| 159 |
+
from sympy.logic.boolalg import ITE, simplify_logic
|
| 160 |
+
def print_cond(cond):
|
| 161 |
+
""" Problem having an ITE in the cond. """
|
| 162 |
+
if cond.has(ITE):
|
| 163 |
+
return self._print(simplify_logic(cond))
|
| 164 |
+
else:
|
| 165 |
+
return self._print(cond)
|
| 166 |
+
exprs = '[{}]'.format(','.join(self._print(arg.expr) for arg in expr.args))
|
| 167 |
+
conds = '[{}]'.format(','.join(print_cond(arg.cond) for arg in expr.args))
|
| 168 |
+
# If [default_value, True] is a (expr, cond) sequence in a Piecewise object
|
| 169 |
+
# it will behave the same as passing the 'default' kwarg to select()
|
| 170 |
+
# *as long as* it is the last element in expr.args.
|
| 171 |
+
# If this is not the case, it may be triggered prematurely.
|
| 172 |
+
return '{}({}, {}, default={})'.format(
|
| 173 |
+
self._module_format(self._module + '.select'), conds, exprs,
|
| 174 |
+
self._print(S.NaN))
|
| 175 |
+
|
| 176 |
+
def _print_Relational(self, expr):
|
| 177 |
+
"Relational printer for Equality and Unequality"
|
| 178 |
+
op = {
|
| 179 |
+
'==' :'equal',
|
| 180 |
+
'!=' :'not_equal',
|
| 181 |
+
'<' :'less',
|
| 182 |
+
'<=' :'less_equal',
|
| 183 |
+
'>' :'greater',
|
| 184 |
+
'>=' :'greater_equal',
|
| 185 |
+
}
|
| 186 |
+
if expr.rel_op in op:
|
| 187 |
+
lhs = self._print(expr.lhs)
|
| 188 |
+
rhs = self._print(expr.rhs)
|
| 189 |
+
return '{op}({lhs}, {rhs})'.format(op=self._module_format(self._module + '.'+op[expr.rel_op]),
|
| 190 |
+
lhs=lhs, rhs=rhs)
|
| 191 |
+
return super()._print_Relational(expr)
|
| 192 |
+
|
| 193 |
+
def _print_And(self, expr):
|
| 194 |
+
"Logical And printer"
|
| 195 |
+
# We have to override LambdaPrinter because it uses Python 'and' keyword.
|
| 196 |
+
# If LambdaPrinter didn't define it, we could use StrPrinter's
|
| 197 |
+
# version of the function and add 'logical_and' to NUMPY_TRANSLATIONS.
|
| 198 |
+
return '{}.reduce(({}))'.format(self._module_format(self._module + '.logical_and'), ','.join(self._print(i) for i in expr.args))
|
| 199 |
+
|
| 200 |
+
def _print_Or(self, expr):
|
| 201 |
+
"Logical Or printer"
|
| 202 |
+
# We have to override LambdaPrinter because it uses Python 'or' keyword.
|
| 203 |
+
# If LambdaPrinter didn't define it, we could use StrPrinter's
|
| 204 |
+
# version of the function and add 'logical_or' to NUMPY_TRANSLATIONS.
|
| 205 |
+
return '{}.reduce(({}))'.format(self._module_format(self._module + '.logical_or'), ','.join(self._print(i) for i in expr.args))
|
| 206 |
+
|
| 207 |
+
def _print_Not(self, expr):
|
| 208 |
+
"Logical Not printer"
|
| 209 |
+
# We have to override LambdaPrinter because it uses Python 'not' keyword.
|
| 210 |
+
# If LambdaPrinter didn't define it, we would still have to define our
|
| 211 |
+
# own because StrPrinter doesn't define it.
|
| 212 |
+
return '{}({})'.format(self._module_format(self._module + '.logical_not'), ','.join(self._print(i) for i in expr.args))
|
| 213 |
+
|
| 214 |
+
def _print_Pow(self, expr, rational=False):
|
| 215 |
+
# XXX Workaround for negative integer power error
|
| 216 |
+
if expr.exp.is_integer and expr.exp.is_negative:
|
| 217 |
+
expr = Pow(expr.base, expr.exp.evalf(), evaluate=False)
|
| 218 |
+
return self._hprint_Pow(expr, rational=rational, sqrt=self._module + '.sqrt')
|
| 219 |
+
|
| 220 |
+
def _helper_minimum_maximum(self, op: str, *args):
|
| 221 |
+
if len(args) == 0:
|
| 222 |
+
raise NotImplementedError(f"Need at least one argument for {op}")
|
| 223 |
+
elif len(args) == 1:
|
| 224 |
+
return self._print(args[0])
|
| 225 |
+
_reduce = self._module_format('functools.reduce')
|
| 226 |
+
s_args = [self._print(arg) for arg in args]
|
| 227 |
+
return f"{_reduce}({op}, [{', '.join(s_args)}])"
|
| 228 |
+
|
| 229 |
+
def _print_Min(self, expr):
|
| 230 |
+
return self._print_minimum(expr)
|
| 231 |
+
|
| 232 |
+
def _print_amin(self, expr):
|
| 233 |
+
return '{}({}, axis={})'.format(self._module_format(self._module + '.amin'), self._print(expr.array), self._print(expr.axis))
|
| 234 |
+
|
| 235 |
+
def _print_minimum(self, expr):
|
| 236 |
+
op = self._module_format(self._module + '.minimum')
|
| 237 |
+
return self._helper_minimum_maximum(op, *expr.args)
|
| 238 |
+
|
| 239 |
+
def _print_Max(self, expr):
|
| 240 |
+
return self._print_maximum(expr)
|
| 241 |
+
|
| 242 |
+
def _print_amax(self, expr):
|
| 243 |
+
return '{}({}, axis={})'.format(self._module_format(self._module + '.amax'), self._print(expr.array), self._print(expr.axis))
|
| 244 |
+
|
| 245 |
+
def _print_maximum(self, expr):
|
| 246 |
+
op = self._module_format(self._module + '.maximum')
|
| 247 |
+
return self._helper_minimum_maximum(op, *expr.args)
|
| 248 |
+
|
| 249 |
+
def _print_arg(self, expr):
|
| 250 |
+
return "%s(%s)" % (self._module_format(self._module + '.angle'), self._print(expr.args[0]))
|
| 251 |
+
|
| 252 |
+
def _print_im(self, expr):
|
| 253 |
+
return "%s(%s)" % (self._module_format(self._module + '.imag'), self._print(expr.args[0]))
|
| 254 |
+
|
| 255 |
+
def _print_Mod(self, expr):
|
| 256 |
+
return "%s(%s)" % (self._module_format(self._module + '.mod'), ', '.join(
|
| 257 |
+
(self._print(arg) for arg in expr.args)))
|
| 258 |
+
|
| 259 |
+
def _print_re(self, expr):
|
| 260 |
+
return "%s(%s)" % (self._module_format(self._module + '.real'), self._print(expr.args[0]))
|
| 261 |
+
|
| 262 |
+
def _print_sinc(self, expr):
|
| 263 |
+
return "%s(%s)" % (self._module_format(self._module + '.sinc'), self._print(expr.args[0]/S.Pi))
|
| 264 |
+
|
| 265 |
+
def _print_MatrixBase(self, expr):
|
| 266 |
+
if 0 in expr.shape:
|
| 267 |
+
func = self._module_format(f'{self._module}.{self._zeros}')
|
| 268 |
+
return f"{func}({self._print(expr.shape)})"
|
| 269 |
+
func = self.known_functions.get(expr.__class__.__name__, None)
|
| 270 |
+
if func is None:
|
| 271 |
+
func = self._module_format(f'{self._module}.array')
|
| 272 |
+
return "%s(%s)" % (func, self._print(expr.tolist()))
|
| 273 |
+
|
| 274 |
+
def _print_Identity(self, expr):
|
| 275 |
+
shape = expr.shape
|
| 276 |
+
if all(dim.is_Integer for dim in shape):
|
| 277 |
+
return "%s(%s)" % (self._module_format(self._module + '.eye'), self._print(expr.shape[0]))
|
| 278 |
+
else:
|
| 279 |
+
raise NotImplementedError("Symbolic matrix dimensions are not yet supported for identity matrices")
|
| 280 |
+
|
| 281 |
+
def _print_BlockMatrix(self, expr):
|
| 282 |
+
return '{}({})'.format(self._module_format(self._module + '.block'),
|
| 283 |
+
self._print(expr.args[0].tolist()))
|
| 284 |
+
|
| 285 |
+
def _print_NDimArray(self, expr):
|
| 286 |
+
if expr.rank() == 0:
|
| 287 |
+
func = self._module_format(f'{self._module}.array')
|
| 288 |
+
return f"{func}({self._print(expr[()])})"
|
| 289 |
+
if 0 in expr.shape:
|
| 290 |
+
func = self._module_format(f'{self._module}.{self._zeros}')
|
| 291 |
+
return f"{func}({self._print(expr.shape)})"
|
| 292 |
+
func = self._module_format(f'{self._module}.array')
|
| 293 |
+
return f"{func}({self._print(expr.tolist())})"
|
| 294 |
+
|
| 295 |
+
_add = "add"
|
| 296 |
+
_einsum = "einsum"
|
| 297 |
+
_transpose = "transpose"
|
| 298 |
+
_ones = "ones"
|
| 299 |
+
_zeros = "zeros"
|
| 300 |
+
|
| 301 |
+
_print_lowergamma = CodePrinter._print_not_supported
|
| 302 |
+
_print_uppergamma = CodePrinter._print_not_supported
|
| 303 |
+
_print_fresnelc = CodePrinter._print_not_supported
|
| 304 |
+
_print_fresnels = CodePrinter._print_not_supported
|
| 305 |
+
|
| 306 |
+
for func in _numpy_known_functions:
|
| 307 |
+
setattr(NumPyPrinter, f'_print_{func}', _print_known_func)
|
| 308 |
+
|
| 309 |
+
for const in _numpy_known_constants:
|
| 310 |
+
setattr(NumPyPrinter, f'_print_{const}', _print_known_const)
|
| 311 |
+
|
| 312 |
+
|
| 313 |
+
_known_functions_scipy_special = {
|
| 314 |
+
'Ei': 'expi',
|
| 315 |
+
'erf': 'erf',
|
| 316 |
+
'erfc': 'erfc',
|
| 317 |
+
'besselj': 'jv',
|
| 318 |
+
'bessely': 'yv',
|
| 319 |
+
'besseli': 'iv',
|
| 320 |
+
'besselk': 'kv',
|
| 321 |
+
'cosm1': 'cosm1',
|
| 322 |
+
'powm1': 'powm1',
|
| 323 |
+
'factorial': 'factorial',
|
| 324 |
+
'gamma': 'gamma',
|
| 325 |
+
'loggamma': 'gammaln',
|
| 326 |
+
'digamma': 'psi',
|
| 327 |
+
'polygamma': 'polygamma',
|
| 328 |
+
'RisingFactorial': 'poch',
|
| 329 |
+
'jacobi': 'eval_jacobi',
|
| 330 |
+
'gegenbauer': 'eval_gegenbauer',
|
| 331 |
+
'chebyshevt': 'eval_chebyt',
|
| 332 |
+
'chebyshevu': 'eval_chebyu',
|
| 333 |
+
'legendre': 'eval_legendre',
|
| 334 |
+
'hermite': 'eval_hermite',
|
| 335 |
+
'laguerre': 'eval_laguerre',
|
| 336 |
+
'assoc_laguerre': 'eval_genlaguerre',
|
| 337 |
+
'beta': 'beta',
|
| 338 |
+
'LambertW' : 'lambertw',
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
_known_constants_scipy_constants = {
|
| 342 |
+
'GoldenRatio': 'golden_ratio',
|
| 343 |
+
'Pi': 'pi',
|
| 344 |
+
}
|
| 345 |
+
_scipy_known_functions = {k : "scipy.special." + v for k, v in _known_functions_scipy_special.items()}
|
| 346 |
+
_scipy_known_constants = {k : "scipy.constants." + v for k, v in _known_constants_scipy_constants.items()}
|
| 347 |
+
|
| 348 |
+
class SciPyPrinter(NumPyPrinter):
|
| 349 |
+
|
| 350 |
+
_kf = {**NumPyPrinter._kf, **_scipy_known_functions}
|
| 351 |
+
_kc = {**NumPyPrinter._kc, **_scipy_known_constants}
|
| 352 |
+
|
| 353 |
+
def __init__(self, settings=None):
|
| 354 |
+
super().__init__(settings=settings)
|
| 355 |
+
self.language = "Python with SciPy and NumPy"
|
| 356 |
+
|
| 357 |
+
def _print_SparseRepMatrix(self, expr):
|
| 358 |
+
i, j, data = [], [], []
|
| 359 |
+
for (r, c), v in expr.todok().items():
|
| 360 |
+
i.append(r)
|
| 361 |
+
j.append(c)
|
| 362 |
+
data.append(v)
|
| 363 |
+
|
| 364 |
+
return "{name}(({data}, ({i}, {j})), shape={shape})".format(
|
| 365 |
+
name=self._module_format('scipy.sparse.coo_matrix'),
|
| 366 |
+
data=data, i=i, j=j, shape=expr.shape
|
| 367 |
+
)
|
| 368 |
+
|
| 369 |
+
_print_ImmutableSparseMatrix = _print_SparseRepMatrix
|
| 370 |
+
|
| 371 |
+
# SciPy's lpmv has a different order of arguments from assoc_legendre
|
| 372 |
+
def _print_assoc_legendre(self, expr):
|
| 373 |
+
return "{0}({2}, {1}, {3})".format(
|
| 374 |
+
self._module_format('scipy.special.lpmv'),
|
| 375 |
+
self._print(expr.args[0]),
|
| 376 |
+
self._print(expr.args[1]),
|
| 377 |
+
self._print(expr.args[2]))
|
| 378 |
+
|
| 379 |
+
def _print_lowergamma(self, expr):
|
| 380 |
+
return "{0}({2})*{1}({2}, {3})".format(
|
| 381 |
+
self._module_format('scipy.special.gamma'),
|
| 382 |
+
self._module_format('scipy.special.gammainc'),
|
| 383 |
+
self._print(expr.args[0]),
|
| 384 |
+
self._print(expr.args[1]))
|
| 385 |
+
|
| 386 |
+
def _print_uppergamma(self, expr):
|
| 387 |
+
return "{0}({2})*{1}({2}, {3})".format(
|
| 388 |
+
self._module_format('scipy.special.gamma'),
|
| 389 |
+
self._module_format('scipy.special.gammaincc'),
|
| 390 |
+
self._print(expr.args[0]),
|
| 391 |
+
self._print(expr.args[1]))
|
| 392 |
+
|
| 393 |
+
def _print_betainc(self, expr):
|
| 394 |
+
betainc = self._module_format('scipy.special.betainc')
|
| 395 |
+
beta = self._module_format('scipy.special.beta')
|
| 396 |
+
args = [self._print(arg) for arg in expr.args]
|
| 397 |
+
return f"({betainc}({args[0]}, {args[1]}, {args[3]}) - {betainc}({args[0]}, {args[1]}, {args[2]})) \
|
| 398 |
+
* {beta}({args[0]}, {args[1]})"
|
| 399 |
+
|
| 400 |
+
def _print_betainc_regularized(self, expr):
|
| 401 |
+
return "{0}({1}, {2}, {4}) - {0}({1}, {2}, {3})".format(
|
| 402 |
+
self._module_format('scipy.special.betainc'),
|
| 403 |
+
self._print(expr.args[0]),
|
| 404 |
+
self._print(expr.args[1]),
|
| 405 |
+
self._print(expr.args[2]),
|
| 406 |
+
self._print(expr.args[3]))
|
| 407 |
+
|
| 408 |
+
def _print_fresnels(self, expr):
|
| 409 |
+
return "{}({})[0]".format(
|
| 410 |
+
self._module_format("scipy.special.fresnel"),
|
| 411 |
+
self._print(expr.args[0]))
|
| 412 |
+
|
| 413 |
+
def _print_fresnelc(self, expr):
|
| 414 |
+
return "{}({})[1]".format(
|
| 415 |
+
self._module_format("scipy.special.fresnel"),
|
| 416 |
+
self._print(expr.args[0]))
|
| 417 |
+
|
| 418 |
+
def _print_airyai(self, expr):
|
| 419 |
+
return "{}({})[0]".format(
|
| 420 |
+
self._module_format("scipy.special.airy"),
|
| 421 |
+
self._print(expr.args[0]))
|
| 422 |
+
|
| 423 |
+
def _print_airyaiprime(self, expr):
|
| 424 |
+
return "{}({})[1]".format(
|
| 425 |
+
self._module_format("scipy.special.airy"),
|
| 426 |
+
self._print(expr.args[0]))
|
| 427 |
+
|
| 428 |
+
def _print_airybi(self, expr):
|
| 429 |
+
return "{}({})[2]".format(
|
| 430 |
+
self._module_format("scipy.special.airy"),
|
| 431 |
+
self._print(expr.args[0]))
|
| 432 |
+
|
| 433 |
+
def _print_airybiprime(self, expr):
|
| 434 |
+
return "{}({})[3]".format(
|
| 435 |
+
self._module_format("scipy.special.airy"),
|
| 436 |
+
self._print(expr.args[0]))
|
| 437 |
+
|
| 438 |
+
def _print_bernoulli(self, expr):
|
| 439 |
+
# scipy's bernoulli is inconsistent with SymPy's so rewrite
|
| 440 |
+
return self._print(expr._eval_rewrite_as_zeta(*expr.args))
|
| 441 |
+
|
| 442 |
+
def _print_harmonic(self, expr):
|
| 443 |
+
return self._print(expr._eval_rewrite_as_zeta(*expr.args))
|
| 444 |
+
|
| 445 |
+
def _print_Integral(self, e):
|
| 446 |
+
integration_vars, limits = _unpack_integral_limits(e)
|
| 447 |
+
|
| 448 |
+
if len(limits) == 1:
|
| 449 |
+
# nicer (but not necessary) to prefer quad over nquad for 1D case
|
| 450 |
+
module_str = self._module_format("scipy.integrate.quad")
|
| 451 |
+
limit_str = "%s, %s" % tuple(map(self._print, limits[0]))
|
| 452 |
+
else:
|
| 453 |
+
module_str = self._module_format("scipy.integrate.nquad")
|
| 454 |
+
limit_str = "({})".format(", ".join(
|
| 455 |
+
"(%s, %s)" % tuple(map(self._print, l)) for l in limits))
|
| 456 |
+
|
| 457 |
+
return "{}(lambda {}: {}, {})[0]".format(
|
| 458 |
+
module_str,
|
| 459 |
+
", ".join(map(self._print, integration_vars)),
|
| 460 |
+
self._print(e.args[0]),
|
| 461 |
+
limit_str)
|
| 462 |
+
|
| 463 |
+
def _print_Si(self, expr):
|
| 464 |
+
return "{}({})[0]".format(
|
| 465 |
+
self._module_format("scipy.special.sici"),
|
| 466 |
+
self._print(expr.args[0]))
|
| 467 |
+
|
| 468 |
+
def _print_Ci(self, expr):
|
| 469 |
+
return "{}({})[1]".format(
|
| 470 |
+
self._module_format("scipy.special.sici"),
|
| 471 |
+
self._print(expr.args[0]))
|
| 472 |
+
|
| 473 |
+
for func in _scipy_known_functions:
|
| 474 |
+
setattr(SciPyPrinter, f'_print_{func}', _print_known_func)
|
| 475 |
+
|
| 476 |
+
for const in _scipy_known_constants:
|
| 477 |
+
setattr(SciPyPrinter, f'_print_{const}', _print_known_const)
|
| 478 |
+
|
| 479 |
+
|
| 480 |
+
_cupy_known_functions = {k : "cupy." + v for k, v in _known_functions_numpy.items()}
|
| 481 |
+
_cupy_known_constants = {k : "cupy." + v for k, v in _known_constants_numpy.items()}
|
| 482 |
+
|
| 483 |
+
class CuPyPrinter(NumPyPrinter):
|
| 484 |
+
"""
|
| 485 |
+
CuPy printer which handles vectorized piecewise functions,
|
| 486 |
+
logical operators, etc.
|
| 487 |
+
"""
|
| 488 |
+
|
| 489 |
+
_module = 'cupy'
|
| 490 |
+
_kf = _cupy_known_functions
|
| 491 |
+
_kc = _cupy_known_constants
|
| 492 |
+
|
| 493 |
+
def __init__(self, settings=None):
|
| 494 |
+
super().__init__(settings=settings)
|
| 495 |
+
|
| 496 |
+
for func in _cupy_known_functions:
|
| 497 |
+
setattr(CuPyPrinter, f'_print_{func}', _print_known_func)
|
| 498 |
+
|
| 499 |
+
for const in _cupy_known_constants:
|
| 500 |
+
setattr(CuPyPrinter, f'_print_{const}', _print_known_const)
|
| 501 |
+
|
| 502 |
+
|
| 503 |
+
_jax_known_functions = {k: 'jax.numpy.' + v for k, v in _known_functions_numpy.items()}
|
| 504 |
+
_jax_known_constants = {k: 'jax.numpy.' + v for k, v in _known_constants_numpy.items()}
|
| 505 |
+
|
| 506 |
+
class JaxPrinter(NumPyPrinter):
|
| 507 |
+
"""
|
| 508 |
+
JAX printer which handles vectorized piecewise functions,
|
| 509 |
+
logical operators, etc.
|
| 510 |
+
"""
|
| 511 |
+
_module = "jax.numpy"
|
| 512 |
+
|
| 513 |
+
_kf = _jax_known_functions
|
| 514 |
+
_kc = _jax_known_constants
|
| 515 |
+
|
| 516 |
+
def __init__(self, settings=None):
|
| 517 |
+
super().__init__(settings=settings)
|
| 518 |
+
self.printmethod = '_jaxcode'
|
| 519 |
+
|
| 520 |
+
# These need specific override to allow for the lack of "jax.numpy.reduce"
|
| 521 |
+
def _print_And(self, expr):
|
| 522 |
+
"Logical And printer"
|
| 523 |
+
return "{}({}.asarray([{}]), axis=0)".format(
|
| 524 |
+
self._module_format(self._module + ".all"),
|
| 525 |
+
self._module_format(self._module),
|
| 526 |
+
",".join(self._print(i) for i in expr.args),
|
| 527 |
+
)
|
| 528 |
+
|
| 529 |
+
def _print_Or(self, expr):
|
| 530 |
+
"Logical Or printer"
|
| 531 |
+
return "{}({}.asarray([{}]), axis=0)".format(
|
| 532 |
+
self._module_format(self._module + ".any"),
|
| 533 |
+
self._module_format(self._module),
|
| 534 |
+
",".join(self._print(i) for i in expr.args),
|
| 535 |
+
)
|
| 536 |
+
|
| 537 |
+
for func in _jax_known_functions:
|
| 538 |
+
setattr(JaxPrinter, f'_print_{func}', _print_known_func)
|
| 539 |
+
|
| 540 |
+
for const in _jax_known_constants:
|
| 541 |
+
setattr(JaxPrinter, f'_print_{const}', _print_known_const)
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/000078.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 78,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": [
|
| 5 |
+
{
|
| 6 |
+
"frame_idx": 78,
|
| 7 |
+
"class": "box",
|
| 8 |
+
"bbox": [
|
| 9 |
+
697.0,
|
| 10 |
+
87.0,
|
| 11 |
+
1280.0,
|
| 12 |
+
555.0
|
| 13 |
+
],
|
| 14 |
+
"score": 0.9500463008880615,
|
| 15 |
+
"track_id": "auto-0"
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"frame_idx": 78,
|
| 19 |
+
"class": "box",
|
| 20 |
+
"bbox": [
|
| 21 |
+
0.0,
|
| 22 |
+
274.0,
|
| 23 |
+
81.0,
|
| 24 |
+
447.0
|
| 25 |
+
],
|
| 26 |
+
"score": 0.5330366492271423,
|
| 27 |
+
"track_id": "auto-1"
|
| 28 |
+
}
|
| 29 |
+
]
|
| 30 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/000428.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 428,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001014.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 1014,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001151.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 1151,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001239.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 1239,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001393.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 1393,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001444.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 1444,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001501.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 1501,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/001669.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 1669,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/002415.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 2415,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/002946.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 2946,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/003029.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 3029,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/003183.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 3183,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": [
|
| 5 |
+
{
|
| 6 |
+
"frame_idx": 3183,
|
| 7 |
+
"class": "box",
|
| 8 |
+
"bbox": [
|
| 9 |
+
0.0,
|
| 10 |
+
166.0,
|
| 11 |
+
209.0,
|
| 12 |
+
464.0
|
| 13 |
+
],
|
| 14 |
+
"score": 0.8340244889259338,
|
| 15 |
+
"track_id": "auto-0"
|
| 16 |
+
}
|
| 17 |
+
]
|
| 18 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/003204.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 3204,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": [
|
| 5 |
+
{
|
| 6 |
+
"frame_idx": 3204,
|
| 7 |
+
"class": "box",
|
| 8 |
+
"bbox": [
|
| 9 |
+
771.0,
|
| 10 |
+
0.0,
|
| 11 |
+
1277.0,
|
| 12 |
+
456.0
|
| 13 |
+
],
|
| 14 |
+
"score": 0.9126523733139038,
|
| 15 |
+
"track_id": "auto-0"
|
| 16 |
+
}
|
| 17 |
+
]
|
| 18 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/003479.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 3479,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/003654.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 3654,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": [
|
| 5 |
+
{
|
| 6 |
+
"frame_idx": 3654,
|
| 7 |
+
"class": "qr code",
|
| 8 |
+
"bbox": [
|
| 9 |
+
436.0,
|
| 10 |
+
384.0,
|
| 11 |
+
538.0,
|
| 12 |
+
460.0
|
| 13 |
+
],
|
| 14 |
+
"score": 0.963688850402832,
|
| 15 |
+
"track_id": "auto-0"
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"frame_idx": 3654,
|
| 19 |
+
"class": "box",
|
| 20 |
+
"bbox": [
|
| 21 |
+
25.0,
|
| 22 |
+
79.0,
|
| 23 |
+
1239.0,
|
| 24 |
+
552.0
|
| 25 |
+
],
|
| 26 |
+
"score": 0.8786520957946777,
|
| 27 |
+
"track_id": "auto-1"
|
| 28 |
+
}
|
| 29 |
+
]
|
| 30 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004191.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 4191,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004216.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 4216,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004353.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 4353,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004646.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 4646,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004703.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 4703,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": [
|
| 5 |
+
{
|
| 6 |
+
"frame_idx": 4703,
|
| 7 |
+
"class": "qr code",
|
| 8 |
+
"bbox": [
|
| 9 |
+
1113.0,
|
| 10 |
+
296.0,
|
| 11 |
+
1191.0,
|
| 12 |
+
366.0
|
| 13 |
+
],
|
| 14 |
+
"score": 0.9263305068016052,
|
| 15 |
+
"track_id": "auto-0"
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"frame_idx": 4703,
|
| 19 |
+
"class": "box",
|
| 20 |
+
"bbox": [
|
| 21 |
+
718.0,
|
| 22 |
+
0.0,
|
| 23 |
+
1280.0,
|
| 24 |
+
458.0
|
| 25 |
+
],
|
| 26 |
+
"score": 0.9188398122787476,
|
| 27 |
+
"track_id": "auto-1"
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"frame_idx": 4703,
|
| 31 |
+
"class": "box",
|
| 32 |
+
"bbox": [
|
| 33 |
+
0.0,
|
| 34 |
+
190.0,
|
| 35 |
+
422.0,
|
| 36 |
+
598.0
|
| 37 |
+
],
|
| 38 |
+
"score": 0.9017043709754944,
|
| 39 |
+
"track_id": "auto-2"
|
| 40 |
+
}
|
| 41 |
+
]
|
| 42 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004892.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 4892,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/004938.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 4938,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/005780.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 5780,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/005811.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 5811,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/006006.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 6006,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/006381.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 6381,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/006456.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 6456,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/006694.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 6694,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/006905.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 6905,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/007617.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 7617,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": [
|
| 5 |
+
{
|
| 6 |
+
"frame_idx": 7617,
|
| 7 |
+
"class": "qr code",
|
| 8 |
+
"bbox": [
|
| 9 |
+
471.0,
|
| 10 |
+
359.0,
|
| 11 |
+
573.0,
|
| 12 |
+
433.0
|
| 13 |
+
],
|
| 14 |
+
"score": 0.9071722030639648,
|
| 15 |
+
"track_id": "auto-0"
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"frame_idx": 7617,
|
| 19 |
+
"class": "box",
|
| 20 |
+
"bbox": [
|
| 21 |
+
18.0,
|
| 22 |
+
79.0,
|
| 23 |
+
1280.0,
|
| 24 |
+
551.0
|
| 25 |
+
],
|
| 26 |
+
"score": 0.7447725534439087,
|
| 27 |
+
"track_id": "auto-1"
|
| 28 |
+
}
|
| 29 |
+
]
|
| 30 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/007986.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 7986,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": [
|
| 5 |
+
{
|
| 6 |
+
"frame_idx": 7986,
|
| 7 |
+
"class": "box",
|
| 8 |
+
"bbox": [
|
| 9 |
+
296.0,
|
| 10 |
+
169.0,
|
| 11 |
+
1280.0,
|
| 12 |
+
618.0
|
| 13 |
+
],
|
| 14 |
+
"score": 0.8656734824180603,
|
| 15 |
+
"track_id": "auto-0"
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"frame_idx": 7986,
|
| 19 |
+
"class": "box",
|
| 20 |
+
"bbox": [
|
| 21 |
+
0.0,
|
| 22 |
+
270.0,
|
| 23 |
+
84.0,
|
| 24 |
+
451.0
|
| 25 |
+
],
|
| 26 |
+
"score": 0.515254557132721,
|
| 27 |
+
"track_id": "auto-1"
|
| 28 |
+
}
|
| 29 |
+
]
|
| 30 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/008018.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 8018,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": [
|
| 5 |
+
{
|
| 6 |
+
"frame_idx": 8018,
|
| 7 |
+
"class": "box",
|
| 8 |
+
"bbox": [
|
| 9 |
+
868.0,
|
| 10 |
+
100.0,
|
| 11 |
+
1280.0,
|
| 12 |
+
493.0
|
| 13 |
+
],
|
| 14 |
+
"score": 0.9315822720527649,
|
| 15 |
+
"track_id": "auto-0"
|
| 16 |
+
}
|
| 17 |
+
]
|
| 18 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/008448.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 8448,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/009074.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 9074,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/009131.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 9131,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/009259.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 9259,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/009424.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 9424,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": [
|
| 5 |
+
{
|
| 6 |
+
"frame_idx": 9424,
|
| 7 |
+
"class": "box",
|
| 8 |
+
"bbox": [
|
| 9 |
+
971.0,
|
| 10 |
+
0.0,
|
| 11 |
+
1280.0,
|
| 12 |
+
449.0
|
| 13 |
+
],
|
| 14 |
+
"score": 0.8857800960540771,
|
| 15 |
+
"track_id": "auto-0"
|
| 16 |
+
}
|
| 17 |
+
]
|
| 18 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/009561.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 9561,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/009609.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 9609,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": [
|
| 5 |
+
{
|
| 6 |
+
"frame_idx": 9609,
|
| 7 |
+
"class": "box",
|
| 8 |
+
"bbox": [
|
| 9 |
+
0.0,
|
| 10 |
+
0.0,
|
| 11 |
+
509.0,
|
| 12 |
+
454.0
|
| 13 |
+
],
|
| 14 |
+
"score": 0.8452643156051636,
|
| 15 |
+
"track_id": "auto-0"
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"frame_idx": 9609,
|
| 19 |
+
"class": "box",
|
| 20 |
+
"bbox": [
|
| 21 |
+
0.0,
|
| 22 |
+
156.0,
|
| 23 |
+
1240.0,
|
| 24 |
+
623.0
|
| 25 |
+
],
|
| 26 |
+
"score": 0.7703803777694702,
|
| 27 |
+
"track_id": "auto-1"
|
| 28 |
+
}
|
| 29 |
+
]
|
| 30 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/010078.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 10078,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/010255.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 10255,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/010310.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 10310,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/010428.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 10428,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": [
|
| 5 |
+
{
|
| 6 |
+
"frame_idx": 10428,
|
| 7 |
+
"class": "box",
|
| 8 |
+
"bbox": [
|
| 9 |
+
0.0,
|
| 10 |
+
277.0,
|
| 11 |
+
67.0,
|
| 12 |
+
446.0
|
| 13 |
+
],
|
| 14 |
+
"score": 0.4784950613975525,
|
| 15 |
+
"track_id": "auto-0"
|
| 16 |
+
}
|
| 17 |
+
]
|
| 18 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/010582.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 10582,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/010605.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 10605,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/011239.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 11239,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|
video/video_2026-02-18T12-43-09Z/packhouse1_inline3/predictions/011393.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"frame_idx": 11393,
|
| 3 |
+
"image_key": "video/video_2026-02-18T12-43-09Z/packhouse1_inline3/annotated.mp4",
|
| 4 |
+
"predictions": []
|
| 5 |
+
}
|