![]() |
MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
Applies common transformations to the input data, such as scaling, mirroring, subtracting the image mean... More...
Public Member Functions | |
| DataTransformer (CudaDnn< T > cuda, Log log, TransformationParameter p, Phase phase, int nC, int nH, int nW, SimpleDatum imgMean=null) | |
| The DataTransformer constructor. More... | |
| void | Dispose () |
| Cleanup all resources used. More... | |
| void | Update (int nDataSize=0, SimpleDatum imgMean=null) |
| Resync the transformer with changes in its parameter. More... | |
| List< int > | InferBlobShape (SimpleDatum d) |
| Infers the shape the transformed blob will have when the transformation is applied to the data. More... | |
| int[] | InferBlobShape (SimpleDatum d, int[] rgShape) |
| Infers the shape the transformed blob will have when the transformation is applied to the data. More... | |
| int[] | InferBlobShape (List< Datum > rgD, int[] rgShape) |
| Infers the shape the transformed blob will have when the transformation is applied to the data. More... | |
| List< int > | InferBlobShape (int nChannels, int nWidth, int nHeight) |
| Infers the shape of the transformed blow will have with the given channel, width and height. More... | |
| virtual void | InitRand () |
| Initialize the underlying random number generator. More... | |
| int | TransformLabel (SimpleDatum sd) |
| When active (label_mapping.Active = true), transforms the label if mapped using the label and boost. Otherwise if not active or not mapped, no label changes are made. More... | |
| void | Transform (List< Datum > rgDatum, Blob< T > blobTransformed, CudaDnn< T > cuda, Log log) |
| Transforms a list of Datum and places the transformed data into a Blob. More... | |
| void | Transform (List< SimpleDatum > rgDatum, Blob< T > blobTransformed, CudaDnn< T > cuda, Log log, bool bJustFill=false) |
| Transforms a list of Datum and places the transformed data into a Blob. More... | |
| void | Transform (SimpleDatum[] rgDatum, Blob< T > blobTransformed, CudaDnn< T > cuda, Log log, bool bJustFill=false) |
| Transforms a list of Datum and places the transformed data into a Blob. More... | |
| AnnotationGroupCollection | Transform (SimpleDatum d, Blob< T > blob) |
| Transforms a Datum and places the dat ainto a Blob. More... | |
| AnnotationGroupCollection | Transform (SimpleDatum d, Blob< T > blob, out bool bDoMirror) |
| Transforms a Datum and places the dat ainto a Blob. More... | |
| T[] | Transform (SimpleDatum d, out bool bMirror, NormalizedBBox crop_bbox=null) |
| Transform the data into an array of transformed values. More... | |
| T[] | Transform (SimpleDatum d) |
| Transform the data into an array of transformed values. More... | |
| T[] | Transform (SimpleDatum d, out AnnotationGroupCollection rgTransformedAnnoVec, out bool bMirror, bool bResize=true) |
| Transform the data into an array of transformed values. More... | |
| AnnotationGroupCollection | TransformAnnotation (SimpleDatum d, NormalizedBBox crop_bbox, bool bMirror, bool bResize) |
| Transform the annotation data. More... | |
| void | SetRange (Blob< T > b) |
| Scales the data of a Blob to fit in a given range based on the DataTransformers parameters. More... | |
| SimpleDatum | CropImage (SimpleDatum d, NormalizedBBox bbox) |
| Crop the SimpleDatum according to the bbox. More... | |
| SimpleDatum | ExpandImage (SimpleDatum d, NormalizedBBox expand_bbox, float fExpandRatio) |
| Expand the SimpleDatum according to the bbox. More... | |
| SimpleDatum | ExpandImage (SimpleDatum d) |
| Expand the datum and adjust the AnnotationGroup. More... | |
| SimpleDatum | DistortImage (SimpleDatum d) |
| Distort the SimpleDatum. More... | |
| void | DistortImage (Blob< T > b) |
| Distort the images within a Blob. More... | |
| SimpleDatum | MaskImage (SimpleDatum d) |
| Maks out portions of the SimpleDatum. More... | |
| float[] | MaskData (int[] rgShape, float[] rgData) |
| Mask out the data based on the shape of the specified SimpleDatum. More... | |
| Datum | UnTransform (Blob< T > blob, bool bIncludeMean=true) |
| Reverse the transformation made when calling Transform. More... | |
Protected Member Functions | |
| virtual int | Rand (int n) |
| Generates a random integer from Uniform({0, 1, ..., n-1}). More... | |
Properties | |
| TransformationParameter | param [get] |
| Returns the TransformationParameter used. More... | |
| SimpleDatum | ImageMean [getset] |
| Get/set the image mean. More... | |
| Tuple< double, double > | LastRange [get] |
| Returns the last min/max observed. More... | |
Applies common transformations to the input data, such as scaling, mirroring, subtracting the image mean...
| T | Specifies the base type float or double. Using float is recommended to conserve GPU memory. |
Definition at line 22 of file DataTransformer.cs.
| MyCaffe.data.DataTransformer< T >.DataTransformer | ( | CudaDnn< T > | cuda, |
| Log | log, | ||
| TransformationParameter | p, | ||
| Phase | phase, | ||
| int | nC, | ||
| int | nH, | ||
| int | nW, | ||
| SimpleDatum | imgMean = null |
||
| ) |
The DataTransformer constructor.
| cuda | Specifies the connection to the CudaDnn dll which is only needed when using the bbox or image transformation functionality. |
| log | Specifies the Log used for output. |
| p | Specifies the TransformationParameter used to create the DataTransformer. |
| phase | Specifies the Phase under which the DataTransformer is run. |
| nC | Specifies the channels. |
| nH | Specifies the height. |
| nW | Specifies the width. |
| imgMean | Optionally, specifies the image mean to use. |
Definition at line 53 of file DataTransformer.cs.
| SimpleDatum MyCaffe.data.DataTransformer< T >.CropImage | ( | SimpleDatum | d, |
| NormalizedBBox | bbox | ||
| ) |
Crop the SimpleDatum according to the bbox.
| d | Specifies the SimpleDatum to crop. |
| bbox | Specifies the bounding box. |
Definition at line 1006 of file DataTransformer.cs.
| void MyCaffe.data.DataTransformer< T >.Dispose | ( | ) |
Cleanup all resources used.
Definition at line 81 of file DataTransformer.cs.
| void MyCaffe.data.DataTransformer< T >.DistortImage | ( | Blob< T > | b | ) |
Distort the images within a Blob.
| b | Specifies the Blob to distort. |
Definition at line 1259 of file DataTransformer.cs.
| SimpleDatum MyCaffe.data.DataTransformer< T >.DistortImage | ( | SimpleDatum | d | ) |
Distort the SimpleDatum.
| d | Specifies the SimpleDatum to distort. |
Note this function only applies when the distortion parameter 'use_gpu' = false, otherwise the distoration is applied after the data is transferred to the GPU.
Definition at line 1239 of file DataTransformer.cs.
| SimpleDatum MyCaffe.data.DataTransformer< T >.ExpandImage | ( | SimpleDatum | d | ) |
Expand the datum and adjust the AnnotationGroup.
| d | Specifies the datum to expand. |
Definition at line 1202 of file DataTransformer.cs.
| SimpleDatum MyCaffe.data.DataTransformer< T >.ExpandImage | ( | SimpleDatum | d, |
| NormalizedBBox | expand_bbox, | ||
| float | fExpandRatio | ||
| ) |
Expand the SimpleDatum according to the bbox.
| d | Specifies the SimpleDatum to expand. |
| expand_bbox | Specifies the bounding box. |
| fExpandRatio | Specifies the expansion ratio. |
Definition at line 1099 of file DataTransformer.cs.
| List< int > MyCaffe.data.DataTransformer< T >.InferBlobShape | ( | int | nChannels, |
| int | nWidth, | ||
| int | nHeight | ||
| ) |
Infers the shape of the transformed blow will have with the given channel, width and height.
| nChannels | Specifies the channels. |
| nWidth | Specifies the width. |
| nHeight | Specifies the height. |
Definition at line 296 of file DataTransformer.cs.
| int[] MyCaffe.data.DataTransformer< T >.InferBlobShape | ( | List< Datum > | rgD, |
| int[] | rgShape | ||
| ) |
Infers the shape the transformed blob will have when the transformation is applied to the data.
| rgD | A list of data containing the data to be transformed. |
| rgShape | Specifies the shape vector. |
Use the first datum in the vector to InferBlobShape.
Definition at line 276 of file DataTransformer.cs.
| List< int > MyCaffe.data.DataTransformer< T >.InferBlobShape | ( | SimpleDatum | d | ) |
Infers the shape the transformed blob will have when the transformation is applied to the data.
| d | Data containing the data to be transformed. |
Definition at line 226 of file DataTransformer.cs.
| int[] MyCaffe.data.DataTransformer< T >.InferBlobShape | ( | SimpleDatum | d, |
| int[] | rgShape | ||
| ) |
Infers the shape the transformed blob will have when the transformation is applied to the data.
| d | Data containing the data to be transformed. |
| rgShape | Specifies the shape vector to fill. |
Definition at line 240 of file DataTransformer.cs.
|
virtual |
Initialize the underlying random number generator.
Definition at line 323 of file DataTransformer.cs.
| float[] MyCaffe.data.DataTransformer< T >.MaskData | ( | int[] | rgShape, |
| float[] | rgData | ||
| ) |
Mask out the data based on the shape of the specified SimpleDatum.
| rgShape | Specifies the shape of the data. |
| rgData | Specifies the data. |
Definition at line 1340 of file DataTransformer.cs.
| SimpleDatum MyCaffe.data.DataTransformer< T >.MaskImage | ( | SimpleDatum | d | ) |
Maks out portions of the SimpleDatum.
| d | Specifies the SimpleDatum to mask. |
Definition at line 1294 of file DataTransformer.cs.
|
protectedvirtual |
Generates a random integer from Uniform({0, 1, ..., n-1}).
| n | The upper bound (exclusive) value of the random number. |
Definition at line 336 of file DataTransformer.cs.
| void MyCaffe.data.DataTransformer< T >.SetRange | ( | Blob< T > | b | ) |
Scales the data of a Blob to fit in a given range based on the DataTransformers parameters.
| b |
Definition at line 985 of file DataTransformer.cs.
| void MyCaffe.data.DataTransformer< T >.Transform | ( | List< Datum > | rgDatum, |
| Blob< T > | blobTransformed, | ||
| CudaDnn< T > | cuda, | ||
| Log | log | ||
| ) |
Transforms a list of Datum and places the transformed data into a Blob.
| rgDatum | Specifies a List of Datum to be transformed. |
| blobTransformed | Specifies the Blob where all transformed data is placed. |
| cuda | Specifies the CudaDnn connection to Cuda. |
| log | Specifies a Log for all output. |
Definition at line 373 of file DataTransformer.cs.
| void MyCaffe.data.DataTransformer< T >.Transform | ( | List< SimpleDatum > | rgDatum, |
| Blob< T > | blobTransformed, | ||
| CudaDnn< T > | cuda, | ||
| Log | log, | ||
| bool | bJustFill = false |
||
| ) |
Transforms a list of Datum and places the transformed data into a Blob.
| rgDatum | Specifies a List of SimpleDatum to be transformed. |
| blobTransformed | Specifies the Blob where all transformed data is placed. |
| cuda | Specifies the CudaDnn connection to Cuda. |
| log | Specifies a Log for all output. |
| bJustFill | Optionally, specifies to just fill the data blob with the data without actually transforming it. |
Definition at line 410 of file DataTransformer.cs.
| T[] MyCaffe.data.DataTransformer< T >.Transform | ( | SimpleDatum | d | ) |
Transform the data into an array of transformed values.
| d | Data to transform. |
Definition at line 873 of file DataTransformer.cs.
| AnnotationGroupCollection MyCaffe.data.DataTransformer< T >.Transform | ( | SimpleDatum | d, |
| Blob< T > | blob | ||
| ) |
Transforms a Datum and places the dat ainto a Blob.
| d | Specifies the Datum to transform. |
| blob | Specifies the Blob where the transformed data is placed. |
Definition at line 464 of file DataTransformer.cs.
| AnnotationGroupCollection MyCaffe.data.DataTransformer< T >.Transform | ( | SimpleDatum | d, |
| Blob< T > | blob, | ||
| out bool | bDoMirror | ||
| ) |
Transforms a Datum and places the dat ainto a Blob.
| d | Specifies the Datum to transform. |
| blob | Specifies the Blob where the transformed data is placed. |
| bDoMirror | Returns whether or not a mirror took place. |
Definition at line 477 of file DataTransformer.cs.
| T[] MyCaffe.data.DataTransformer< T >.Transform | ( | SimpleDatum | d, |
| out AnnotationGroupCollection | rgTransformedAnnoVec, | ||
| out bool | bMirror, | ||
| bool | bResize = true |
||
| ) |
Transform the data into an array of transformed values.
| d | Data to transform. |
| rgTransformedAnnoVec | Returns the list of transfomed annoations. |
| bMirror | Returns whether or not a mirror occurred. |
| bResize | Specifies to resize the data. |
Definition at line 887 of file DataTransformer.cs.
| T[] MyCaffe.data.DataTransformer< T >.Transform | ( | SimpleDatum | d, |
| out bool | bMirror, | ||
| NormalizedBBox | crop_bbox = null |
||
| ) |
Transform the data into an array of transformed values.
| d | Data to transform. |
| bMirror | Returns whether or not a mirror occurred. |
| crop_bbox | Optionally, specifies a crop bbox to fill out. |
Definition at line 518 of file DataTransformer.cs.
| void MyCaffe.data.DataTransformer< T >.Transform | ( | SimpleDatum[] | rgDatum, |
| Blob< T > | blobTransformed, | ||
| CudaDnn< T > | cuda, | ||
| Log | log, | ||
| bool | bJustFill = false |
||
| ) |
Transforms a list of Datum and places the transformed data into a Blob.
| rgDatum | Specifies a Array of SimpleDatum to be transformed. |
| blobTransformed | Specifies the Blob where all transformed data is placed. |
| cuda | Specifies the CudaDnn connection to Cuda. |
| log | Specifies a Log for all output. |
| bJustFill | Optionally, specifies to just fill the data blob with the data without actually transforming it. |
Definition at line 423 of file DataTransformer.cs.
| AnnotationGroupCollection MyCaffe.data.DataTransformer< T >.TransformAnnotation | ( | SimpleDatum | d, |
| NormalizedBBox | crop_bbox, | ||
| bool | bMirror, | ||
| bool | bResize | ||
| ) |
Transform the annotation data.
| d | Data to transform. |
| crop_bbox | Specifies the crop_bbox defined for the data. |
| bMirror | Specifies to mirror the data. |
| bResize | Specifies to resize the data. |
Definition at line 907 of file DataTransformer.cs.
| int MyCaffe.data.DataTransformer< T >.TransformLabel | ( | SimpleDatum | sd | ) |
When active (label_mapping.Active = true), transforms the label if mapped using the label and boost. Otherwise if not active or not mapped, no label changes are made.
| sd | Specifies the SimpleDatum whos label is to be transformed. |
Definition at line 355 of file DataTransformer.cs.
| Datum MyCaffe.data.DataTransformer< T >.UnTransform | ( | Blob< T > | blob, |
| bool | bIncludeMean = true |
||
| ) |
Reverse the transformation made when calling Transform.
| blob | Specifies the input blob. |
| bIncludeMean | Specifies whether or not to add the mean back. |
Definition at line 1379 of file DataTransformer.cs.
| void MyCaffe.data.DataTransformer< T >.Update | ( | int | nDataSize = 0, |
| SimpleDatum | imgMean = null |
||
| ) |
Resync the transformer with changes in its parameter.
Definition at line 93 of file DataTransformer.cs.
|
getset |
Get/set the image mean.
Definition at line 181 of file DataTransformer.cs.
|
get |
Returns the last min/max observed.
Definition at line 344 of file DataTransformer.cs.
|
get |
Returns the TransformationParameter used.
Definition at line 173 of file DataTransformer.cs.