MyCaffe  1.11.8.27
Deep learning software for Windows C# programmers.
Interfaces.cs
2using System;
3using System.Collections.Generic;
4using System.Linq;
5using System.Runtime.Serialization;
6using System.ServiceModel;
7using System.Text;
8
9namespace MyCaffe.basecode
10{
15 {
19 NONE,
23 CUSTOM,
35 DUAL
36 }
37
41 public enum Phase
42 {
46 NONE = 0,
50 TRAIN = 1,
54 TEST = 2,
58 RUN = 3,
62 ALL = 5
63 }
64
68 public enum Stage
69 {
73 NONE = 0,
77 RNN = 1,
81 RL = 2,
85 ALL = 3,
89 CUSTOM = 4
90 }
91
92
96 public enum GYM_TYPE
97 {
101 NONE,
105 DYNAMIC,
109 DATA
110 }
111
115 public enum DATA_TYPE
116 {
120 DEFAULT,
124 VALUES,
128 BLOB
129 }
130
135 {
143 LOAD_ALL,
156 }
157
162 {
166 DISABLED = -1,
179 }
180
185 {
189 LAST_STATE = 0,
206 }
207
214 public enum ApVersion
215 {
228 }
229
233 public interface ITestKnownFailures
234 {
238 List<Tuple<string, string, string>> KnownFailures { get; }
245 int GetPriority(string strClass, string strMethod);
246 }
247
248
249 //-------------------------------------------------------------------------------------------------
250 // IXImageDatabase Interfaces
251 //-------------------------------------------------------------------------------------------------
252
256 [Serializable]
257 [DataContract]
259 {
263 [EnumMember]
264 NONE = 0x0000,
268 [EnumMember]
269 RANDOM = 0x0001,
274 [EnumMember]
275 PAIR = 0x0002,
279 [EnumMember]
280 RANDOM_AND_PAIR = 0x0003,
284 [EnumMember]
285 BOOST = 0x0004,
289 [EnumMember]
290 RANDOM_AND_BOOST = 0x0005,
294 [EnumMember]
299 [EnumMember]
300 FIXEDINDEX = 0x0008,
304 [EnumMember]
305 CLEARFIXEDINDEX = 0x0010
306 }
307
311 [Serializable]
312 [DataContract]
314 {
318 [EnumMember]
319 NONE = 0x0000,
323 [EnumMember]
324 RANDOM = 0x0001,
328 [EnumMember]
329 BOOST = 0x0002
330 }
331
336 [Serializable]
337 [DataContract]
338 public enum IMGDB_SORT
339 {
343 [EnumMember]
344 NONE = 0x0000,
348 [EnumMember]
349 BYDESC = 0x0001,
353 [EnumMember]
354 BYTIME = 0x0002,
358 [EnumMember]
359 BYID = 0x0004,
363 [EnumMember]
364 BYID_DESC = 0x0008,
368 [EnumMember]
369 BYIDX = 0x0010
370 }
371
375 [Serializable]
376 [DataContract]
377 public enum IMGDB_VERSION
378 {
382 [EnumMember]
383 V1,
387 [EnumMember]
388 V2,
392 [EnumMember]
393 DEFAULT = V2
394 }
395
396#pragma warning disable 1591
397
398 [ServiceContract]
399 public interface IXImageDatabaseEvent
400 {
401 [OperationContract(IsOneWay = false)]
402 void OnResult(string strMsg, double dfProgress);
403
404 [OperationContract(IsOneWay = false)]
405 void OnError(ImageDatabaseErrorData err);
406 }
407
408#pragma warning restore 1591
409
413 [ServiceContract(CallbackContract = typeof(IXImageDatabaseEvent), SessionMode = SessionMode.Required)]
414 public interface IXImageDatabaseBase
415 {
416 #region Initialization and Cleanup
417
422 [OperationContract(IsOneWay = false)]
424
432 [OperationContract(IsOneWay = false)]
433 bool InitializeWithDsName1(SettingsCaffe s, string strDs, string strEvtCancel = null);
434
442 [OperationContract(IsOneWay = false)]
443 bool InitializeWithDs1(SettingsCaffe s, DatasetDescriptor ds, string strEvtCancel = null);
444
454 [OperationContract(IsOneWay = false)]
455 bool InitializeWithDsId1(SettingsCaffe s, int nDataSetID, string strEvtCancel = null, int nPadW = 0, int nPadH = 0);
456
467 [OperationContract(IsOneWay = false)]
468 bool LoadDatasetByID1(int nDsId, string strEvtCancel = null);
469
480 [OperationContract(IsOneWay = false)]
481 bool LoadDatasetByName1(string strDs, string strEvtCancel = null);
482
488 [OperationContract(IsOneWay = false)]
489 void CleanUp(int nDsId = 0, bool bForce = false);
490
491 #endregion // Initialization and Cleanup
492
493 #region Properties
494
499 [OperationContract(IsOneWay = false)]
501
505 [OperationContract(IsOneWay = false)]
507
511 [OperationContract(IsOneWay = false)]
513
518 [OperationContract(IsOneWay = false)]
519 Tuple<IMGDB_LABEL_SELECTION_METHOD, IMGDB_IMAGE_SELECTION_METHOD> GetSelectionMethod();
520
526 [OperationContract(IsOneWay = false)]
528
536 [OperationContract(IsOneWay = false)]
537 double GetDatasetLoadedPercentByName(string strDataset, out double dfTraining, out double dfTesting);
538
546 [OperationContract(IsOneWay = false)]
547 double GetDatasetLoadedPercentById(int nDatasetID, out double dfTraining, out double dfTesting);
548
554 [OperationContract(IsOneWay = false)]
556
562 [OperationContract(IsOneWay = false)]
564
570 [OperationContract(IsOneWay = false)]
572
583 [OperationContract(IsOneWay = false)]
584 int GetImageCount(int nSrcId, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false);
585
586 #endregion // Properties
587
588 #region Sources
589
595 [OperationContract(IsOneWay = false)]
597
603 [OperationContract(IsOneWay = false)]
605
611 [OperationContract(IsOneWay = false)]
612 string GetSourceName(int nSrcId);
613
619 [OperationContract(IsOneWay = false)]
620 int GetSourceID(string strSrc);
621
622 #endregion // Sources
623
624 #region Datasets
625
631 [OperationContract(IsOneWay = false)]
633
639 [OperationContract(IsOneWay = false)]
641
647 [OperationContract(IsOneWay = false)]
648 string GetDatasetName(int nDsId);
649
655 [OperationContract(IsOneWay = false)]
656 int GetDatasetID(string strDs);
657
663 [OperationContract(IsOneWay = false)]
664 bool ReloadDataset(int nDsId);
665
671 [OperationContract(IsOneWay = false)]
672 bool ReloadImageSet(int nSrcId);
673
679 [OperationContract(IsOneWay = false)]
680 bool UnloadDatasetByName(string strDataset);
681
688 [OperationContract(IsOneWay = false)]
689 bool UnloadDatasetById(int nDatasetID);
690
691 #endregion // Datasets
692
693 #region Image Acquisition
694
706 [OperationContract(IsOneWay = false)]
707 SimpleDatum QueryImage(int nSrcId, int nIdx, IMGDB_LABEL_SELECTION_METHOD? labelSelectionOverride = null, IMGDB_IMAGE_SELECTION_METHOD? imageSelectionOverride = null, int? nLabel = null, bool bLoadDataCriteria = false, bool bLoadDebugData = false);
708
722 [OperationContract(IsOneWay = false)]
723 List<SimpleDatum> GetImagesFromIndex(int nSrcId, int nStartIdx, int nQueryCount = int.MaxValue, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false, bool bAttemptDirectLoad = false);
724
737 [OperationContract(IsOneWay = false)]
738 List<SimpleDatum> GetImagesFromTime(int nSrcId, DateTime dtStart, int nQueryCount = int.MaxValue, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false);
739
751 [OperationContract(IsOneWay = false)]
752 List<SimpleDatum> GetImages(int nSrcId, int[] rgIdx, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false);
753
760 [OperationContract(IsOneWay = false)]
761 SimpleDatum GetImage(int nImageID, params int[] rgSrcId);
762
774 [OperationContract(IsOneWay = false)]
775 int FindImageIndex(int nSrcId, DateTime dt, string strDescription);
776
777 #endregion
778
779 #region Image Mean
780
786 [OperationContract(IsOneWay = false)]
787 [FaultContract(typeof(ImageDatabaseErrorData))]
789
799 [OperationContract(IsOneWay = false)]
800 [FaultContract(typeof(ImageDatabaseErrorData))]
802
808 [OperationContract(IsOneWay = false)]
809 [FaultContract(typeof(ImageDatabaseErrorData))]
811
817 [OperationContract(IsOneWay = false)]
819
820 #endregion // Image Mean
821
822 #region Labels
823
829 [OperationContract(IsOneWay = false)]
830 List<LabelDescriptor> GetLabels(int nSrcId);
831
838 [OperationContract(IsOneWay = false)]
839 string GetLabelName(int nSrcId, int nLabel);
840
846 [OperationContract(IsOneWay = false)]
847 void SetLabelMapping(int nSrcId, LabelMapping map);
848
855 [OperationContract(IsOneWay = false)]
856 void UpdateLabelMapping(int nSrcId, int nNewLabel, List<int> rgOriginalLabels);
857
863 [OperationContract(IsOneWay = false)]
864 void ResetLabels(int nProjectId, int nSrcId);
865
871 [OperationContract(IsOneWay = false)]
872 void UpdateLabelCounts(int nProjectId, int nSrcId);
873
879 [OperationContract(IsOneWay = false)]
880 [FaultContract(typeof(ImageDatabaseErrorData))]
881 Dictionary<int, int> LoadLabelCounts(int nSrcId);
882
888 [OperationContract(IsOneWay = false)]
890
896 [OperationContract(IsOneWay = false)]
897 string GetLabelCountsAsTextFromSourceName(string strSource);
898
899 #endregion // Labels
900 }
901
905 [ServiceContract(CallbackContract = typeof(IXImageDatabaseEvent), SessionMode = SessionMode.Required)]
907 {
913 [OperationContract(IsOneWay = false)]
914 void UpdateLabelBoosts(int nProjectId, int nSrcId);
915
920 [OperationContract(IsOneWay = false)]
921 void ResetQuery(int nDsID);
922
929 [OperationContract(IsOneWay = false)]
930 bool Sort(int nSrcId, IMGDB_SORT method);
931
937 [OperationContract(IsOneWay = false)]
939
945 [OperationContract(IsOneWay = false)]
946 bool DeleteCreatedDataset(int nDsId);
947
951 [OperationContract(IsOneWay = false)]
953
959 [OperationContract(IsOneWay = false)]
960 void DeleteLabelBoosts(int nProjectId, int nSrcId);
961
969 [OperationContract(IsOneWay = false)]
970 void AddLabelBoost(int nProjectId, int nSrcId, int nLabel, double dfBoost);
971
978 [OperationContract(IsOneWay = false)]
979 string GetLabelBoostsAsTextFromProject(int nProjectId, int nSrcId);
980
986 [OperationContract(IsOneWay = false)]
987 bool LoadNextSet(string strEvtCancel);
988 }
989
993 [ServiceContract(CallbackContract = typeof(IXImageDatabaseEvent), SessionMode = SessionMode.Required)]
995 {
996 #region Initialization and Cleanup
997
1005 [OperationContract(IsOneWay = false)]
1006 long InitializeWithDsName(SettingsCaffe s, string strDs, string strEvtCancel = null);
1007
1015 [OperationContract(IsOneWay = false)]
1016 long InitializeWithDs(SettingsCaffe s, DatasetDescriptor ds, string strEvtCancel = null);
1017
1027 [OperationContract(IsOneWay = false)]
1028 long InitializeWithDsId(SettingsCaffe s, int nDataSetID, string strEvtCancel = null, int nPadW = 0, int nPadH = 0);
1029
1040 [OperationContract(IsOneWay = false)]
1041 long LoadDatasetByID(int nDsId, string strEvtCancel = null);
1042
1053 [OperationContract(IsOneWay = false)]
1054 long LoadDatasetByName(string strDs, string strEvtCancel = null);
1055
1061 [OperationContract(IsOneWay = false)]
1062 bool ReloadIndexing(int nDsId);
1063
1069 [OperationContract(IsOneWay = false)]
1070 bool ReloadIndexing(string strDs);
1071
1080 bool WaitForDatasetToLoad(int nDsId, bool bTraining, bool bTesting, int nWait = int.MaxValue);
1081
1090 bool WaitForDatasetToLoad(string strDs, bool bTraining, bool bTesting, int nWait = int.MaxValue);
1091
1092 #endregion // Initialization and Cleanup
1093
1094 #region Query States
1095
1104 [OperationContract(IsOneWay = false)]
1105 long CreateQueryState(int nDsId, bool bUseUniqueLabelIndexes = true, bool bUseUniqueImageIndexes = true, IMGDB_SORT sort = IMGDB_SORT.NONE);
1106
1115 [OperationContract(IsOneWay = false)]
1116 long CreateQueryState(string strDs, bool bUseUniqueLabelIndexes = true, bool bUseUniqueImageIndexes = true, IMGDB_SORT sort = IMGDB_SORT.NONE);
1117
1124 [OperationContract(IsOneWay = false)]
1125 bool SetDefaultQueryState(int nDsId, long lQueryState);
1126
1133 [OperationContract(IsOneWay = false)]
1134 bool SetDefaultQueryState(string strDs, long lQueryState);
1135
1142 [OperationContract(IsOneWay = false)]
1143 bool FreeQueryState(int nDsId, long lHandle);
1144
1151 [OperationContract(IsOneWay = false)]
1152 bool FreeQueryState(string strDs, long lHandle);
1153
1160 [OperationContract(IsOneWay = false)]
1161 string GetLabelQueryHitPercentsAsTextFromSourceName(long lQueryState, string strSource);
1162
1169 [OperationContract(IsOneWay = false)]
1170 string GetLabelQueryEpocsAsTextFromSourceName(long lQueryState, string strSource);
1171
1178 [OperationContract(IsOneWay = false)]
1179 string GetBoostQueryHitPercentsAsTextFromSourceName(long lQueryState, string strSource);
1180
1181 #endregion // Query States
1182
1183 #region Properties
1184
1196 [OperationContract(IsOneWay = false)]
1197 int GetImageCount(long lQueryState, int nSrcId, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false);
1198
1199 #endregion // Properties
1200
1201 #region Image Acquisition
1202
1217 [OperationContract(IsOneWay = false)]
1218 List<SimpleDatum> GetImagesFromIndex(long lQueryState, int nSrcId, int nStartIdx, int nQueryCount = int.MaxValue, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false, bool bAttemptDirectLoad = false);
1219
1233 [OperationContract(IsOneWay = false)]
1234 List<SimpleDatum> GetImagesFromTime(long lQueryState, int nSrcId, DateTime dtStart, int nQueryCount = int.MaxValue, string strFilterVal = null, int? nBoostVal = null, bool bBoostValIsExact = false);
1235
1248 [OperationContract(IsOneWay = false)]
1249 SimpleDatum QueryImage(long lQueryState, int nSrcId, int nIdx, IMGDB_LABEL_SELECTION_METHOD? labelSelectionOverride = null, IMGDB_IMAGE_SELECTION_METHOD? imageSelectionOverride = null, int? nLabel = null, bool bLoadDataCriteria = false, bool bLoadDebugData = false);
1250
1251 #endregion // Image Acquisition
1252
1253 #region Boosts
1254
1262 [OperationContract(IsOneWay = false)]
1263 void ResetAllBoosts(int nSrcId);
1264
1265 #endregion // Boosts
1266
1267 #region Load Limit Refresh
1268
1277 bool WaitForDatasetToRefresh(int nDsId, bool bTraining, bool bTesting, int nWait = int.MaxValue);
1278
1287 bool WaitForDatasetToRefresh(string strDs, bool bTraining, bool bTesting, int nWait = int.MaxValue);
1288
1296 bool IsRefreshRunning(int nDsId, bool bTraining, bool bTesting);
1297
1305 bool IsRefreshRunning(string strDs, bool bTraining, bool bTesting);
1306
1318 bool StartRefresh(string strDs, bool bTraining, bool bTesting, double dfReplacementPct);
1319
1330 bool StopRefresh(string strDs, bool bTraining, bool bTesting);
1331
1343 bool StartRefresh(int nDsID, bool bTraining, bool bTesting, double dfReplacementPct);
1344
1355 bool StopRefresh(int nDsID, bool bTraining, bool bTesting);
1356
1366 bool StartAutomaticRefreshSchedule(string strDs, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct);
1367
1375 bool StopAutomaticRefreshSchedule(string strDs, bool bTraining, bool bTesting);
1376
1386 bool GetScheduledAutoRefreshInformation(string strDs, out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount);
1387
1397 bool StartAutomaticRefreshSchedule(int nDsID, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct);
1398
1406 bool StopAutomaticRefreshSchedule(int nDsID, bool bTraining, bool bTesting);
1407
1417 bool GetScheduledAutoRefreshInformation(int nDsID, out int nPeriodInMs, out double dfReplacementPct, out int nTrainingRefreshCount, out int nTestingRefreshCount);
1418
1419 #endregion
1420
1421 #region Results
1422
1430 List<SimpleResult> GetAllResults(string strSource, bool bRequireExtraData, int nMax = -1);
1431
1432 #endregion
1433 }
1434
1435#pragma warning disable 1591
1436
1437 [DataContract]
1438 public class ImageDatabaseErrorData
1439 {
1440 [DataMember]
1441 public bool Result { get; set; }
1442 [DataMember]
1443 public string ErrorMessage { get; set; }
1444 [DataMember]
1445 public string ErrorDetails { get; set; }
1446 }
1447
1448#pragma warning restore 1591
1449}
The ConnectInfo class specifies the server, database and username/password used to connect to a datab...
Definition: ConnectInfo.cs:14
The LabelMapping class represents a single label mapping.
The Result class contains a single result.
Definition: Result.cs:14
The SettingsCaffe defines the settings used by the MyCaffe CaffeControl.
The SimpleDatum class holds a data input within host memory.
Definition: SimpleDatum.cs:19
The DatasetDescriptor class describes a dataset which contains both a training data source and testin...
The SourceDescriptor class contains all information describing a data source.
Defines the ITest interface used by the Test module to return its known failures.
Definition: Interfaces.cs:234
List< Tuple< string, string, string > > KnownFailures
Get the known failures of the test module.
Definition: Interfaces.cs:238
int GetPriority(string strClass, string strMethod)
Get the priority of a class::method pair.
The IXImageDatabase interface defines the eneral interface to the in-memory image database.
Definition: Interfaces.cs:907
void DeleteAllCreatedDatasets()
Delete all datasets created with CreateDatasetOrganizedByTime.
string GetLabelBoostsAsTextFromProject(int nProjectId, int nSrcId)
Returns the label boosts as a text string for all boosted labels within a data source associated with...
int CreateDatasetOranizedByTime(int nDsId)
Create a dynamic dataset organized by time from a pre-existing dataset.
bool LoadNextSet(string strEvtCancel)
When using a Load Limit that is greater than 0, this function loads the next set of images.
bool DeleteCreatedDataset(int nDsId)
Delete a dataset created with CreateDatasetOrganizedByTime.
void AddLabelBoost(int nProjectId, int nSrcId, int nLabel, double dfBoost)
Add a label boost for a data source associated with a given project.
bool Sort(int nSrcId, IMGDB_SORT method)
Sort the internal images.
void DeleteLabelBoosts(int nProjectId, int nSrcId)
Delete all label boosts for a given data source associated with a given project.
void UpdateLabelBoosts(int nProjectId, int nSrcId)
Updates the label boosts for the images based on the label boosts set for the given project.
void ResetQuery(int nDsID)
Reset the query for the given data set ID.
The IXImageDatabase2 interface defines the general interface to the in-memory image database (v2).
Definition: Interfaces.cs:995
bool ReloadIndexing(string strDs)
Reload the indexing for a data set.
string GetLabelQueryEpocsAsTextFromSourceName(long lQueryState, string strSource)
Returns a string with the query epoch counts for each label (e.g. the number of times all images with...
List< SimpleResult > GetAllResults(string strSource, bool bRequireExtraData, int nMax=-1)
Query all results for a given data source.
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...
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 ordering.
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...
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 ordering.
bool StopRefresh(int nDsID, bool bTraining, bool bTesting)
Stop a refresh operation running on the dataset.
bool FreeQueryState(string strDs, long lHandle)
Frees a query state from a given dataset.
bool StopAutomaticRefreshSchedule(string strDs, bool bTraining, bool bTesting)
Stop the automatic refresh schedule running on a dataset.
long InitializeWithDsId(SettingsCaffe s, int nDataSetID, string strEvtCancel=null, int nPadW=0, int nPadH=0)
Initializes the image database.
string GetBoostQueryHitPercentsAsTextFromSourceName(long lQueryState, string strSource)
Returns a string with the query hit percent for each boost (e.g. the percentage that each boost value...
bool ReloadIndexing(int nDsId)
Reload the indexing for a data set.
bool WaitForDatasetToRefresh(string strDs, bool bTraining, bool bTesting, int nWait=int.MaxValue)
Wait for the dataset refreshing to complete.
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...
long LoadDatasetByName(string strDs, string strEvtCancel=null)
Load another, 'secondary' dataset.
bool StartAutomaticRefreshSchedule(string strDs, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct)
Start the automatic refresh cycle to occur on specified period increments.
bool StopAutomaticRefreshSchedule(int nDsID, bool bTraining, bool bTesting)
Stop the automatic refresh schedule running on a dataset.
bool SetDefaultQueryState(string strDs, long lQueryState)
Set the default query state to the query state specified for the dataset specified.
int GetImageCount(long lQueryState, int nSrcId, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
Returns the number of images in a given data source.
bool FreeQueryState(int nDsId, long lHandle)
Frees a query state from a given dataset.
void ResetAllBoosts(int nSrcId)
Reset all in-memory image boosts.
long InitializeWithDs(SettingsCaffe s, DatasetDescriptor ds, string strEvtCancel=null)
Initializes the image database.
bool WaitForDatasetToLoad(string strDs, bool bTraining, bool bTesting, int nWait=int.MaxValue)
Wait for the dataset loading to complete.
SimpleDatum QueryImage(long lQueryState, int nSrcId, int nIdx, IMGDB_LABEL_SELECTION_METHOD? labelSelectionOverride=null, IMGDB_IMAGE_SELECTION_METHOD? imageSelectionOverride=null, int? nLabel=null, bool bLoadDataCriteria=false, bool bLoadDebugData=false)
Query an image in a given data source.
bool WaitForDatasetToLoad(int nDsId, bool bTraining, bool bTesting, int nWait=int.MaxValue)
Wait for the dataset loading to complete.
bool StopRefresh(string strDs, bool bTraining, bool bTesting)
Stop a refresh operation running on the dataset.
bool IsRefreshRunning(int nDsId, bool bTraining, bool bTesting)
Returns true if the refresh operation running.
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...
List< SimpleDatum > GetImagesFromIndex(long lQueryState, int nSrcId, int nStartIdx, int nQueryCount=int.MaxValue, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false, bool bAttemptDirectLoad=false)
Returns the array of images in the image set, possibly filtered with the filtering parameters.
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.
long LoadDatasetByID(int nDsId, string strEvtCancel=null)
Load another, 'secondary' dataset.
string GetLabelQueryHitPercentsAsTextFromSourceName(long lQueryState, string strSource)
Returns a string with the query hit percent for each label (e.g. the percentage that each label has b...
long InitializeWithDsName(SettingsCaffe s, string strDs, string strEvtCancel=null)
Initializes the image database.
bool SetDefaultQueryState(int nDsId, long lQueryState)
Set the default query state to the query state specified for the dataset specified.
List< SimpleDatum > GetImagesFromTime(long lQueryState, int nSrcId, DateTime dtStart, int nQueryCount=int.MaxValue, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
Returns the array of images in the image set, possibly filtered with the filtering parameters.
bool StartAutomaticRefreshSchedule(int nDsID, bool bTraining, bool bTesting, int nPeriodInMs, double dfReplacementPct)
Start the automatic refresh cycle to occur on specified period increments.
The IXImageDatabaseBase interface defines the general interface to the in-memory image database.
Definition: Interfaces.cs:415
bool UnloadDatasetByName(string strDataset)
The UnloadDataset function unloads a given dataset from memory.
List< LabelDescriptor > GetLabels(int nSrcId)
Returns a list of LabelDescriptors associated with the labels within a data source.
string GetDatasetName(int nDsId)
Returns a data set name given its ID.
void SetLabelMapping(int nSrcId, LabelMapping map)
Sets the label mapping to the database for a given data source.
bool GetLoadImageDebugData()
Returns whether or not the image debug data is loaded with each image.
SourceDescriptor GetSourceByName(string strSrc)
Returns the SourceDescriptor for a given data source name.
List< SimpleDatum > GetImagesFromTime(int nSrcId, DateTime dtStart, int nQueryCount=int.MaxValue, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
Returns the array of images in the image set, possibly filtered with the filtering parameters.
void SetSelectionMethod(IMGDB_LABEL_SELECTION_METHOD? lbl, IMGDB_IMAGE_SELECTION_METHOD? img)
Sets the label and image selection methods.
bool GetLoadImageDataCriteria()
Returns whether or not the image data criteria is loaded with each image.
SourceDescriptor GetSourceById(int nSrcId)
Returns the SourceDescriptor for a given data source ID.
void CleanUp(int nDsId=0, bool bForce=false)
Releases the image database, and if this is the last instance using the in-memory database,...
bool LoadDatasetByName1(string strDs, string strEvtCancel=null)
Load another, 'secondary' dataset.
SimpleDatum QueryImageMean(int nSrcId)
Queries the image mean for a data source from the database on disk.
SimpleDatum GetImageMean(int nSrcId)
Returns the image mean for a data source.
void SetConnection(ConnectInfo ci)
Set the database connection to use.
SimpleDatum QueryImage(int nSrcId, int nIdx, IMGDB_LABEL_SELECTION_METHOD? labelSelectionOverride=null, IMGDB_IMAGE_SELECTION_METHOD? imageSelectionOverride=null, int? nLabel=null, bool bLoadDataCriteria=false, bool bLoadDebugData=false)
Query an image in a given data source.
int GetSourceID(string strSrc)
Returns a data source ID given its name.
DatasetDescriptor GetDatasetByName(string strDs)
Returns the DatasetDescriptor for a given data set name.
IMGDB_VERSION GetVersion()
Returns the version of the MyCaffe Image Database being used.
bool InitializeWithDsName1(SettingsCaffe s, string strDs, string strEvtCancel=null)
Initializes the image database.
List< SimpleDatum > GetImages(int nSrcId, int[] rgIdx, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
Returns the array of images in the image set, possibly filtered with the filtering parameters.
string GetLabelCountsAsTextFromSourceId(int nSrcId)
Returns a string with all label counts for a data source.
int GetImageCount(int nSrcId, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false)
Returns the number of images in a given data source.
bool UnloadDatasetById(int nDatasetID)
The UnloadDataset function unloads a given dataset from memory.
string GetLabelQueryHitPercentsAsTextFromSourceName(string strSource)
Returns a string with the query hit percent for each label (e.g. the percentage that each label has b...
Dictionary< int, int > LoadLabelCounts(int nSrcId)
Returns a label lookup of counts for a given data source.
bool ReloadDataset(int nDsId)
Reload a data set.
void UpdateLabelMapping(int nSrcId, int nNewLabel, List< int > rgOriginalLabels)
Updates the label mapping in the database for a given data source.
string GetLabelQueryEpocsAsTextFromSourceName(string strSource)
Returns a string with the query epoch counts for each label (e.g. the number of times all images with...
Tuple< IMGDB_LABEL_SELECTION_METHOD, IMGDB_IMAGE_SELECTION_METHOD > GetSelectionMethod()
Returns the label and image selection method used.
bool InitializeWithDs1(SettingsCaffe s, DatasetDescriptor ds, string strEvtCancel=null)
Initializes the image database.
bool InitializeWithDsId1(SettingsCaffe s, int nDataSetID, string strEvtCancel=null, int nPadW=0, int nPadH=0)
Initializes the image database.
int GetDatasetID(string strDs)
Returns a data set ID given its name.
SimpleDatum QueryImageMeanFromDb(int nSrcId)
Queries the image mean for a data source from the database on disk.
bool ReloadImageSet(int nSrcId)
Reloads the images of a data source.
string GetLabelCountsAsTextFromSourceName(string strSource)
Returns a string with all label counts for a data source.
string GetBoostQueryHitPercentsAsTextFromSourceName(string strSource)
Returns a string with the query hit percent for each boost (e.g. the percentage that each boost value...
int FindImageIndex(int nSrcId, DateTime dt, string strDescription)
Searches for the image index of an image within a data source matching a DateTime/description pattern...
SimpleDatum GetImage(int nImageID, params int[] rgSrcId)
Get the image with a given Raw Image ID.
List< SimpleDatum > GetImagesFromIndex(int nSrcId, int nStartIdx, int nQueryCount=int.MaxValue, string strFilterVal=null, int? nBoostVal=null, bool bBoostValIsExact=false, bool bAttemptDirectLoad=false)
Returns the array of images in the image set, possibly filtered with the filtering parameters.
DatasetDescriptor GetDatasetById(int nDsId)
Returns the DatasetDescriptor for a given data set ID.
void ResetLabels(int nProjectId, int nSrcId)
Resets all labels within a data source, used by a project, to their original labels.
SimpleDatum QueryImageMeanFromDataset(int nDatasetId)
Returns the image mean for the Training data source of a given data set.
double GetDatasetLoadedPercentByName(string strDataset, out double dfTraining, out double dfTesting)
Returns the percentage that a dataset is loaded into memory.
double GetDatasetLoadedPercentById(int nDatasetID, out double dfTraining, out double dfTesting)
Returns the percentage that a dataset is loaded into memory.
bool LoadDatasetByID1(int nDsId, string strEvtCancel=null)
Load another, 'secondary' dataset.
void UpdateLabelCounts(int nProjectId, int nSrcId)
Updates the number of images of each label within a data source.
string GetSourceName(int nSrcId)
Returns a data source name given its ID.
string GetLabelName(int nSrcId, int nLabel)
Returns the text name of a given label within a data source.
The descriptors namespace contains all descriptor used to describe various items stored within the da...
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
Definition: Annotation.cs:12
Phase
Defines the Phase under which to run a Net.
Definition: Interfaces.cs:42
@ TEST
Run a testing phase.
@ ALL
Applies to all phases.
@ RUN
Run on an image given to the Net.
@ TRAIN
Run a training phase.
IMGDB_LABEL_SELECTION_METHOD
Defines the label selection method.
Definition: Interfaces.cs:314
SNAPSHOT_LOAD_METHOD
Defines the snapshot load method.
Definition: Interfaces.cs:185
@ STATE_BEST_ACCURACY
Load the state with the best accuracy (which may not be the last).
@ LAST_STATE
Load the last solver state snapshotted.
@ STATE_BEST_ERROR
Load the state with the best error (which may not be the last).
@ WEIGHTS_BEST_ERROR
Load the weights with the best error (which may not be the last).
@ WEIGHTS_BEST_ACCURACY
Load the weights with the best accuracy (which may not be the last).
IMGDB_SORT
Defines the sorting method.
Definition: Interfaces.cs:339
@ BYIDX
Sort by image Index.
@ BYDESC
Sort by description first.
@ BYID
Sort by image ID.
@ BYID_DESC
Sort by image ID in decending order.
IMAGEDB_LOAD_METHOD
Defines how to laod the images into the image database.
Definition: Interfaces.cs:135
@ LOAD_ON_DEMAND_BACKGROUND
Load the image as they are queried AND start the background loading at the same time.
@ LOAD_ON_DEMAND
Load the images as they are queried - this option cahces images into memory as needed,...
@ LOAD_EXTERNAL
Load the images from an external source such as a Windows Service - this option provides the best bal...
@ LOAD_ON_DEMAND_NOCACHE
Load the images on demand, but do not cache the images - this option loads images from disk as needed...
@ LOAD_ALL
Load all of the images into memory - this option provides the highest training speeds,...
GYM_TYPE
Defines the gym type (if any).
Definition: Interfaces.cs:97
@ DYNAMIC
Specifies a dynamic gym type that dynamically produces its data.
@ DATA
Specifies a data gym that collects data from a data source, such as a database.
IMGDB_IMAGE_SELECTION_METHOD
Defines the image selection method.
Definition: Interfaces.cs:259
@ RANDOM
Randomly select the images, ignore the input index.
@ RANDOM_AND_PAIR
Combines RANDOM + PAIR for marshalling.
@ FIXEDINDEX
Specifically select based on the input index.
@ PAIR
Pair select the images where the first query returns a randomly selected image, and the next query re...
@ RANDOM_AND_PAIR_AND_BOOST
Combines RANDOM + PAIR + BOOST for marshalling.
@ BOOST
Randomly select, but given higher priority to boosted images using the super-boost setting.
@ RANDOM_AND_BOOST
Combines RANDOM + BOOST for marshalling.
SNAPSHOT_WEIGHT_UPDATE_METHOD
Defines the snapshot weight update method.
Definition: Interfaces.cs:162
@ FAVOR_ACCURACY
Update the snapshot weights when the accuracy increases.
@ FAVOR_ERROR
Update the snapshot weights when the error decreases.
@ FAVOR_BOTH
Update the snapshot weights when the accuracy increases or the error decreases.
TRAINING_CATEGORY
Defines the category of training.
Definition: Interfaces.cs:15
@ CUSTOM
Defines a purely custom training method.
@ RECURRENT
Defines the recurrent training method.
@ REINFORCEMENT
Defines the reinforcement training method such as PG.
@ NONE
No training category specified.
@ DUAL
Defines the reinforcement training method such as PG that also uses a recurrent model such as LSTM.
IMGDB_VERSION
Defines the image database version to use.
Definition: Interfaces.cs:378
@ V1
Specifies to use the original image database.
@ V2
Specifies to use the new image database v2.
ApVersion
Defines the different way of computing average precision.
Definition: Interfaces.cs:215
@ ELEVENPOINT
Specifies the 11-point interpolated average precision, used in VOC2007.
@ MAXINTEGRAL
Specifies the maximally interpolated AP, used in VOC2012/ILSVRC.
@ INTEGRAL
Specifies the natural integral of the precision-recall curve.
DATA_TYPE
Defines the gym data type.
Definition: Interfaces.cs:116
@ BLOB
Specifies to use a SimpleDatum blob of data of the gym (if supported).
@ DEFAULT
Specifies to use the default data type of the gym used.
@ VALUES
Specifies to use the raw state values of the gym (if supported).
Stage
Specifies the stage underwhich to run a custom trainer.
Definition: Interfaces.cs:69
@ RNN
Run the trainer in RNN mode.
@ RL
Run the trainer in RL mode.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...
Definition: Annotation.cs:12