2using System.Collections.Generic;
18 [TypeConverter(typeof(ExpandableObjectConverter))]
22 bool m_bShareLocation =
true;
23 int m_nBackgroundLabelId = 0;
27 bool m_bVarianceEncodedInTarget =
false;
29 float? m_fConfidenceThreshold;
30 bool m_bVisualize =
false;
31 float? m_fVisualizeThreshold =
null;
32 string m_strSaveFile =
null;
44 [Description(
"Specifies the number of classes that are actually predicted - required!")]
47 get {
return m_nNumClasses; }
48 set { m_nNumClasses = value; }
54 [Description(
"If true, bounding boxe is shared among different classes.")]
57 get {
return m_bShareLocation; }
58 set { m_bShareLocation = value; }
67 [Description(
"Specifies the background class, set to -1 when there is no background class.")]
70 get {
return m_nBackgroundLabelId; }
71 set { m_nBackgroundLabelId = value; }
77 [Description(
"Parameter used for non maximum suppression.")]
80 get {
return m_nmsParam; }
81 set { m_nmsParam = value; }
87 [Description(
"Specifies the parameter used for saving detection results.")]
90 get {
return m_saveOutputParam; }
91 set { m_saveOutputParam = value; }
97 [Description(
"Specifies the coding method for the bbox.")]
100 get {
return m_codeType; }
101 set { m_codeType = value; }
107 [Description(
"Specifies whether or not the variance is encoded in the target; otherwise we need to adjust the predicted offset accordingly.")]
110 get {
return m_bVarianceEncodedInTarget; }
111 set { m_bVarianceEncodedInTarget = value; }
117 [Description(
"Specifies the number of total bboxes to be kept per image after nms step, -1 means keeping all bboxes after nms step.")]
120 get {
return m_nKeepTopK; }
121 set { m_nKeepTopK = value; }
127 [Description(
"Specifies the threshold for deciding which detections to consider - only those which are larger than this threshold.")]
130 get {
return m_fConfidenceThreshold; }
131 set { m_fConfidenceThreshold = value; }
137 [Description(
"Specifies whether or not to visualize the detection results.")]
140 get {
return m_bVisualize; }
141 set { m_bVisualize = value; }
147 [Description(
"Specifies the theshold used to visualize detection results.")]
150 get {
return m_fVisualizeThreshold; }
151 set { m_fVisualizeThreshold = value; }
157 [Description(
"When provided, specifies the outputs to the video file.")]
160 get {
return m_strSaveFile; }
161 set { m_strSaveFile = value; }
170 public override object Load(
System.IO.BinaryReader br,
bool bNewInstance =
true)
189 m_nNumClasses = p.m_nNumClasses;
190 m_bShareLocation = p.m_bShareLocation;
191 m_nBackgroundLabelId = p.m_nBackgroundLabelId;
192 m_nmsParam = p.m_nmsParam.
Clone();
194 m_codeType = p.m_codeType;
195 m_bVarianceEncodedInTarget = p.m_bVarianceEncodedInTarget;
196 m_nKeepTopK = p.m_nKeepTopK;
197 m_fConfidenceThreshold = p.m_fConfidenceThreshold;
198 m_bVisualize = p.m_bVisualize;
199 m_fVisualizeThreshold = p.m_fVisualizeThreshold;
200 m_strSaveFile = p.m_strSaveFile;
247 return new RawProto(strName,
"", rgChildren);
260 if ((strVal = rp.
FindValue(
"num_classes")) !=
null)
263 if ((strVal = rp.
FindValue(
"share_location")) !=
null)
266 if ((strVal = rp.
FindValue(
"background_label_id")) !=
null)
277 if ((strVal = rp.
FindValue(
"code_type")) !=
null)
286 throw new Exception(
"Unknown PriorBoxParameter.CodeType '" + strVal +
"'!");
289 if ((strVal = rp.
FindValue(
"variance_encoded_in_target")) !=
null)
292 if ((strVal = rp.
FindValue(
"keep_top_k")) !=
null)
295 if ((strVal = rp.
FindValue(
"confidence_threshold")) !=
null)
298 if ((strVal = rp.
FindValue(
"visualize")) !=
null)
301 if ((strVal = rp.
FindValue(
"visualize_threshold")) !=
null)
304 if ((strVal = rp.
FindValue(
"save_file")) !=
null)
static float ParseFloat(string strVal)
Parse float values using the US culture if the decimal separator = '.', then using the native culture...
The RawProtoCollection class is a list of RawProto objects.
void Add(RawProto p)
Adds a RawProto to the collection.
The RawProto class is used to parse and output Google prototxt file data.
RawProto FindChild(string strName)
Searches for a given node.
static RawProto Parse(string str)
Parses a prototxt and places it in a new RawProto.
string FindValue(string strName)
Searches for a falue of a node within this nodes children.
The LayerParameterBase is the base class for all other layer specific parameters.
Specifies the parameters for the DetectionOutputLayer.
PriorBoxParameter.CodeType code_type
Specifies the coding method for the bbox.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
bool visualize
Specifies whether or not to visualize the detection results.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
float? confidence_threshold
Specifies the threshold for deciding which detections to consider - only those which are larger than ...
float? visualize_threshold
Specifies the theshold used to visualize detection results.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
static DetectionOutputParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
NonMaximumSuppressionParameter nms_param
Specifies the parameter used for non maximum suppression.
bool variance_encoded_in_target
Specifies whether or not the variance is encoded in the target; otherwise we need to adjust the predi...
DetectionOutputParameter()
The constructor.
string save_file
When provided, specifies the outputs to the video file.
bool share_location
Specifies whether or not to sare the bounding box is shared among different classes (default = true).
uint num_classes
Specifies the number of classes that are actually predicted - required!
SaveOutputParameter save_output_param
Specifies the parameter used for saving the detection results.
int background_label_id
Specifies the background class.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
int keep_top_k
Specifies the number of total bboxes to be kept per image after nms step, -1 means keeping all bboxes...
Specifies the parameters for the NonMaximumSuppressionParameter used with SSD.
override RawProto ToProto(string strName)
Convert this object to a raw proto.
NonMaximumSuppressionParameter Clone()
Return a clone of the object.
static new NonMaximumSuppressionParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
Specifies the parameters for the PriorBoxParameter.
CodeType
Defines the encode/decode type.
Specifies the parameters for the SaveOutputLayer.
static new SaveOutputParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
SaveOutputParameter Clone()
Return a copy of this object.
override RawProto ToProto(string strName)
Convert this object to a raw proto.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.param.ssd namespace contains all SSD related parameter objects that correspond to the nat...
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...