2using System.Collections.Generic;
14 List<DatasetEx> m_rgDatasets =
new List<DatasetEx>();
15 bool m_bUseTrainingSourcesForTesting =
false;
17 object m_syncObj =
new object();
33 return m_rgDatasets.Remove(ds);
41 List<int> rgIdx =
new List<int>();
43 for (
int i = 0; i < m_rgDatasets.Count; i++)
45 if (m_rgDatasets[i].Descriptor.ID < 0)
49 for (
int i = rgIdx.Count - 1; i >= 0; i--)
51 m_rgDatasets.RemoveAt(rgIdx[i]);
62 bool bReleased =
true;
116 col.m_bUseTrainingSourcesForTesting = m_bUseTrainingSourcesForTesting;
151 get {
return m_rgDatasets.Count; }
160 m_bUseTrainingSourcesForTesting = bEnable;
173 get {
return m_bUseTrainingSourcesForTesting; }
183 get {
return m_rgDatasets[nIdx]; }
227 if (m_lastImgSet !=
null && m_lastImgSet.
SourceID == nSourceID)
236 m_lastImgSet = imgSet;
241 throw new Exception(
"Could not find source with ID = " + nSourceID.ToString() +
"!");
254 if (m_lastImgSet !=
null && m_lastImgSet.
SourceName == strSource)
263 m_lastImgSet = imgSet;
268 throw new Exception(
"Could not find source with Name = " + strSource +
"!");
278 m_rgDatasets.Add(ds);
285 protected virtual void Dispose(
bool bDisposing)
292 m_rgDatasets.Clear();
309 return m_rgDatasets.GetEnumerator();
316 System.Collections.IEnumerator
System.Collections.IEnumerable.GetEnumerator()
318 return m_rgDatasets.GetEnumerator();
The LabelMappingCollection manages a collection of LabelMapping's.
The SimpleDatum class holds a data input within host memory.
The DatasetExCollection contains a list of DatasetEx objects.
void Dispose()
Releases all resources used by the collection.
void Add(DatasetEx ds)
Adds a DatasetEx to the collection.
IEnumerator< DatasetEx > GetEnumerator()
Returns the enumerator for the collection.
DatasetEx FindDataset(int nDatasetID)
Searches for the dataset with a dataset ID.
bool RemoveUser(Guid user)
Removes a user from the list of users using the DatasetExCollection.
void Relabel(LabelMappingCollection col)
Relabels all datasets using a label mapping collection.
bool SaveImageMean(int nSrcID, SimpleDatum sd, bool bUpdate)
Saves the image mean in a SimpleDatum to the database for a data source.
SimpleDatum QueryImageMean(int nSrcID)
Returns the image mean for a data source.
ImageSet FindImageset(string strSource)
Searches for the ImageSet with a given data source name.
DatasetEx FindDataset(string strDs)
Searches for the dataset with the dataset name.
void EnableUsingTrainingSourcesForTesting(bool bEnable)
Enable/disable the using of the training sources for testing on all datasets.
int Count
Returns the number of datasets in the collection.
void RemoveCreatedDatasets()
Remove all dynamically created datasets.
bool UseTrainingSourcesForTesting
Returns whether or not the training sources are set to be used for testing.
DatasetExCollection Clone()
Creates a copy of the entire DatasetExCollection.
DatasetExCollection()
The DatasetExCollection constructor.
virtual void Dispose(bool bDisposing)
Releases all resources used by the collection.
bool RemoveDataset(DatasetEx ds)
Remove the dataset specified.
ImageSet FindImageset(int nSourceID)
Searches for the ImageSet with a given data source ID.
void Reset()
Resets the last image set used to null, thus clearing it.
The DatasetEx class provides the in-memory dataset functionality that is used by the image database t...
int DatasetID
Returns the dataset ID of the dataset managesd by the DatasetEx object.
DatasetEx Clone(bool bReOrganizeByTime=false)
Copy the DatasetEx and its contents.
string DatasetName
Returns the dataset name of the dataset managesd by the DatasetEx object.
virtual void Dispose(bool bDisposing)
Releases all resources used.
SimpleDatum QueryImageMean(int nSrcId)
Query the image mean for a data source.
ImageSet Find(int nSourceID)
Returns the ImageSet corresponding to a data source ID.
bool UseTrainingImagesForTesting
Get/set whether or not to use the training images when testing.
int RemoveUser(Guid user)
Remove a user of the dataset.
bool SaveImageMean(int nSrcId, SimpleDatum sd, bool bUpdate)
Saves the image mean in a SimpleDatum to the database.
void Relabel(LabelMappingCollection col)
Relabels both the testing and training image sets using the label mapping collection.
The ImageSet class contains the list of image for a data source as well as a list of LabelSets that m...
string SourceName
Returns the data source name of the image set.
int SourceID
Returns the data source ID of the image set.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.db.image namespace contains all image database related classes.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...