2using System.Collections.Generic;
7using System.Threading.Tasks;
20 [TypeConverter(typeof(ExpandableObjectConverter))]
23 float m_fBrightnessProb = 0;
24 float m_fBrightnessDelta = 0.0f;
26 float m_fContrastProb = 0;
27 float m_fContrastLower = 0.5f;
28 float m_fContrastUpper = 1.5f;
30 float m_fSaturationProb = 0;
31 float m_fSaturationLower = 0.5f;
32 float m_fSaturationUpper = 1.5f;
34 float m_fRandomOrderProb = 0;
36 long m_lRandomSeed = 0;
37 bool m_bUseGpu =
true;
53 get {
return m_lRandomSeed; }
54 set { m_lRandomSeed = value; }
62 get {
return m_bUseGpu; }
63 set { m_bUseGpu = value; }
69 [Description(
"Get/set probability of adjusting the brightness.")]
72 get {
return m_fBrightnessProb; }
73 set { m_fBrightnessProb = value; }
79 [Description(
"Get/set amount to add to the pixel values within [-delta,delta]")]
82 get {
return m_fBrightnessDelta; }
83 set { m_fBrightnessDelta = value; }
89 [Description(
"Get/set probability of adjusting the contrast.")]
92 get {
return m_fContrastProb; }
93 set { m_fContrastProb = value; }
99 [Description(
"Get/set lower bound for random contrast factor.")]
102 get {
return m_fContrastLower; }
103 set { m_fContrastLower = value; }
109 [Description(
"Get/set upper bound for random contrast factor.")]
112 get {
return m_fContrastUpper; }
113 set { m_fContrastUpper = value; }
119 [Description(
"Get/set probability of adjusting the saturation.")]
122 get {
return m_fSaturationProb; }
123 set { m_fSaturationProb = value; }
129 [Description(
"Get/set lower bound for random saturation factor.")]
132 get {
return m_fSaturationLower; }
133 set { m_fSaturationLower = value; }
139 [Description(
"Get/set upper bound for random saturation factor.")]
142 get {
return m_fSaturationUpper; }
143 set { m_fSaturationUpper = value; }
149 [Description(
"Get/set the probability of randomly ordering the image channels.")]
152 get {
return m_fRandomOrderProb; }
153 set { m_fRandomOrderProb = value; }
180 m_lRandomSeed = p.m_lRandomSeed;
203 RawProto rpBase = base.ToProto(
"option");
206 rgChildren.
Add(rpBase);
220 return new RawProto(strName,
"", rgChildren);
234 if (rpOption !=
null)
237 if ((strVal = rp.
FindValue(
"active")) !=
null)
238 p.
Active =
bool.Parse(strVal);
240 if ((strVal = rp.
FindValue(
"brightness_prob")) !=
null)
243 if ((strVal = rp.
FindValue(
"brightness_delta")) !=
null)
246 if ((strVal = rp.
FindValue(
"contrast_prob")) !=
null)
249 if ((strVal = rp.
FindValue(
"contrast_lower")) !=
null)
252 if ((strVal = rp.
FindValue(
"contrast_upper")) !=
null)
255 if ((strVal = rp.
FindValue(
"saturation_prob")) !=
null)
258 if ((strVal = rp.
FindValue(
"saturation_lower")) !=
null)
261 if ((strVal = rp.
FindValue(
"saturation_upper")) !=
null)
264 if ((strVal = rp.
FindValue(
"random_order_prob")) !=
null)
267 if ((strVal = rp.
FindValue(
"use_gpu")) !=
null)
268 p.
use_gpu =
bool.Parse(strVal);
270 if ((strVal = rp.
FindValue(
"random_seed")) !=
null)
The BaseParameter class is the base class for all other parameter classes.
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.
string FindValue(string strName)
Searches for a falue of a node within this nodes children.
The OptionalParameter is the base class for parameters that are optional such as the MaskParameter,...
static OptionalParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
OptionalParameter(bool bActive=false)
The constructor.
bool Active
When active, the parameter is used, otherwise it is ignored.
Specifies the parameters for the DistortionParameter used with SSD.
float contrast_lower
Get/set lower bound for random contrast factor (default = 0.5).
float random_order_prob
Get/set the probability of randomly ordering the image channels (default = 0).
override void Copy(OptionalParameter src)
Copy the object.
float brightness_delta
Get/set amount to add to the pixel values within [-delta,delta] (default = 0)
float saturation_prob
Get/set probability of adjusting the saturation (default = 0).
float saturation_lower
Get/set lower bound for random saturation factor (default = 0.5).
override RawProto ToProto(string strName)
Convert this object to a raw proto.
DistortionParameter(bool bActive)
The constructor.
bool use_gpu
Get/set whether or not to use the GPU for the distortion operations (default = true).
static new DistortionParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
long random_seed
Get/set the random seed (default = 0, only used when testing).
float saturation_upper
Get/set upper bound for random saturation factor (default = 1.5).
float brightness_prob
Get/set probability of adjusting the brightness (default = 0).
float contrast_prob
Get/set probability of adjusting the contrast (default = 0).
DistortionParameter Clone()
Return a clone of the object.
float contrast_upper
Get/set upper bound for random contrast factor (default = 1.5).
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-...