/// <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, IXImageDatabaseBase db) : base(cuda, log, p) { if (db != null) { m_imgdb = db; if (p.type == LayerParameter.LayerType.DATA || p.type == LayerParameter.LayerType.ANNOTATED_DATA || p.type == LayerParameter.LayerType.TRIPLET_DATA) { m_src = m_imgdb.GetSourceByName(p.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."); } } } }
/// <summary> /// The Cursor constructor. /// </summary> /// <param name="db">Specifies the underlying database.</param> /// <param name="transformer">Specifies the data transformer used to transform the lables (when active).</param> /// <param name="strSrc">Specifies the name of the data source to use.</param> /// <param name="log">Optionally, specifies an output log used for diagnostic information if specified (default = null).</param> public Cursor(IXImageDatabaseBase db, DataTransformer <T> transformer, string strSrc, Log log = null) { m_log = log; m_db = db; m_transformer = transformer; SourceDescriptor src = m_db.GetSourceByName(strSrc); m_strSrc = src.Name; m_nSrcID = src.ID; m_nCount = src.ImageCount; }