scorevision: push artifact
Browse files12345676 unmodified lines1415161718192047 unmodified lines6869707172737475"""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.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 BaseModelCONF = 0.35 # 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 linesself.session = sessioni = session.get_inputs()[0]self.input_name = i.nameself.h = i.shape[2] if isinstance(i.shape[2], int) else 704self.w = i.shape[3] if isinstance(i.shape[3], int) else 704def __repr__(self) -> str:return f"fallen-person YOLO26n {self.w}x{self.h} on {self.session.get_providers()[0]}, conf {CONF}"12345676 unmodified lines1415161718192047 unmodified lines6869707172737475"""Fallen-person detector for Score (Bittensor SN44, public track).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 BaseModelCONF = 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 linesself.session = sessioni = session.get_inputs()[0]self.input_name = i.nameself.h = i.shape[2] if isinstance(i.shape[2], int) else 832self.w = i.shape[3] if isinstance(i.shape[3], int) else 832def __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