MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
DatasetExCollection2.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using MyCaffe.basecode;
6
7namespace MyCaffe.db.image
8{
13 public class DatasetExCollection2 : IEnumerable<DatasetEx2>, IDisposable
14 {
15 List<DatasetEx2> m_rgDatasets = new List<DatasetEx2>();
16 bool m_bUseTrainingSourcesForTesting = false;
17 ImageSet2 m_lastImgSet = null;
18 object m_syncObj = new object();
19
24 {
25 }
26
32 public bool RemoveDataset(DatasetEx2 ds)
33 {
34 return m_rgDatasets.Remove(ds);
35 }
36
42 public bool RemoveUser(Guid user)
43 {
44 bool bReleased = true;
45
46 foreach (DatasetEx2 ds in m_rgDatasets)
47 {
48 if (ds.RemoveUser(user) > 0)
49 bReleased = false;
50 }
51
52 return bReleased;
53 }
54
62 public bool SaveImageMean(int nSrcID, SimpleDatum sd, bool bUpdate)
63 {
64 foreach (DatasetEx2 ds in m_rgDatasets)
65 {
66 if (ds.SaveImageMean(nSrcID, sd, bUpdate))
67 return true;
68 }
69
70 return false;
71 }
72
78 public SimpleDatum QueryImageMean(int nSrcID)
79 {
80 foreach (DatasetEx2 ds in m_rgDatasets)
81 {
82 SimpleDatum sd = ds.QueryImageMean(nSrcID);
83 if (sd != null)
84 return sd;
85 }
86
87 return null;
88 }
89
93 public void Reset()
94 {
95 m_lastImgSet = null;
96 }
97
102 public void ReloadIndexing(int nDsId)
103 {
104 lock (m_syncObj)
105 {
106 foreach (DatasetEx2 ds in m_rgDatasets)
107 {
108 if (ds.DatasetID == nDsId)
109 {
110 ds.ReloadIndexing();
111 return;
112 }
113 }
114
115 throw new Exception("Failed to create a new query state for dataset ID = " + nDsId.ToString() + ".");
116 }
117 }
118
123 public void ReloadIndexing(string strDs)
124 {
125 lock (m_syncObj)
126 {
127 foreach (DatasetEx2 ds in m_rgDatasets)
128 {
129 if (ds.DatasetName == strDs)
130 {
131 ds.ReloadIndexing();
132 return;
133 }
134 }
135
136 throw new Exception("Failed to create a new query state for dataset = '" + strDs.ToString() + "'.");
137 }
138 }
139
145 {
146 foreach (DatasetEx2 ds in m_rgDatasets)
147 {
148 ds.Relabel(col);
149 }
150 }
151
155 public int Count
156 {
157 get { return m_rgDatasets.Count; }
158 }
159
164 public void EnableUsingTrainingSourcesForTesting(bool bEnable)
165 {
166 m_bUseTrainingSourcesForTesting = bEnable;
167
168 foreach (DatasetEx2 ds in m_rgDatasets)
169 {
170 ds.UseTrainingImagesForTesting = bEnable;
171 }
172 }
173
178 {
179 get { return m_bUseTrainingSourcesForTesting; }
180 }
181
187 public DatasetEx2 this[int nIdx]
188 {
189 get { return m_rgDatasets[nIdx]; }
190 }
191
197 public DatasetEx2 FindDataset(int nDatasetID)
198 {
199 foreach (DatasetEx2 ds in m_rgDatasets)
200 {
201 if (ds.DatasetID == nDatasetID)
202 return ds;
203 }
204
205 return null;
206 }
207
213 public DatasetEx2 FindDataset(string strDs)
214 {
215 foreach (DatasetEx2 ds in m_rgDatasets)
216 {
217 if (ds.DatasetName == strDs)
218 return ds;
219 }
220
221 return null;
222 }
223
230 {
231 foreach (DatasetEx2 ds in m_rgDatasets)
232 {
233 if (ds.Find(nSrcId) != null)
234 return ds;
235 }
236
237 return null;
238 }
239
245 public ImageSet2 FindImageset(int nSourceID)
246 {
247 lock (m_syncObj)
248 {
249 if (m_lastImgSet != null && m_lastImgSet.Source.ID == nSourceID)
250 return m_lastImgSet;
251
252 foreach (DatasetEx2 ds in m_rgDatasets)
253 {
254 ImageSet2 imgSet = ds.Find(nSourceID);
255
256 if (imgSet != null)
257 {
258 m_lastImgSet = imgSet;
259 return imgSet;
260 }
261 }
262
263 throw new Exception("Could not find source with ID = " + nSourceID.ToString() + "!");
264 }
265 }
266
272 public ImageSet2 FindImageset(string strSource)
273 {
274 lock (m_syncObj)
275 {
276 if (m_lastImgSet != null && m_lastImgSet.Source.Name == strSource)
277 return m_lastImgSet;
278
279 foreach (DatasetEx2 ds in m_rgDatasets)
280 {
281 ImageSet2 imgSet = ds.Find(strSource);
282
283 if (imgSet != null)
284 {
285 m_lastImgSet = imgSet;
286 return imgSet;
287 }
288 }
289
290 throw new Exception("Could not find source with Name = " + strSource + "!");
291 }
292 }
293
302 public bool WaitForDatasetToLoad(int nDsId, bool bTraining, bool bTesting, int nWait = int.MaxValue)
303 {
304 lock (m_syncObj)
305 {
306 foreach (DatasetEx2 ds in m_rgDatasets)
307 {
308 if (ds.DatasetID == nDsId)
309 return ds.WaitForLoadingToComplete(bTraining, bTesting, nWait);
310 }
311
312 throw new Exception("Failed to create a new query state for dataset ID = " + nDsId.ToString() + ".");
313 }
314 }
315
324 public bool WaitForDatasetToLoad(string strDs, bool bTraining, bool bTesting, int nWait = int.MaxValue)
325 {
326 lock (m_syncObj)
327 {
328 foreach (DatasetEx2 ds in m_rgDatasets)
329 {
330 if (ds.DatasetName == strDs)
331 return ds.WaitForLoadingToComplete(bTraining, bTesting, nWait);
332 }
333
334 throw new Exception("Failed to create a new query state for dataset = '" + strDs + "'.");
335 }
336 }
337
346 public bool WaitForDatasetToRefresh(int nDsId, bool bTraining, bool bTesting, int nWait = int.MaxValue)
347 {
348 lock (m_syncObj)
349 {
350 foreach (DatasetEx2 ds in m_rgDatasets)
351 {
352 if (ds.DatasetID == nDsId)
353 return ds.WaitForRefreshToComplete(bTraining, bTesting, nWait);
354 }
355
356 throw new Exception("Failed to create a new query state for dataset ID = " + nDsId.ToString() + ".");
357 }
358 }
359
368 public bool WaitForDatasetToRefresh(string strDs, bool bTraining, bool bTesting, int nWait = int.MaxValue)
369 {
370 lock (m_syncObj)
371 {
372 foreach (DatasetEx2 ds in m_rgDatasets)
373 {
374 if (ds.DatasetName == strDs)
375 return ds.WaitForRefreshToComplete(bTraining, bTesting, nWait);
376 }
377
378 throw new Exception("Failed to create a new query state for dataset = '" + strDs + "'.");
379 }
380 }
381
389 public bool IsRefreshRunning(int nDsId, bool bTraining, bool bTesting)
390 {
391 lock (m_syncObj)
392 {
393 foreach (DatasetEx2 ds in m_rgDatasets)
394 {
395 if (ds.DatasetID == nDsId)
396 return ds.IsRefreshRunning(bTraining, bTesting);
397 }
398
399 throw new Exception("Failed to create a new query state for dataset ID = '" + nDsId.ToString() + "'.");
400 }
401 }
402
410 public bool IsRefreshRunning(string strDs, bool bTraining, bool bTesting)
411 {
412 lock (m_syncObj)
413 {
414 foreach (DatasetEx2 ds in m_rgDatasets)
415 {
416 if (ds.DatasetName == strDs)
417 return ds.IsRefreshRunning(bTraining, bTesting);
418 }
419
420 throw new Exception("Failed to create a new query state for dataset = '" + strDs + "'.");
421 }
422 }
423
424
436 public bool StartRefresh(string strDs, bool bTraining, bool bTesting, double dfReplacementPct)
437 {
438 lock (m_syncObj)
439 {
440 foreach (DatasetEx2 ds in m_rgDatasets)
441 {
442 if (ds.DatasetName == strDs)
443 {
444 ds.StartRefresh(bTraining, bTesting, dfReplacementPct);
445 return true;
446 }
447 }
448
449 throw new Exception("Failed to create a new query state for dataset = '" + strDs + "'.");
450 }
451 }
452
463 public bool StopRefresh(string strDs, bool bTraining, bool bTesting)
464 {
465 lock (m_syncObj)
466 {
467 foreach (DatasetEx2 ds in m_rgDatasets)
468 {
469 if (ds.DatasetName == strDs)
470 {
471 ds.StopRefresh(bTraining, bTesting);
472 return true;
473 }
474 }
475
476 throw new Exception("Failed to create a new query state for dataset = '" + strDs + "'.");
477 }
478 }
479
491 public bool StartRefresh(int nDsID, bool bTraining, bool bTesting, double dfReplacementPct)
492 {
493 lock (m_syncObj)
494 {
495 foreach (DatasetEx2 ds in m_rgDatasets)
496 {
497 if (ds.DatasetID == nDsID)
498 {
499 ds.StartRefresh(bTraining, bTesting, dfReplacementPct);
500 return true;
501 }
502 }
503
504 throw new Exception("Failed to create a new query state for dataset ID = '" + nDsID.ToString() + "'.");
505 }
506 }
507
518 public bool StopRefresh(int nDsID, bool bTraining, bool bTesting)
519 {
520 lock (m_syncObj)
521 {
522 foreach (DatasetEx2 ds in m_rgDatasets)
523 {
524 if (ds.DatasetID == nDsID)
525 {
526 ds.StopRefresh(bTraining, bTesting);
527 return true;
528 }
529 }
530
531 throw new Exception("Failed to create a new query state for dataset ID = '" + nDsID.ToString() + "'.");
532 }
533 }
534
544 public bool StartAutomaticRefreshSchedule(string strDs, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct)
545 {
546 foreach (DatasetEx2 ds in m_rgDatasets)
547 {
548 if (ds.DatasetName == strDs)
549 {
550 return ds.StartAutomaticRefreshSchedule(bTraining, bTesting, nPeriodInMs, dfReplacementPct);
551 }
552 }
553
554 throw new Exception("Failed to create a new query state for dataset name = '" + strDs + "'.");
555 }
556
564 public bool StopAutomaticRefreshSchedule(string strDs, bool bTraining, bool bTesting)
565 {
566 foreach (DatasetEx2 ds in m_rgDatasets)
567 {
568 if (ds.DatasetName == strDs)
569 {
570 return ds.StopAutomaticRefreshSchedule(bTraining, bTesting);
571 }
572 }
573
574 throw new Exception("Failed to create a new query state for dataset name = '" + strDs + "'.");
575 }
576
586 public bool GetScheduledAutoRefreshInformation(string strDs, out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount)
587 {
588 nPeriodInMs = 0;
589 dfReplacementPct = 0;
590 nTrainingRefreshCount = 0;
591 nTestingRefreshCount = 0;
592
593 foreach (DatasetEx2 ds in m_rgDatasets)
594 {
595 if (ds.DatasetName == strDs)
596 {
597 return ds.GetAutomaticRefreshSchedule(out nPeriodInMs, out dfReplacementPct, out nTrainingRefreshCount, out nTestingRefreshCount);
598 }
599 }
600
601 throw new Exception("Failed to create a new query state for dataset name = '" + strDs + "'.");
602 }
603
613 public bool StartAutomaticRefreshSchedule(int nDsID, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct)
614 {
615 foreach (DatasetEx2 ds in m_rgDatasets)
616 {
617 if (ds.DatasetID == nDsID)
618 {
619 return ds.StartAutomaticRefreshSchedule(bTraining, bTesting, nPeriodInMs, dfReplacementPct);
620 }
621 }
622
623 throw new Exception("Failed to create a new query state for dataset ID = '" + nDsID.ToString() + "'.");
624 }
625
633 public bool StopAutomaticRefreshSchedule(int nDsID, bool bTraining, bool bTesting)
634 {
635 foreach (DatasetEx2 ds in m_rgDatasets)
636 {
637 if (ds.DatasetID == nDsID || nDsID == 0)
638 {
639 return ds.StopAutomaticRefreshSchedule(bTraining, bTesting);
640 }
641 }
642
643 throw new Exception("Failed to create a new query state for dataset ID = '" + nDsID.ToString() + "'.");
644 }
645
655 public bool GetScheduledAutoRefreshInformation(int nDsID, out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount)
656 {
657 nPeriodInMs = 0;
658 dfReplacementPct = 0;
659 nTrainingRefreshCount = 0;
660 nTestingRefreshCount = 0;
661
662 foreach (DatasetEx2 ds in m_rgDatasets)
663 {
664 if (ds.DatasetID == nDsID)
665 {
666 return ds.GetAutomaticRefreshSchedule(out nPeriodInMs, out dfReplacementPct, out nTrainingRefreshCount, out nTestingRefreshCount);
667 }
668 }
669
670 throw new Exception("Failed to create a new query state for dataset ID = '" + nDsID.ToString() + "'.");
671 }
672
673
682 public long CreateQueryState(int nDsId, bool bUseUniqueLabelIndexes = true, bool bUseUniqueImageIndexes = true, IMGDB_SORT sort = IMGDB_SORT.NONE)
683 {
684 lock (m_syncObj)
685 {
686 foreach (DatasetEx2 ds in m_rgDatasets)
687 {
688 if (ds.DatasetID == nDsId)
689 return ds.CreateQueryState(bUseUniqueLabelIndexes, bUseUniqueImageIndexes, sort);
690 }
691
692 throw new Exception("Failed to create a new query state for dataset ID = " + nDsId.ToString() + ".");
693 }
694 }
695
704 public long CreateQueryState(string strDs, bool bUseUniqueLabelIndexes = true, bool bUseUniqueImageIndexes = true, IMGDB_SORT sort = IMGDB_SORT.NONE)
705 {
706 lock (m_syncObj)
707 {
708 foreach (DatasetEx2 ds in m_rgDatasets)
709 {
710 if (ds.DatasetName == strDs)
711 return ds.CreateQueryState(bUseUniqueLabelIndexes, bUseUniqueImageIndexes, sort);
712 }
713
714 throw new Exception("Failed to create a new query state for dataset = '" + strDs + "'.");
715 }
716 }
717
724 public bool SetDefaultQueryState(int nDsId, long lQueryState)
725 {
726 lock (m_syncObj)
727 {
728 foreach (DatasetEx2 ds in m_rgDatasets)
729 {
730 if (ds.DatasetID == nDsId)
731 return ds.SetDefaultQueryState(lQueryState);
732 }
733
734 throw new Exception("Failed to create a new query state for dataset ID = '" + nDsId.ToString() + "'.");
735 }
736 }
737
744 public bool SetDefaultQueryState(string strDs, long lQueryState)
745 {
746 lock (m_syncObj)
747 {
748 foreach (DatasetEx2 ds in m_rgDatasets)
749 {
750 if (ds.DatasetName == strDs)
751 return ds.SetDefaultQueryState(lQueryState);
752 }
753
754 throw new Exception("Failed to create a new query state for dataset = '" + strDs + "'.");
755 }
756 }
757
764 public bool FreeQueryState(int nDsId, long lHandle)
765 {
766 lock (m_syncObj)
767 {
768 foreach (DatasetEx2 ds in m_rgDatasets)
769 {
770 if (ds.DatasetID == nDsId)
771 return ds.FreeQueryState(lHandle);
772 }
773
774 return false;
775 }
776 }
777
784 public bool FreeQueryState(string strDs, long lHandle)
785 {
786 lock (m_syncObj)
787 {
788 foreach (DatasetEx2 ds in m_rgDatasets)
789 {
790 if (ds.DatasetName == strDs)
791 return ds.FreeQueryState(lHandle);
792 }
793
794 return false;
795 }
796 }
797
805 public QueryState FindQueryState(long lQueryState, string strSource)
806 {
807 lock (m_syncObj)
808 {
809 foreach (DatasetEx2 ds in m_rgDatasets)
810 {
811 ImageSet2 imgSet = ds.Find(strSource);
812
813 if (imgSet != null)
814 return ds.FindQueryState(lQueryState, imgSet.ImageSetType);
815 }
816
817 throw new Exception("Could not find query state for data source with Name = " + strSource + "!");
818 }
819 }
820
828 public QueryState FindQueryState(long lQueryState, int nSrcId)
829 {
830 lock (m_syncObj)
831 {
832 foreach (DatasetEx2 ds in m_rgDatasets)
833 {
834 ImageSet2 imgSet = ds.Find(nSrcId);
835
836 if (imgSet != null)
837 return ds.FindQueryState(lQueryState, imgSet.ImageSetType);
838 }
839
840 throw new Exception("Could not find query state for data source with ID = " + nSrcId.ToString() + "!");
841 }
842 }
843
848 public void Add(DatasetEx2 ds)
849 {
850 m_rgDatasets.Add(ds);
851 }
852
857 protected virtual void Dispose(bool bDisposing)
858 {
859 foreach (DatasetEx2 ds in m_rgDatasets)
860 {
861 ds.Dispose();
862 }
863
864 m_rgDatasets.Clear();
865 }
866
870 public void Dispose()
871 {
872 Dispose(true);
873 }
874
879 public IEnumerator<DatasetEx2> GetEnumerator()
880 {
881 return m_rgDatasets.GetEnumerator();
882 }
883
888 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
889 {
890 return m_rgDatasets.GetEnumerator();
891 }
892 }
893}
The LabelMappingCollection manages a collection of LabelMapping's.
Definition: LabelMapping.cs:15
The SimpleDatum class holds a data input within host memory.
Definition: SimpleDatum.cs:161
[V2 Image Database] The DatasetEx2 class provides the in-memory dataset functionality that is used by...
Definition: DatasetEx2.cs:18
long CreateQueryState(bool bUseUniqueLabelIndexes=true, bool bUseUniqueImageIndexes=true, IMGDB_SORT sort=IMGDB_SORT.NONE)
Create a new QueryState on the dataset.
Definition: DatasetEx2.cs:481
int? DatasetID
Returns the dataset ID of the dataset managesd by the DatasetEx object.
Definition: DatasetEx2.cs:710
bool StartAutomaticRefreshSchedule(bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct)
Start the automatic refresh schedule on the training and/or testing data sources.
Definition: DatasetEx2.cs:273
bool SetDefaultQueryState(long lQueryState)
Set the default query state to a new query state.
Definition: DatasetEx2.cs:493
bool StopAutomaticRefreshSchedule(bool bTraining, bool bTesting)
Stop the automatic refresh schedule on the training and/or testing data sources.
Definition: DatasetEx2.cs:311
bool UseTrainingImagesForTesting
Get/set whether or not to use the training images when testing.
Definition: DatasetEx2.cs:583
QueryState FindQueryState(long lQueryState, ImageSet2.TYPE type)
Returns the query state for a given query state handle and type.
Definition: DatasetEx2.cs:519
bool FreeQueryState(long lHandle)
Free an existing query state.
Definition: DatasetEx2.cs:504
void Relabel(LabelMappingCollection col)
Relabels both the testing and training image sets using the label mapping collection.
Definition: DatasetEx2.cs:546
void StopRefresh(bool bTraining=true, bool bTesting=true)
Stop any refresh operation currently running.
Definition: DatasetEx2.cs:256
ImageSet2 Find(int nSourceID)
Returns the ImageSet corresponding to a data source ID.
Definition: DatasetEx2.cs:657
bool SaveImageMean(int nSrcId, SimpleDatum sd, bool bUpdate)
Saves the image mean in a SimpleDatum to the database.
Definition: DatasetEx2.cs:595
bool GetAutomaticRefreshSchedule(out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount)
Get the automatic refresh schedule status and its period and replacement percentage.
Definition: DatasetEx2.cs:335
virtual void Dispose(bool bDisposing)
Releases all resources used.
Definition: DatasetEx2.cs:441
void ReloadIndexing()
Reload the indexing for both the training and testing data sources.
Definition: DatasetEx2.cs:533
bool WaitForLoadingToComplete(bool bTraining, bool bTesting, int nWait=int.MaxValue)
Wait for either the training, testing or both data sources to complete loading.
Definition: DatasetEx2.cs:167
bool WaitForRefreshToComplete(bool bTraining, bool bTesting, int nWait=int.MaxValue)
Wait for either the training, testing or both data sources to complete refreshing.
Definition: DatasetEx2.cs:191
int RemoveUser(Guid user)
Remove a user of the dataset.
Definition: DatasetEx2.cs:81
bool IsRefreshRunning(bool bTraining, bool bTesting)
Returns whether or not the refresh is running on the training and/or testing data source.
Definition: DatasetEx2.cs:214
SimpleDatum QueryImageMean(int nSrcId)
Query the image mean for a data source.
Definition: DatasetEx2.cs:609
void StartRefresh(bool bTraining=true, bool bTesting=true, double dfReplacementPct=0.25)
Start an image refresh on the training and/or testing data sources.
Definition: DatasetEx2.cs:242
string DatasetName
Returns the dataset name of the dataset managesd by the DatasetEx object.
Definition: DatasetEx2.cs:727
[V2 Image Database] The DatasetExCollection2 contains a list of DatasetEx2 objects.
bool SaveImageMean(int nSrcID, SimpleDatum sd, bool bUpdate)
Saves the image mean in a SimpleDatum to the database for a data source.
bool StartAutomaticRefreshSchedule(int nDsID, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct)
Start the automatic refresh cycle to occur on specified period increments.
SimpleDatum QueryImageMean(int nSrcID)
Returns the image mean for a data source.
void Dispose()
Releases all resources used by the collection.
bool StartAutomaticRefreshSchedule(string strDs, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct)
Start the automatic refresh cycle to occur on specified period increments.
ImageSet2 FindImageset(string strSource)
Searches for the ImageSet with a given data source name.
bool WaitForDatasetToLoad(string strDs, bool bTraining, bool bTesting, int nWait=int.MaxValue)
Wait for the dataset loading to complete.
long CreateQueryState(int nDsId, bool bUseUniqueLabelIndexes=true, bool bUseUniqueImageIndexes=true, IMGDB_SORT sort=IMGDB_SORT.NONE)
Create a new query state, optionally with a certain sorting.
QueryState FindQueryState(long lQueryState, int nSrcId)
Returns the query state based on the handle and data source where the dataset that owns the data sour...
bool StopRefresh(string strDs, bool bTraining, bool bTesting)
Stop a refresh operation running on the dataset.
bool GetScheduledAutoRefreshInformation(int nDsID, out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount)
Returns whether or not a scheduled refresh is running and if so at what period and replacement percen...
IEnumerator< DatasetEx2 > GetEnumerator()
Returns the enumerator for the collection.
bool FreeQueryState(int nDsId, long lHandle)
Frees a query state from a given dataset.
DatasetEx2 FindDataset(int nDatasetID)
Searches for the dataset with a dataset ID.
virtual void Dispose(bool bDisposing)
Releases all resources used by the collection.
void Relabel(LabelMappingCollection col)
Relabels all datasets using a label mapping collection.
void ReloadIndexing(string strDs)
Reload the dataset's indexing.
bool SetDefaultQueryState(string strDs, long lQueryState)
Set the default query state to the query state specified for the dataset specified.
DatasetEx2 FindDatasetFromSource(int nSrcId)
Searches for the dataset containing the given Source ID.
bool RemoveDataset(DatasetEx2 ds)
Remove the dataset specified.
int Count
Returns the number of datasets in the collection.
bool WaitForDatasetToRefresh(string strDs, bool bTraining, bool bTesting, int nWait=int.MaxValue)
Wait for the dataset refreshing to complete.
bool StartRefresh(string strDs, bool bTraining, bool bTesting, double dfReplacementPct)
Start a refresh on the dataset by replacing a specified percentage of the images with images from the...
DatasetEx2 FindDataset(string strDs)
Searches for the dataset with the dataset name.
long CreateQueryState(string strDs, bool bUseUniqueLabelIndexes=true, bool bUseUniqueImageIndexes=true, IMGDB_SORT sort=IMGDB_SORT.NONE)
Create a new query state, optionally with a certain sorting.
DatasetExCollection2()
The DatasetExCollection2 constructor.
bool StartRefresh(int nDsID, bool bTraining, bool bTesting, double dfReplacementPct)
Start a refresh on the dataset by replacing a specified percentage of the images with images from the...
bool WaitForDatasetToLoad(int nDsId, bool bTraining, bool bTesting, int nWait=int.MaxValue)
Wait for the dataset loading to complete.
bool SetDefaultQueryState(int nDsId, long lQueryState)
Set the default query state to the query state specified for the dataset specified.
void ReloadIndexing(int nDsId)
Reload the dataset's indexing.
bool GetScheduledAutoRefreshInformation(string strDs, out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount)
Returns whether or not a scheduled refresh is running and if so at what period and replacement percen...
bool FreeQueryState(string strDs, long lHandle)
Frees a query state from a given dataset.
bool WaitForDatasetToRefresh(int nDsId, bool bTraining, bool bTesting, int nWait=int.MaxValue)
Wait for the dataset refreshing to complete.
bool IsRefreshRunning(string strDs, bool bTraining, bool bTesting)
Returns true if the refresh operation running.
bool StopRefresh(int nDsID, bool bTraining, bool bTesting)
Stop a refresh operation running on the dataset.
QueryState FindQueryState(long lQueryState, string strSource)
Returns the query state based on the handle and data source where the dataset that owns the data sour...
bool RemoveUser(Guid user)
Removes a user from the list of users using the DatasetExCollection.
void Add(DatasetEx2 ds)
Adds a DatasetEx to the collection.
void Reset()
Resets the last image set used to null, thus clearing it.
bool StopAutomaticRefreshSchedule(int nDsID, bool bTraining, bool bTesting)
Stop the automatic refresh schedule running on a dataset.
ImageSet2 FindImageset(int nSourceID)
Searches for the ImageSet with a given data source ID.
bool StopAutomaticRefreshSchedule(string strDs, bool bTraining, bool bTesting)
Stop the automatic refresh schedule running on a dataset.
bool UseTrainingSourcesForTesting
Returns whether or not the training sources are set to be used for testing.
void EnableUsingTrainingSourcesForTesting(bool bEnable)
Enable/disable the using of the training sources for testing on all datasets.
bool IsRefreshRunning(int nDsId, bool bTraining, bool bTesting)
Returns true if the refresh operation running.
[V2 Image Database] The ImageSet2 manages the data source data including the master list of images,...
Definition: ImageSet2.cs:17
TYPE ImageSetType
Returns the type of use for the ImageSet.
Definition: ImageSet2.cs:189
SourceDescriptor Source
Returns the data source of the image set.
Definition: ImageSetBase.cs:65
Initially the QueryState is copied from the MasterIndexes and during each query is altered by removin...
Definition: QueryState.cs:19
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
Definition: Annotation.cs:12
IMGDB_SORT
Defines the sorting method.
Definition: Interfaces.cs:358
The MyCaffe.db.image namespace contains all image database related classes.
Definition: Database.cs:18
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...
Definition: Annotation.cs:12