scorevision: push artifact
Browse files1234345676 unmodified lines141516171718192047 unmodified lines68697071727172737475"""Fallen-person detector for Score (Bittensor SN44, public track).
One class: "fallen person" (cls_id 0). weights.onnx is a YOLO26n detector, input 704 x 704, output[1, 5, 10164] = centre x, centre y, width, height, confidence per candidate, in input pixels.One class: "fallen person" (cls_id 0). weights.onnx is a YOLO26n detector, input 832 x 832, output[1, 5, candidates] = centre x, centre y, width, height, confidence per candidate, in input pixels.
Built to never fail a call: the model is checked with a test image at start-up (GPU first, CPU if the GPU runfails), and an image that cannot be processed gets an empty answer instead of an error."""6 unmodified linesfrom numpy import ndarrayfrom pydantic import BaseModel
CONF = 0.35 # boxes below this confidence are droppedCONF = 0.40 # boxes below this confidence are droppedNMS_IOU = 0.7 # of two boxes overlapping more than this, the weaker one is droppedMAX_BOXES = 30 # safety cap; the busiest image seen has 10 fallen peopleWEIGHTS = "weights.onnx"47 unmodified lines self.session = session i = session.get_inputs()[0] self.input_name = i.name self.h = i.shape[2] if isinstance(i.shape[2], int) else 704 self.w = i.shape[3] if isinstance(i.shape[3], int) else 704 self.h = i.shape[2] if isinstance(i.shape[2], int) else 832 self.w = i.shape[3] if isinstance(i.shape[3], int) else 832
def __repr__(self) -> str: return f"fallen-person YOLO26n {self.w}x{self.h} on {self.session.get_providers()[0]}, conf {CONF}"miner.py+5-5