Exemple #1
0
        /// <summary>
        /// The BaseDataLayer constructor.
        /// </summary>
        /// <param name="cuda">Specifies the CudaDnn connection to Cuda.</param>
        /// <param name="log">Specifies the Log for output.</param>
        /// <param name="p">Specifies the LayerParameter</param>
        /// <param name="db">Specifies the external database to use.</param>
        public BaseDataLayer(CudaDnn <T> cuda, Log log, LayerParameter p, IXImageDatabase db)
            : base(cuda, log, p)
        {
            if (db != null)
            {
                m_imgdb = db;

                if (p.type == LayerParameter.LayerType.DATA ||
                    p.type == LayerParameter.LayerType.TRIPLET_DATA)
                {
                    m_src = m_imgdb.GetSourceByName(p.data_param.source);
                }
                else if (p.type == LayerParameter.LayerType.BATCHDATA)
                {
                    m_src = m_imgdb.GetSourceByName(p.batch_data_param.source);
                }

                if (p.transform_param.use_imagedb_mean)
                {
                    if (db != null)
                    {
                        m_imgMean = db.GetImageMean(m_src.ID);
                    }
                    else
                    {
                        m_log.WriteLine("WARNING: The image database is NULL, and therefore no mean image can not be acquired.");
                    }
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// The Cursor constructor.
        /// </summary>
        /// <param name="db">Specifies the underlying database.</param>
        /// <param name="strSrc">Specifies the name of the data source to use.</param>
        public Cursor(IXImageDatabase db, string strSrc)
        {
            m_db = db;
            SourceDescriptor src = m_db.GetSourceByName(strSrc);

            m_nSrcID = src.ID;
            m_nCount = src.ImageCount;
        }