mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-28 02:13:45 +08:00
3cd55260d9
* commaai/openpilot:d05cb31e2e916fba41ba8167030945f427fd811b * bump opendbc * bump opendbc * bump opendbc * bump opendbc * bump opendbc * sunnypilot: remove Qt * cabana: revert to stock Qt * commaai/openpilot:5198b1b079c37742c1050f02ce0aa6dd42b038b9 * commaai/openpilot:954b567b9ba0f3d1ae57d6aa7797fa86dd92ec6e * commaai/openpilot:7534b2a160faa683412c04c1254440e338931c5e * sum more * bump opendbc * not yet * should've been symlink'ed * raylib says wut * quiet mode back * more fixes * no more * too extra red diff on the side * need to bring this back * too extra * let's update docs here * Revert "let's update docs here" This reverts commit 51fe03cd5121e6fdf14657b2c33852c34922b851. * del snpe * reset min for safety catch as we killed snpe * uhhh --------- Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
23 lines
832 B
Python
23 lines
832 B
Python
import os
|
|
from openpilot.system.hardware import TICI
|
|
from openpilot.sunnypilot.modeld.runners.runmodel_pyx import RunModel, Runtime
|
|
assert Runtime
|
|
|
|
USE_THNEED = int(os.getenv('USE_THNEED', str(int(TICI))))
|
|
|
|
class ModelRunner(RunModel):
|
|
THNEED = 'THNEED'
|
|
ONNX = 'ONNX'
|
|
|
|
def __new__(cls, paths, *args, **kwargs):
|
|
if ModelRunner.THNEED in paths and USE_THNEED:
|
|
from openpilot.sunnypilot.modeld.runners.thneedmodel_pyx import ThneedModel as Runner
|
|
runner_type = ModelRunner.THNEED
|
|
elif ModelRunner.ONNX in paths:
|
|
from openpilot.sunnypilot.modeld.runners.onnxmodel import ONNXModel as Runner
|
|
runner_type = ModelRunner.ONNX
|
|
else:
|
|
raise Exception("Couldn't select a model runner, make sure to pass at least one valid model path")
|
|
|
|
return Runner(str(paths[runner_type]), *args, **kwargs)
|