2using System.Collections.Generic;
7using System.Threading.Tasks;
21 [TypeConverter(typeof(ExpandableObjectConverter))]
26 float m_fLocWeight = 1.0f;
28 bool m_bShareLocation =
true;
30 float m_fOverlapThreshold = 0.5f;
31 uint m_nBackgroundLabelId = 0;
32 bool m_bUseDifficultGt =
true;
33 bool? m_bDoNegMining =
null;
34 float m_fNegPosRatio = 3.0f;
35 float m_fNegOverlap = 0.5f;
37 bool m_bEncodeVarianceInTarget =
false;
38 bool m_bMapObjectToAgnostic =
false;
39 bool m_bIgnoreCrossBoundaryBbox =
false;
40 bool m_bBpInside =
false;
43 int m_nSampleSize = 64;
44 bool m_bUsePriorForNms =
false;
45 bool m_bUsePriorForMatching =
true;
46 bool m_bUseGpu =
false;
79 throw new Exception(
"Unknown LocLossType '" + str +
"'!");
114 throw new Exception(
"Unknown ConfLossType '" + str +
"'!");
145 case "PER_PREDICTION":
149 throw new Exception(
"Unknown MatchType '" + str +
"'!");
195 throw new Exception(
"Unknown MiningType '" + str +
"'!");
210 [Description(
"Get/set the localization loss type (default = SMOOTH_L1).")]
213 get {
return m_locLossType; }
214 set { m_locLossType = value; }
220 [Description(
"Get/set the confidence loss type (default = SOFTMAX).")]
223 get {
return m_confLossType; }
224 set { m_confLossType = value; }
230 [Description(
"Get/set the weight for the localization loss (default = 1.0).")]
233 get {
return m_fLocWeight; }
234 set { m_fLocWeight = value; }
240 [Description(
"Get/set the number of classes to be predicted - required")]
243 get {
return m_nNumClasses; }
244 set { m_nNumClasses = value; }
250 [Description(
"Get/sets whether or not the bounding box is shared among different classes (default = true).")]
253 get {
return m_bShareLocation; }
254 set { m_bShareLocation = value; }
260 [Description(
"Get/set the matching method used during training (default = PER_PREDICTION).")]
263 get {
return m_matchType; }
264 set { m_matchType = value; }
270 [Description(
"Get/set the overlap threshold (default = 0.5).")]
273 get {
return m_fOverlapThreshold; }
274 set { m_fOverlapThreshold = value; }
280 [Description(
"Get/set the background label id.")]
283 get {
return m_nBackgroundLabelId; }
284 set { m_nBackgroundLabelId = value; }
290 [Description(
"Get/set whether or not to consider the difficult ground truth (defalt = true).")]
293 get {
return m_bUseDifficultGt; }
294 set { m_bUseDifficultGt = value; }
303 [Description(
"DEPRECIATED: Get/set whether or not to perform negative mining (default = false).")]
306 get {
return m_bDoNegMining; }
307 set { m_bDoNegMining = value; }
313 [Description(
"Get/set the negative/positive ratio (default = 3.0).")]
316 get {
return m_fNegPosRatio; }
317 set { m_fNegPosRatio = value; }
323 [Description(
"Get/set the negative overlap upperbound for the unmatched predictions (default = 0.5).")]
326 get {
return m_fNegOverlap; }
327 set { m_fNegOverlap = value; }
333 [Description(
"Get/set the coding method for the bounding box.")]
336 get {
return m_codeType; }
337 set { m_codeType = value; }
343 [Description(
"Get/set whether or not to encode the variance of the prior box in the loc loss target instead of in the bbox (default = false).")]
346 get {
return m_bEncodeVarianceInTarget; }
347 set { m_bEncodeVarianceInTarget = value; }
353 [Description(
"Get/set whether or not to map all object classes to an agnostic class (default = false). This is useful when learning objectness detector.")]
356 get {
return m_bMapObjectToAgnostic; }
357 set { m_bMapObjectToAgnostic = value; }
364 [Description(
"Get/set whether or not to ignore cross boundary bbox during matching (default = false). The cross boundary bbox is a bbox who is outside of the image region.")]
367 get {
return m_bIgnoreCrossBoundaryBbox; }
368 set { m_bIgnoreCrossBoundaryBbox = value; }
374 [Description(
"Get/set whether or not to only backpropagate on corners which are inside of the image region when encode type is CORNER or CORNER_SIZE (default = false).")]
377 get {
return m_bBpInside; }
378 set { m_bBpInside = value; }
384 [Description(
"Get/set the mining type used during training (default = MAX_NEGATIVE).")]
387 get {
return m_miningType; }
388 set { m_miningType = value; }
394 [Description(
"Get/set the parameters used for the non maximum suppression during hard example training.")]
397 get {
return m_nmsParam; }
398 set { m_nmsParam = value; }
404 [Description(
"Get/set the number of samples (default = 64).")]
407 get {
return m_nSampleSize; }
408 set { m_nSampleSize = value; }
414 [Description(
"Get/set whether or not to use the prior bbox for nms.")]
417 get {
return m_bUsePriorForNms; }
418 set { m_bUsePriorForNms = value; }
424 [Description(
"Get/set whether or not to use prior for matching.")]
427 get {
return m_bUsePriorForMatching; }
428 set { m_bUsePriorForMatching = value; }
434 [Description(
"Use the GPU version of the algorithm.")]
437 get {
return m_bUseGpu; }
438 set { m_bUseGpu = value; }
447 public override object Load(BinaryReader br,
bool bNewInstance =
true)
535 return new RawProto(strName,
"", rgChildren);
548 if ((strVal = rp.
FindValue(
"loc_loss_type")) !=
null)
551 if ((strVal = rp.
FindValue(
"conf_loss_type")) !=
null)
554 if ((strVal = rp.
FindValue(
"loc_weight")) !=
null)
557 if ((strVal = rp.
FindValue(
"num_classes")) !=
null)
560 if ((strVal = rp.
FindValue(
"share_location")) !=
null)
563 if ((strVal = rp.
FindValue(
"match_type")) !=
null)
566 if ((strVal = rp.
FindValue(
"overlap_threshold")) !=
null)
569 if ((strVal = rp.
FindValue(
"background_label_id")) !=
null)
572 if ((strVal = rp.
FindValue(
"use_difficult_gt")) !=
null)
575 if ((strVal = rp.
FindValue(
"do_neg_mining")) !=
null)
578 if ((strVal = rp.
FindValue(
"neg_pos_ratio")) !=
null)
581 if ((strVal = rp.
FindValue(
"neg_overlap")) !=
null)
584 if ((strVal = rp.
FindValue(
"code_type")) !=
null)
587 if ((strVal = rp.
FindValue(
"encode_variance_in_target")) !=
null)
590 if ((strVal = rp.
FindValue(
"map_object_to_agnostic")) !=
null)
593 if ((strVal = rp.
FindValue(
"ignore_corss_boundary_bbox")) !=
null)
596 if ((strVal = rp.
FindValue(
"bp_inside")) !=
null)
599 if ((strVal = rp.
FindValue(
"mining_type")) !=
null)
606 if ((strVal = rp.
FindValue(
"sample_size")) !=
null)
609 if ((strVal = rp.
FindValue(
"use_prior_for_nms")) !=
null)
612 if ((strVal = rp.
FindValue(
"use_prior_for_matching")) !=
null)
615 if ((strVal = rp.
FindValue(
"use_gpu")) !=
null)
616 p.
use_gpu =
bool.Parse(strVal);
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 MultiBoxLossParameter.
float loc_weight
Get/set the weight for the localization loss (default = 1.0).
float overlap_threshold
Get/set the overlap threshold (default = 0.5).
bool use_difficult_gt
Get/set whether or not to consider the difficult ground truth (defalt = true).
override object Load(BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
bool use_gpu
Use the GPU version of the algorithm.
MatchType
Defines the matching method used during training.
PriorBoxParameter.CodeType code_type
Get/set the coding method for the bounding box.
static MiningType MiningTypeFromString(string str)
Convert a string into a MiningType.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
float neg_overlap
Get/set the negative overlap upperbound for the unmatched predictions (default = 0....
LocLossType
Defines the localization loss types.
int sample_size
Get/set the number of samples (default = 64).
float neg_pos_ratio
Get/set the negative/positive ratio (default = 3.0).
bool share_location
Get/sets whether or not the bounding box is shared among different classes (default = true).
MiningType
Defines the mining type used during training.
static MultiBoxLossParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
NonMaximumSuppressionParameter nms_param
Get/set the parameters used for the non maximum suppression during hard example training.
LocLossType loc_loss_type
Get/set the localization loss type (default = SMOOTH_L1).
static MatchType MatchTypeFromString(string str)
Convert a string into a MatchType.
uint background_label_id
Get/set the background label id.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
ConfLossType
Defines the confidence loss types.
bool encode_variance_in_target
Get/set whether or not to encode the variance of the prior box in the loc loss target instead of in t...
bool ignore_cross_boundary_bbox
Get/set whether or not to ignore cross boundary bbox during matching (default = false)....
static ConfLossType ConfLossTypeFromString(string str)
Convert a string into a ConfLossType.
bool map_object_to_agnostic
Get/set whether or not to map all object classes to an agnostic class (default = false)....
bool? do_neg_mining
DEPRECIATED: Get/set whether or not to perform negative mining (default = false).
bool bp_inside
Get/set whether or not to only backpropagate on corners which are inside of the image region when enc...
static LocLossType LocLossTypeFromString(string str)
Convert a string into a LocLossType.
ConfLossType conf_loss_type
Get/set the confidence loss type (default = SOFTMAX).
bool use_prior_for_matching
Get/set whether or not to use prior for matching.
uint num_classes
Get/set the number of classes to be predicted - required!
MiningType mining_type
Get/set the mining type used during training (default = MAX_NEGATIVE).
MultiBoxLossParameter()
The constructor.
bool use_prior_for_nms
Get/set whether or not to use the prior bbox for nms.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
MatchType match_type
Get/set the matching method used during training (default = PER_PREDICTION).
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.
static CodeType CodeTypeFromString(string str)
Convert a string into a CodeType.
CodeType
Defines the encode/decode type.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
@ NONE
No training category specified.
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-...