Exemplo n.º 1
0
    public static T[] getJsonArray <T>(string json)
    {
        string       newJson = "{ \"array\": " + json + "}";
        Wrapper1 <T> wrapper = JsonUtility.FromJson <Wrapper1 <T> >(newJson);

        return(wrapper.array);
    }
Exemplo n.º 2
0
        private unsafe List <YoloResult> Detect11(Mat mat, float thresh = 0.2f)
        {
            BoundingBox11 *elems;
            int            elemsSize;

            switch (_instanceId)
            {
            default:
            case 0:
                Wrapper0.Detect(mat.DataPointer, mat.Rows, mat.Cols, thresh, false, out elems, out elemsSize);
                break;

            case 1:
                Wrapper1.Detect(mat.DataPointer, mat.Rows, mat.Cols, thresh, false, out elems, out elemsSize);
                break;

            case 2:
                Wrapper2.Detect(mat.DataPointer, mat.Rows, mat.Cols, thresh, false, out elems, out elemsSize);
                break;

            case 3:
                Wrapper3.Detect(mat.DataPointer, mat.Rows, mat.Cols, thresh, false, out elems, out elemsSize);
                break;
            }
            return(GetResults(elems, elemsSize));
        }
Exemplo n.º 3
0
        public Yolo(string cfgFile, string weightFile, int gpuId, int instanceId, int cudaVersion)
        {
            _instanceId  = instanceId;
            _cudaVersion = cudaVersion;

            switch (_instanceId)
            {
            default:
            case 0:
                Wrapper0.Init(cfgFile, weightFile, gpuId);
                break;

            case 1:
                Wrapper1.Init(cfgFile, weightFile, gpuId);
                break;

            case 2:
                Wrapper2.Init(cfgFile, weightFile, gpuId);
                break;

            case 3:
                Wrapper3.Init(cfgFile, weightFile, gpuId);
                break;
            }
        }
Exemplo n.º 4
0
 public void ReadDollar()
 {
     try
     {
         Wrapper1 wp = new Wrapper1()
         {
             s = "&"
         };
         Wrapper1 res = IO.WriteToXmlFile(IO.CurrentDirectoryFolder + "\\tests\\ReadDollar.xml", wp);
         Assert.AreEqual(wp, res);
     }
     catch (Exception e)
     {
         Assert.Fail(e.Message);
     }
 }
Exemplo n.º 5
0
 public void WriteAndRead()
 {
     try
     {
         Wrapper1 wp = new Wrapper1()
         {
             s = "wat&^*()^%$#@"
         };
         Wrapper1 new_wp = IO.WriteToXmlFile(IO.CurrentDirectoryFolder + "\\tests\\WriteToXmlFileTesting.xml", wp);
         Assert.AreEqual(wp.s, new_wp.s);
     }
     catch (Exception e)
     {
         Assert.Fail(e.Message);
     }
 }
Exemplo n.º 6
0
        public void Dispose()
        {
            switch (_instanceId)
            {
            default:
            case 0:
                Wrapper0.Close();
                break;

            case 1:
                Wrapper1.Close();
                break;

            case 2:
                Wrapper2.Close();
                break;

            case 3:
                Wrapper3.Close();
                break;
            }
        }