Beispiel #1
0
        /// <summary>
        /// The constructor.
        /// </summary>
        /// <param name="master">Specifies the MasterIndexes to copy.</param>
        /// <param name="bUseUniqueLabelIndexes">Optionally, specifies to use unique label indexes which is slightly slower, but ensures each label is hit per epoch equally (default = true).</param>
        /// <param name="bUseUniqueImageIndexes">Optionally, specifies to use unique image indexes which is slightly slower, but ensures each image is hit per epoch (default = true).</param>
        /// <param name="sort">Optionally, specifies the ordering to use on the indexes (default = BYIDX).</param>
        public QueryState(MasterIndexes master, bool bUseUniqueLabelIndexes = true, bool bUseUniqueImageIndexes = true, IMGDB_SORT sort = IMGDB_SORT.BYIDX) : base(master, sort)
        {
            m_master = master;
            m_stat   = new LabelStats(master.LabelCount);
            m_bUseUniqueLabelIndexes = bUseUniqueLabelIndexes;
            m_bUseUniqueImageIndexes = bUseUniqueImageIndexes;

            foreach (LabelDescriptor label in m_src.Labels)
            {
                m_stat.Add(label);
            }
        }
        /// <summary>
        /// The ImageSet constructor.
        /// </summary>
        /// <param name="factory">Specifies the DatasetFactory.</param>
        /// <param name="src">Specifies the data source.</param>
        /// <param name="loadMethod">Specifies the method to use when loading the images.</param>
        /// <param name="nLoadLimit">Specifies the image load limit.</param>
        /// <param name="random">Specifies the random number generator.</param>
        public ImageSet(DatasetFactory factory, SourceDescriptor src, IMAGEDB_LOAD_METHOD loadMethod, int nLoadLimit, CryptoRandom random)
        {
            m_random  = random;
            m_factory = new DatasetFactory(factory);
            m_factory.Open(src.ID);
            m_loadMethod = loadMethod;
            m_nLoadLimit = nLoadLimit;
            m_src        = new SourceDescriptor(src);
            m_imgMean    = null;

            m_rgImages     = new SimpleDatum[m_src.ImageCount];
            m_rgLabelStats = new LabelStats(src.Labels.Count);

            foreach (LabelDescriptor label in src.Labels)
            {
                if (label.ImageCount > 0)
                {
                    m_rgLabelSet.Add(new LabelSet(label, m_random));
                }

                m_rgLabelStats.Add(label);
            }
        }