2using System.Collections.Generic;
18 Dictionary<int, string> m_rgLabels =
new Dictionary<int, string>();
19 List<Result> m_rgResultsOriginal =
new List<Result>();
20 List<Result> m_rgResultsSorted =
new List<Result>();
58 m_rgResultsOriginal = rgResults;
60 foreach (
Result item
in rgResults)
62 m_rgResultsSorted.Add(item);
65 m_rgResultsSorted = m_rgResultsSorted.OrderByDescending(p => p.Score).ToList();
96 get {
return m_resultType; }
104 List<double> rg =
new List<double>();
106 foreach (
Result item
in m_rgResultsOriginal)
119 get {
return m_rgResultsOriginal; }
127 get {
return m_rgResultsSorted; }
140 get {
return m_rgResultsSorted[0].Label; }
153 get {
return m_rgResultsSorted[0].Score; }
166 get {
return m_rgResultsSorted[m_rgResultsSorted.Count-1].Label; }
179 get {
return m_rgResultsSorted[m_rgResultsSorted.Count-1].Score; }
215 get {
return m_rgLabels; }
224 m_rgLabels =
new Dictionary<int, string>();
228 if (!m_rgLabels.ContainsKey(l.
Label))
241 for (
int i = 0; i < m_rgResultsOriginal.Count; i++)
243 int nLabel = m_rgResultsOriginal[i].Label;
244 double dfVal = m_rgResultsOriginal[i].Score;
245 string strName =
null;
247 if (m_rgLabels.ContainsKey(nLabel))
248 strName = m_rgLabels[nLabel];
256 strOut += nLabel.ToString();
259 strOut += dfVal.ToString(
"N4");
264 if (i < m_rgResultsOriginal.Count - 1)
278 int nW = (int)Math.Ceiling(Math.Sqrt(m_rgResultsOriginal.Count));
280 Size sz =
new Size(nW, nH);
The ColorMapper maps a value within a number range, to a Color within a color scheme.
The ImageData class is a helper class used to convert between Datum, other raw data,...
static Bitmap GetImage(SimpleDatum d, ColorMapper clrMap=null, List< int > rgClrOrder=null)
Converts a SimplDatum (or Datum) into an image, optionally using a ColorMapper.
The Result class contains a single result.
double Score
Returns the score of the run.
The LabelDescriptor class describes a single label.
int Label
Specifies the original label
string Name
Specifies the label name.
The ResultCollection contains the result of a given CaffeControl::Run.
ResultCollection(List< Result > rgResults, LayerParameter.LayerType outputLayerType)
The ResultCollection constructor.
override string ToString()
Returns a string representation of the results.
RESULT_TYPE ResultType
Returns the result type of the result data: PROBABILITIES (Sigmoid), DISTANCES (Decode),...
int DetectedLabelMaxSignal
Returns the detected label with the maximum signal.
List< Result > ResultsSorted
Returns the original results in sorted order.
double DetectedLabelOutput
Returns the detected label output depending on the result type (distance or probability) with a defau...
static RESULT_TYPE GetResultType(LayerParameter.LayerType type)
Get the result type based on the layer-type used.
List< double > GetEncoding()
Returns the data encoding values.
void SetLabels(List< LabelDescriptor > rgLabels)
Sets the label names in the label dictionary lookup.
Image ToImage(ColorMapper clrMap)
Converts the result collection into an image.
int DetectedLabel
Returns the detected label depending on the result type (distance or probability) with a default type...
RESULT_TYPE
Defines the type of result.
int DetectedLabelMinSignal
Returns the detected label with the minimum signal.
double DetectedLabelOutputMaxSignal
Returns the detected label output with the maximum signal.
List< Result > ResultsOriginal
Returns the original results.
Dictionary< int, string > Labels
Returns the dictionary lookup of the labels and their names.
double DetectedLabelOutputMinSignal
Returns the detected label output of the label with the minimum signal.
Specifies the base parameter for all layers.
LayerType
Specifies the layer type.
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.
@ TEMPORAL
Specifies to use the tempoal database.
@ NONE
No training category specified.
The MyCaffe.common namespace contains common MyCaffe classes.
The MyCaffe.db.image namespace contains all image database related classes.
The MyCaffe.param namespace contains parameters used to create models.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...