public TinyYolo(NNModel nnModel, BarracudaWorkerFactory.Type type) { bool verbose = false; model = ModelLoader.Load(nnModel, verbose); Debug.Log(model); Debug.Log(model.inputs[0].name); worker = BarracudaWorkerFactory.CreateWorker(type, model, verbose); inputShape = new TensorShape(model.inputs[0].shape); textureToTensor = new TextureToTensor(); resizeOptions = new TextureToTensor.ResizeOptions() { width = inputShape.width, height = inputShape.height, rotationDegree = 0, flipX = false, flipY = false, aspectMode = TextureToTensor.AspectMode.Fill, }; inputAspect = (float)inputShape.width / (float)inputShape.height; results = new Result[25]; }
public Rect GetUVRect(float srcAspect) { return(TextureToTensor.GetUVRect(srcAspect, inputAspect, resizeOptions.aspectMode)); }