void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); if (!(scales.Value is OpenCVForUnityPlayMakerActions.MatOfFloat)) { LogError("scales is not initialized. Add Action \"newMatOfFloat\"."); return; } OpenCVForUnity.CoreModule.MatOfFloat wrapped_scales = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfFloat, OpenCVForUnity.CoreModule.MatOfFloat>(scales); if (!(zeropoints.Value is OpenCVForUnityPlayMakerActions.MatOfInt)) { LogError("zeropoints is not initialized. Add Action \"newMatOfInt\"."); return; } OpenCVForUnity.CoreModule.MatOfInt wrapped_zeropoints = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt, OpenCVForUnity.CoreModule.MatOfInt>(zeropoints); wrapped_owner.getInputDetails(wrapped_scales, wrapped_zeropoints); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); List <OpenCVForUnity.CoreModule.Mat> wrapped_outputBlobs = new List <OpenCVForUnity.CoreModule.Mat>(); OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToList <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(outputBlobs, wrapped_outputBlobs); string[] string_outBlobNames = outBlobNames.stringValues; List <string> wrapped_outBlobNames = new List <string>(string_outBlobNames); wrapped_owner.forward(wrapped_outputBlobs, wrapped_outBlobNames); OpenCVForUnityPlayMakerActionsUtils.ConvertListToFsmArray <OpenCVForUnity.CoreModule.Mat, OpenCVForUnityPlayMakerActions.Mat>(wrapped_outputBlobs, outputBlobs); for (int i = 0; i < wrapped_outBlobNames.Count; i++) { outBlobNames.Set(i, (string)wrapped_outBlobNames[i]); } outBlobNames.SaveChanges(); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); if (!(blob.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("blob is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_blob = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(blob); if (!(scalefactor.Value is OpenCVForUnityPlayMakerActions.Double)) { LogError("scalefactor is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_scalefactor = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Double, System.Double>(scalefactor); if (!(mean.Value is OpenCVForUnityPlayMakerActions.Scalar)) { LogError("mean is not initialized. Add Action \"newScalar\"."); return; } OpenCVForUnity.CoreModule.Scalar wrapped_mean = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Scalar, OpenCVForUnity.CoreModule.Scalar>(mean); wrapped_owner.setInput(wrapped_blob, name.Value, wrapped_scalefactor, wrapped_mean); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); if (!(netInputShape.Value is OpenCVForUnityPlayMakerActions.MatOfInt)) { LogError("netInputShape is not initialized. Add Action \"newMatOfInt\"."); return; } OpenCVForUnity.CoreModule.MatOfInt wrapped_netInputShape = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt, OpenCVForUnity.CoreModule.MatOfInt>(netInputShape); if (!(weights.Value is OpenCVForUnityPlayMakerActions.LongArray)) { LogError("weights is not initialized. Add Action \"newLongArray\"."); return; } System.Int64[] wrapped_weights = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.LongArray, System.Int64[]>(weights); if (!(blobs.Value is OpenCVForUnityPlayMakerActions.LongArray)) { LogError("blobs is not initialized. Add Action \"newLongArray\"."); return; } System.Int64[] wrapped_blobs = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.LongArray, System.Int64[]>(blobs); wrapped_owner.getMemoryConsumption(layerId.Value, wrapped_netInputShape, wrapped_weights, wrapped_blobs); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); wrapped_owner.enableFusion(fusion.Value); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); storeResult.Value = wrapped_owner.getLayerId(layer.Value); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); storeResult.Value = wrapped_owner.empty(); Fsm.Event(storeResult.Value ? trueEvent : falseEvent); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.Mat)) { storeResult.Value = new OpenCVForUnityPlayMakerActions.Mat(); } ((OpenCVForUnityPlayMakerActions.Mat)storeResult.Value).wrappedObject = wrapped_owner.forward(); }
void DoProcess() { if (!(network.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("network is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_network = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(network); if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.Model)) { storeResult.Value = new OpenCVForUnityPlayMakerActions.Model(); } ((OpenCVForUnityPlayMakerActions.Model)storeResult.Value).wrappedObject = new OpenCVForUnity.DnnModule.Model(wrapped_network); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); List <OpenCVForUnity.CoreModule.Mat> wrapped_outputBlobs = new List <OpenCVForUnity.CoreModule.Mat>(); OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToList <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(outputBlobs, wrapped_outputBlobs); wrapped_owner.forward(wrapped_outputBlobs, outputName.Value); OpenCVForUnityPlayMakerActionsUtils.ConvertListToFsmArray <OpenCVForUnity.CoreModule.Mat, OpenCVForUnityPlayMakerActions.Mat>(wrapped_outputBlobs, outputBlobs); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); List <OpenCVForUnity.CoreModule.MatOfInt> wrapped_netInputShapes = new List <OpenCVForUnity.CoreModule.MatOfInt>(); OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToList <OpenCVForUnityPlayMakerActions.MatOfInt, OpenCVForUnity.CoreModule.MatOfInt>(netInputShapes, wrapped_netInputShapes); storeResult.Value = (int)wrapped_owner.getFLOPS(layerId.Value, wrapped_netInputShapes); OpenCVForUnityPlayMakerActionsUtils.ConvertListToFsmArray <OpenCVForUnity.CoreModule.MatOfInt, OpenCVForUnityPlayMakerActions.MatOfInt>(wrapped_netInputShapes, netInputShapes); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); if (!(blob.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("blob is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_blob = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(blob); wrapped_owner.setInput(wrapped_blob); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); if (!(blob.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("blob is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_blob = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(blob); wrapped_owner.setInput(wrapped_blob, name.Value, (float)scalefactor.Value, new OpenCVForUnity.CoreModule.Scalar((double)mean_v0.Value, (double)mean_v1.Value, (double)mean_v2.Value, (double)mean_v3.Value)); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); if (!(timings.Value is OpenCVForUnityPlayMakerActions.MatOfDouble)) { LogError("timings is not initialized. Add Action \"newMatOfDouble\"."); return; } OpenCVForUnity.CoreModule.MatOfDouble wrapped_timings = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfDouble, OpenCVForUnity.CoreModule.MatOfDouble>(timings); storeResult.Value = (int)wrapped_owner.getPerfProfile(wrapped_timings); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); if (!(netInputShape.Value is OpenCVForUnityPlayMakerActions.MatOfInt)) { LogError("netInputShape is not initialized. Add Action \"newMatOfInt\"."); return; } OpenCVForUnity.CoreModule.MatOfInt wrapped_netInputShape = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt, OpenCVForUnity.CoreModule.MatOfInt>(netInputShape); storeResult.Value = (int)wrapped_owner.getFLOPS(wrapped_netInputShape); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); if (!(shape.Value is OpenCVForUnityPlayMakerActions.MatOfInt)) { LogError("shape is not initialized. Add Action \"newMatOfInt\"."); return; } OpenCVForUnity.CoreModule.MatOfInt wrapped_shape = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt, OpenCVForUnity.CoreModule.MatOfInt>(shape); wrapped_owner.setInputShape(inputName.Value, wrapped_shape); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); string[] string_inputBlobNames = inputBlobNames.stringValues; List <string> wrapped_inputBlobNames = new List <string>(string_inputBlobNames); wrapped_owner.setInputsNames(wrapped_inputBlobNames); for (int i = 0; i < wrapped_inputBlobNames.Count; i++) { inputBlobNames.Set(i, (string)wrapped_inputBlobNames[i]); } inputBlobNames.SaveChanges(); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); List <OpenCVForUnity.CoreModule.Mat> wrapped_calibData = new List <OpenCVForUnity.CoreModule.Mat>(); OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToList <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(calibData, wrapped_calibData); if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.Net)) { storeResult.Value = new OpenCVForUnityPlayMakerActions.Net(); } ((OpenCVForUnityPlayMakerActions.Net)storeResult.Value).wrappedObject = wrapped_owner.quantize(wrapped_calibData, inputsDtype.Value, outputsDtype.Value); OpenCVForUnityPlayMakerActionsUtils.ConvertListToFsmArray <OpenCVForUnity.CoreModule.Mat, OpenCVForUnityPlayMakerActions.Mat>(wrapped_calibData, calibData); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); if (!(netInputShape.Value is OpenCVForUnityPlayMakerActions.MatOfInt)) { LogError("netInputShape is not initialized. Add Action \"newMatOfInt\"."); return; } OpenCVForUnity.CoreModule.MatOfInt wrapped_netInputShape = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt, OpenCVForUnity.CoreModule.MatOfInt>(netInputShape); int[] int_weights = weights.intValues; long[] casted_weights = new long[int_weights.Length]; int_weights.CopyTo(casted_weights, 0); int[] int_blobs = blobs.intValues; long[] casted_blobs = new long[int_blobs.Length]; int_blobs.CopyTo(casted_blobs, 0); wrapped_owner.getMemoryConsumption(layerId.Value, wrapped_netInputShape, casted_weights, casted_blobs); for (int i = 0; i < casted_weights.Length; i++) { weights.Set(i, (int)casted_weights[i]); } weights.SaveChanges(); for (int i = 0; i < casted_blobs.Length; i++) { blobs.Set(i, (int)casted_blobs[i]); } blobs.SaveChanges(); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Net)) { LogError("owner is not initialized. Add Action \"newNet\"."); return; } OpenCVForUnity.DnnModule.Net wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Net, OpenCVForUnity.DnnModule.Net>(owner); List <string> wrapped_storeResult = wrapped_owner.getLayerNames(); if (!storeResult.IsNone) { if (storeResult.Length != wrapped_storeResult.Count) { storeResult.Resize(wrapped_storeResult.Count); } for (int i = 0; i < wrapped_storeResult.Count; i++) { storeResult.Set(i, (string)wrapped_storeResult[i]); } storeResult.SaveChanges(); } }
public Net(OpenCVForUnity.DnnModule.Net nativeObj) : base(nativeObj) { }