forked from mindspore-Ecosystem/mindspore
support for windows msvc
This commit is contained in:
parent
5fedef5a83
commit
4cc3592b3e
|
@ -24,5 +24,14 @@
|
|||
#endif // _WIN32
|
||||
#endif
|
||||
|
||||
#endif // MINDSPORE_INCLUDE_API_VISIBLE_H
|
||||
#ifdef _MSC_VER
|
||||
#ifdef BUILDING_DATASET_DLL
|
||||
#define DATASET_API __declspec(dllexport)
|
||||
#else
|
||||
#define DATASET_API __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define DATASET_API __attribute__((visibility("default")))
|
||||
#endif // _MSC_VER
|
||||
|
||||
#endif // MINDSPORE_INCLUDE_API_VISIBLE_H
|
||||
|
|
|
@ -11,6 +11,11 @@ else()
|
|||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# define this for msvc:dllexport or dllimport
|
||||
add_compile_definitions(BUILDING_DATASET_DLL)
|
||||
endif()
|
||||
|
||||
# fix for GCC8.0
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-class-memaccess -Wno-stringop-truncation")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format")
|
||||
|
|
|
@ -37,7 +37,7 @@ class TensorOperation;
|
|||
// Transform operations for performing computer audio.
|
||||
namespace audio {
|
||||
/// \brief Compute the angle of complex tensor input.
|
||||
class MS_API Angle final : public TensorTransform {
|
||||
class DATASET_API Angle final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
Angle();
|
||||
|
@ -52,7 +52,7 @@ class MS_API Angle final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Design two-pole allpass filter. Similar to SoX implementation.
|
||||
class MS_API AllpassBiquad final : public TensorTransform {
|
||||
class DATASET_API AllpassBiquad final : public TensorTransform {
|
||||
public:
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz), the value can't be zero.
|
||||
/// \param[in] central_freq Central frequency (in Hz).
|
||||
|
@ -74,7 +74,7 @@ class MS_API AllpassBiquad final : public TensorTransform {
|
|||
|
||||
/// \brief AmplitudeToDB TensorTransform.
|
||||
/// \notes Turn a tensor from the power/amplitude scale to the decibel scale.
|
||||
class MS_API AmplitudeToDB final : public TensorTransform {
|
||||
class DATASET_API AmplitudeToDB final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] stype Scale of input tensor, must be one of [ScaleType::kPower, ScaleType::kMagnitude] (Default:
|
||||
|
@ -99,7 +99,7 @@ class MS_API AmplitudeToDB final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Design two-pole band filter.
|
||||
class MS_API BandBiquad final : public TensorTransform {
|
||||
class DATASET_API BandBiquad final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz), the value can't be zero.
|
||||
|
@ -122,7 +122,7 @@ class MS_API BandBiquad final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Design two-pole band-pass filter.
|
||||
class MS_API BandpassBiquad final : public TensorTransform {
|
||||
class DATASET_API BandpassBiquad final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz), the value can't be zero.
|
||||
|
@ -146,7 +146,7 @@ class MS_API BandpassBiquad final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Design two-pole band-reject filter. Similar to SoX implementation.
|
||||
class MS_API BandrejectBiquad final : public TensorTransform {
|
||||
class DATASET_API BandrejectBiquad final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz), the value can't be zero.
|
||||
|
@ -168,7 +168,7 @@ class MS_API BandrejectBiquad final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Design a bass tone-control effect.
|
||||
class MS_API BassBiquad final : public TensorTransform {
|
||||
class DATASET_API BassBiquad final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz), the value can't be zero.
|
||||
|
@ -191,7 +191,7 @@ class MS_API BassBiquad final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Perform a biquad filter of input tensor.
|
||||
class MS_API Biquad final : public TensorTransform {
|
||||
class DATASET_API Biquad final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] b0 Numerator coefficient of current input, x[n].
|
||||
|
@ -217,7 +217,7 @@ class MS_API Biquad final : public TensorTransform {
|
|||
|
||||
/// \brief ComplexNorm TensorTransform.
|
||||
/// \notes Compute the norm of complex tensor input.
|
||||
class MS_API ComplexNorm final : public TensorTransform {
|
||||
class DATASET_API ComplexNorm final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] power Power of the norm, which must be non-negative (Default: 1.0).
|
||||
|
@ -238,7 +238,7 @@ class MS_API ComplexNorm final : public TensorTransform {
|
|||
|
||||
/// \brief ComputeDeltas Transform.
|
||||
/// \note Compute delta coefficients of a spectrogram.
|
||||
class MS_API ComputeDeltas final : public TensorTransform {
|
||||
class DATASET_API ComputeDeltas final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Construct a new Compute Deltas object.
|
||||
/// \f[
|
||||
|
@ -263,7 +263,7 @@ class MS_API ComputeDeltas final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply contrast effect.
|
||||
class MS_API Contrast final : public TensorTransform {
|
||||
class DATASET_API Contrast final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] enhancement_amount Controls the amount of the enhancement (Default: 75.0).
|
||||
|
@ -283,7 +283,7 @@ class MS_API Contrast final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Turn a waveform from the decibel scale to the power/amplitude scale.
|
||||
class MS_API DBToAmplitude final : public TensorTransform {
|
||||
class DATASET_API DBToAmplitude final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor
|
||||
/// \param[in] ref Reference which the output will be scaled by.
|
||||
|
@ -304,7 +304,7 @@ class MS_API DBToAmplitude final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply a DC shift to the audio.
|
||||
class MS_API DCShift : public TensorTransform {
|
||||
class DATASET_API DCShift : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor
|
||||
/// \param[in] shift Indicates the amount to shift the audio, the value must be in the range [-2.0, 2.0].
|
||||
|
@ -336,7 +336,7 @@ class MS_API DCShift : public TensorTransform {
|
|||
Status CreateDct(mindspore::MSTensor *output, int32_t n_mfcc, int32_t n_mels, NormMode norm = NormMode::kNone);
|
||||
|
||||
/// \brief Design two-pole deemph filter. Similar to SoX implementation.
|
||||
class MS_API DeemphBiquad final : public TensorTransform {
|
||||
class DATASET_API DeemphBiquad final : public TensorTransform {
|
||||
public:
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, the value can only be 44100 (Hz) or 48000(hz).
|
||||
explicit DeemphBiquad(int32_t sample_rate);
|
||||
|
@ -355,7 +355,7 @@ class MS_API DeemphBiquad final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Detect pitch frequency.
|
||||
class MS_API DetectPitchFrequency final : public TensorTransform {
|
||||
class DATASET_API DetectPitchFrequency final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz), the value can't be zero.
|
||||
|
@ -383,7 +383,7 @@ class MS_API DetectPitchFrequency final : public TensorTransform {
|
|||
|
||||
/// \brief Dither increases the perceived dynamic range of audio stored at a
|
||||
/// particular bit-depth by eliminating nonlinear truncation distortion.
|
||||
class MS_API Dither final : public TensorTransform {
|
||||
class DATASET_API Dither final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] density_function The density function of a continuous random variable.
|
||||
|
@ -408,7 +408,7 @@ class MS_API Dither final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief EqualizerBiquad TensorTransform. Apply highpass biquad filter on audio.
|
||||
class MS_API EqualizerBiquad final : public TensorTransform {
|
||||
class DATASET_API EqualizerBiquad final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz), the value can't be zero.
|
||||
|
@ -431,7 +431,7 @@ class MS_API EqualizerBiquad final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Add fade in or/and fade out on the input audio.
|
||||
class MS_API Fade final : public TensorTransform {
|
||||
class DATASET_API Fade final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] fade_in_len Length of fade-in (time frames), which must be non-negative
|
||||
|
@ -455,7 +455,7 @@ class MS_API Fade final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Design IIR forward and backward filter.
|
||||
class MS_API Filtfilt final : public TensorTransform {
|
||||
class DATASET_API Filtfilt final : public TensorTransform {
|
||||
public:
|
||||
/// \param[in] a_coeffs Numerator coefficients of difference equation of dimension of (n_order + 1).
|
||||
/// Lower delays coefficients are first, e.g. [a0, a1, a2, ...].
|
||||
|
@ -480,7 +480,7 @@ class MS_API Filtfilt final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply a flanger effect to the audio.
|
||||
class MS_API Flanger final : public TensorTransform {
|
||||
class DATASET_API Flanger final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz).
|
||||
|
@ -513,7 +513,7 @@ class MS_API Flanger final : public TensorTransform {
|
|||
|
||||
/// \brief FrequencyMasking TensorTransform.
|
||||
/// \notes Apply masking to a spectrogram in the frequency domain.
|
||||
class MS_API FrequencyMasking final : public TensorTransform {
|
||||
class DATASET_API FrequencyMasking final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] iid_masks Whether to apply different masks to each example.
|
||||
|
@ -539,7 +539,7 @@ class MS_API FrequencyMasking final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply amplification or attenuation to the whole waveform.
|
||||
class MS_API Gain final : public TensorTransform {
|
||||
class DATASET_API Gain final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] gain_db Gain adjustment in decibels (dB) (Default: 1.0).
|
||||
|
@ -559,7 +559,7 @@ class MS_API Gain final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Waveform calculation from linear scalar amplitude spectrogram using GriffinLim transform.
|
||||
class MS_API GriffinLim final : public TensorTransform {
|
||||
class DATASET_API GriffinLim final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \notes Calculated by formula:
|
||||
|
@ -594,7 +594,7 @@ class MS_API GriffinLim final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief HighpassBiquad TensorTransform. Apply highpass biquad filter on audio.
|
||||
class MS_API HighpassBiquad final : public TensorTransform {
|
||||
class DATASET_API HighpassBiquad final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz), the value can't be zero.
|
||||
|
@ -617,7 +617,7 @@ class MS_API HighpassBiquad final : public TensorTransform {
|
|||
|
||||
/// \brief InverseMelScale TensorTransform
|
||||
/// \notes Solve for a normal STFT from a mel frequency STFT, using a conversion matrix.
|
||||
class MS_API InverseMelScale final : public TensorTransform {
|
||||
class DATASET_API InverseMelScale final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] n_stft Number of bins in STFT, must be positive.
|
||||
|
@ -653,7 +653,7 @@ class MS_API InverseMelScale final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Design filter. Similar to SoX implementation.
|
||||
class MS_API LFilter final : public TensorTransform {
|
||||
class DATASET_API LFilter final : public TensorTransform {
|
||||
public:
|
||||
/// \param[in] a_coeffs Numerator coefficients of difference equation of dimension of (n_order + 1).
|
||||
/// Lower delays coefficients are first, e.g. [a0, a1, a2, ...].
|
||||
|
@ -685,11 +685,11 @@ class MS_API LFilter final : public TensorTransform {
|
|||
/// \param n_filter: Number of (linear) triangular filter.
|
||||
/// \param sample_rate: Sample rate.
|
||||
/// \return Status code.
|
||||
Status MS_API LinearFbanks(MSTensor *output, int32_t n_freqs, float f_min, float f_max, int32_t n_filter,
|
||||
int32_t sample_rate);
|
||||
Status DATASET_API LinearFbanks(MSTensor *output, int32_t n_freqs, float f_min, float f_max, int32_t n_filter,
|
||||
int32_t sample_rate);
|
||||
|
||||
/// \brief Design biquad lowpass filter and perform filtering. Similar to SoX implementation.
|
||||
class MS_API LowpassBiquad final : public TensorTransform {
|
||||
class DATASET_API LowpassBiquad final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz), the value can't be zero.
|
||||
|
@ -711,7 +711,7 @@ class MS_API LowpassBiquad final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Separate a complex-valued spectrogram with shape (..., 2) into its magnitude and phase.
|
||||
class MS_API Magphase final : public TensorTransform {
|
||||
class DATASET_API Magphase final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] power Power of the norm, which must be non-negative (Default: 1.0).
|
||||
|
@ -780,7 +780,7 @@ class MaskAlongAxisIID final : public TensorTransform {
|
|||
|
||||
/// \brief MelScale TensorTransform.
|
||||
/// \notes Convert normal STFT to STFT at the Mel scale.
|
||||
class MS_API MelScale final : public TensorTransform {
|
||||
class DATASET_API MelScale final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] n_mels Number of mel filter, which must be positive (Default: 128).
|
||||
|
@ -817,12 +817,13 @@ class MS_API MelScale final : public TensorTransform {
|
|||
/// \param[in] norm Norm to use, can be NormType::kNone or NormType::kSlaney (Default: NormType::kNone).
|
||||
/// \param[in] mel_type Scale to use, can be MelType::kHtk or MelType::kSlaney (Default: MelType::kHtz).
|
||||
/// \return Status code.
|
||||
Status MS_API MelscaleFbanks(MSTensor *output, int32_t n_freqs, float f_min, float f_max, int32_t n_mels,
|
||||
int32_t sample_rate, NormType norm = NormType::kNone, MelType mel_type = MelType::kHtk);
|
||||
Status DATASET_API MelscaleFbanks(MSTensor *output, int32_t n_freqs, float f_min, float f_max, int32_t n_mels,
|
||||
int32_t sample_rate, NormType norm = NormType::kNone,
|
||||
MelType mel_type = MelType::kHtk);
|
||||
|
||||
/// \brief MuLawDecoding TensorTransform.
|
||||
/// \note Decode mu-law encoded signal.
|
||||
class MS_API MuLawDecoding final : public TensorTransform {
|
||||
class DATASET_API MuLawDecoding final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] quantization_channels Number of channels, which must be positive (Default: 256).
|
||||
|
@ -843,7 +844,7 @@ class MS_API MuLawDecoding final : public TensorTransform {
|
|||
|
||||
/// \brief MuLawEncoding TensorTransform.
|
||||
/// \note Encode signal based on mu-law companding.
|
||||
class MS_API MuLawEncoding final : public TensorTransform {
|
||||
class DATASET_API MuLawEncoding final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] quantization_channels Number of channels, which must be positive (Default: 256).
|
||||
|
@ -863,7 +864,7 @@ class MS_API MuLawEncoding final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Overdrive TensorTransform.
|
||||
class MS_API Overdrive final : public TensorTransform {
|
||||
class DATASET_API Overdrive final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] gain Coefficient of overload in dB, in range of [0, 100] (Default: 20.0).
|
||||
|
@ -884,7 +885,7 @@ class MS_API Overdrive final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Phaser TensorTransform.
|
||||
class MS_API Phaser final : public TensorTransform {
|
||||
class DATASET_API Phaser final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz).
|
||||
|
@ -915,7 +916,7 @@ class MS_API Phaser final : public TensorTransform {
|
|||
|
||||
/// \brief PhaseVocoder TensorTransform
|
||||
/// \notes Given a STFT tensor, speed up in time without modifying pitch by factor of rate.
|
||||
class MS_API PhaseVocoder final : public TensorTransform {
|
||||
class DATASET_API PhaseVocoder final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] rate Speed-up factor.
|
||||
|
@ -937,7 +938,7 @@ class MS_API PhaseVocoder final : public TensorTransform {
|
|||
|
||||
/// \brief Resample TensorTransform.
|
||||
/// \notes Resample a signal from one frequency to another. A sampling method can be given.
|
||||
class MS_API Resample : public TensorTransform {
|
||||
class DATASET_API Resample : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] orig_freq The original frequency of the signal, which must be positive (default=16000).
|
||||
|
@ -966,7 +967,7 @@ class MS_API Resample : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply RIAA vinyl playback equalization.
|
||||
class MS_API RiaaBiquad final : public TensorTransform {
|
||||
class DATASET_API RiaaBiquad final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz),
|
||||
|
@ -987,7 +988,7 @@ class MS_API RiaaBiquad final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply sliding-window cepstral mean (and optionally variance) normalization per utterance.
|
||||
class MS_API SlidingWindowCmn final : public TensorTransform {
|
||||
class DATASET_API SlidingWindowCmn final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor of SlidingWindowCmnOp.
|
||||
/// \param[in] cmn_window The window in frames for running average CMN computation (Default: 600).
|
||||
|
@ -1013,7 +1014,7 @@ class MS_API SlidingWindowCmn final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Create a spectral centroid from an audio signal.
|
||||
class MS_API SpectralCentroid : public TensorTransform {
|
||||
class DATASET_API SpectralCentroid : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz).
|
||||
|
@ -1046,7 +1047,7 @@ class MS_API SpectralCentroid : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Create a spectrogram from an audio signal.
|
||||
class MS_API Spectrogram : public TensorTransform {
|
||||
class DATASET_API Spectrogram : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] n_fft Size of FFT, creates n_fft / 2 + 1 bins (Default: 400).
|
||||
|
@ -1092,7 +1093,7 @@ class MS_API Spectrogram : public TensorTransform {
|
|||
|
||||
/// \brief TimeMasking TensorTransform.
|
||||
/// \notes Apply masking to a spectrogram in the time domain.
|
||||
class MS_API TimeMasking final : public TensorTransform {
|
||||
class DATASET_API TimeMasking final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] iid_masks Whether to apply different masks to each example.
|
||||
|
@ -1119,7 +1120,7 @@ class MS_API TimeMasking final : public TensorTransform {
|
|||
|
||||
/// \brief TimeStretch TensorTransform
|
||||
/// \notes Stretch STFT in time at a given rate, without changing the pitch.
|
||||
class MS_API TimeStretch final : public TensorTransform {
|
||||
class DATASET_API TimeStretch final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] hop_length Length of hop between STFT windows (Default: None, will use ((n_freq - 1) * 2) // 2).
|
||||
|
@ -1143,7 +1144,7 @@ class MS_API TimeStretch final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Design a treble tone-control effect.
|
||||
class MS_API TrebleBiquad final : public TensorTransform {
|
||||
class DATASET_API TrebleBiquad final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sampling rate of the waveform, e.g. 44100 (Hz), the value can't be zero.
|
||||
|
@ -1167,7 +1168,7 @@ class MS_API TrebleBiquad final : public TensorTransform {
|
|||
|
||||
/// \brief Vad TensorTransform.
|
||||
/// \notes Attempt to trim silent background sounds from the end of the voice recording.
|
||||
class MS_API Vad final : public TensorTransform {
|
||||
class DATASET_API Vad final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sample_rate Sample rate of audio signal.
|
||||
|
@ -1218,7 +1219,7 @@ class MS_API Vad final : public TensorTransform {
|
|||
|
||||
/// \brief Vol TensorTransform.
|
||||
/// \notes Add a volume to an waveform.
|
||||
class MS_API Vol final : public TensorTransform {
|
||||
class DATASET_API Vol final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] gain Gain value, varies according to the value of gain_type. If gain_type is GainType::kAmplitude,
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace config {
|
|||
/// // Operations with randomness will use the seed value to generate random values.
|
||||
/// bool rc = config::set_seed(5);
|
||||
/// \endcode
|
||||
bool MS_API set_seed(int32_t seed);
|
||||
bool DATASET_API set_seed(int32_t seed);
|
||||
|
||||
/// \brief A function to get the seed.
|
||||
/// \return The seed set in the configuration.
|
||||
|
@ -47,7 +47,7 @@ bool MS_API set_seed(int32_t seed);
|
|||
/// // If set_seed() is never called before, the default value(std::mt19937::default_seed) will be returned.
|
||||
/// uint32_t seed = config::get_seed();
|
||||
/// \endcode
|
||||
uint32_t MS_API get_seed();
|
||||
uint32_t DATASET_API get_seed();
|
||||
|
||||
/// \brief A function to set the number of rows to be prefetched.
|
||||
/// \param[in] prefetch_size Total number of rows to be prefetched.
|
||||
|
@ -57,7 +57,7 @@ uint32_t MS_API get_seed();
|
|||
/// // Set a new global configuration value for the prefetch size.
|
||||
/// bool rc = config::set_prefetch_size(1000);
|
||||
/// \endcode
|
||||
bool MS_API set_prefetch_size(int32_t prefetch_size);
|
||||
bool DATASET_API set_prefetch_size(int32_t prefetch_size);
|
||||
|
||||
/// \brief A function to get the prefetch size in number of rows.
|
||||
/// \return Total number of rows to be prefetched.
|
||||
|
@ -67,7 +67,7 @@ bool MS_API set_prefetch_size(int32_t prefetch_size);
|
|||
/// // If set_prefetch_size() is never called before, the default value(16) will be returned.
|
||||
/// int32_t prefetch_size = config::get_prefetch_size();
|
||||
/// \endcode
|
||||
int32_t MS_API get_prefetch_size();
|
||||
int32_t DATASET_API get_prefetch_size();
|
||||
|
||||
/// \brief A function to set the default number of parallel workers.
|
||||
/// \param[in] num_parallel_workers Number of parallel workers to be used as the default for each operation.
|
||||
|
@ -78,7 +78,7 @@ int32_t MS_API get_prefetch_size();
|
|||
/// // Now parallel dataset operators will run with 16 workers.
|
||||
/// bool rc = config::set_num_parallel_workers(16);
|
||||
/// \endcode
|
||||
bool MS_API set_num_parallel_workers(int32_t num_parallel_workers);
|
||||
bool DATASET_API set_num_parallel_workers(int32_t num_parallel_workers);
|
||||
|
||||
/// \brief A function to get the default number of parallel workers.
|
||||
/// \return Number of parallel workers to be used as the default for each operation.
|
||||
|
@ -88,7 +88,7 @@ bool MS_API set_num_parallel_workers(int32_t num_parallel_workers);
|
|||
/// // If set_num_parallel_workers() is never called before, the default value(8) will be returned.
|
||||
/// int32_t parallel_workers = config::get_num_parallel_workers();
|
||||
/// \endcode
|
||||
int32_t MS_API get_num_parallel_workers();
|
||||
int32_t DATASET_API get_num_parallel_workers();
|
||||
|
||||
/// \brief A function to set the default interval (in milliseconds) for monitor sampling.
|
||||
/// \param[in] interval Interval (in milliseconds) to be used for performance monitor sampling.
|
||||
|
@ -98,7 +98,7 @@ int32_t MS_API get_num_parallel_workers();
|
|||
/// // Set a new global configuration value for the monitor sampling interval.
|
||||
/// bool rc = config::set_monitor_sampling_interval(100);
|
||||
/// \endcode
|
||||
bool MS_API set_monitor_sampling_interval(int32_t interval);
|
||||
bool DATASET_API set_monitor_sampling_interval(int32_t interval);
|
||||
|
||||
/// \brief A function to get the default interval of performance monitor sampling.
|
||||
/// \return Interval (in milliseconds) for performance monitor sampling.
|
||||
|
@ -108,7 +108,7 @@ bool MS_API set_monitor_sampling_interval(int32_t interval);
|
|||
/// // If set_monitor_sampling_interval() is never called before, the default value(1000) will be returned.
|
||||
/// int32_t sampling_interval = config::get_monitor_sampling_interval();
|
||||
/// \endcode
|
||||
int32_t MS_API get_monitor_sampling_interval();
|
||||
int32_t DATASET_API get_monitor_sampling_interval();
|
||||
|
||||
/// \brief A function to set the default timeout (in seconds) for DSWaitedCallback. In case of a deadlock, the wait
|
||||
/// function will exit after the timeout period.
|
||||
|
@ -119,7 +119,7 @@ int32_t MS_API get_monitor_sampling_interval();
|
|||
/// // Set a new global configuration value for the timeout value.
|
||||
/// bool rc = config::set_callback_timeout(100);
|
||||
/// \endcode
|
||||
bool MS_API set_callback_timeout(int32_t timeout);
|
||||
bool DATASET_API set_callback_timeout(int32_t timeout);
|
||||
|
||||
/// \brief A function to get the default timeout for DSWaitedCallback. In case of a deadback, the wait function
|
||||
/// will exit after the timeout period.
|
||||
|
@ -130,7 +130,7 @@ bool MS_API set_callback_timeout(int32_t timeout);
|
|||
/// // If set_callback_timeout() is never called before, the default value(60) will be returned.
|
||||
/// int32_t callback_timeout = config::get_callback_timeout();
|
||||
/// \endcode
|
||||
int32_t MS_API get_callback_timeout();
|
||||
int32_t DATASET_API get_callback_timeout();
|
||||
|
||||
/// \brief A function to load the configuration from a file.
|
||||
/// \param[in] file Path of the configuration file to be loaded.
|
||||
|
@ -138,7 +138,7 @@ int32_t MS_API get_callback_timeout();
|
|||
/// \note The reason for using this API is that std::string will be constrained by the
|
||||
/// compiler option '_GLIBCXX_USE_CXX11_ABI' while char is free of this restriction.
|
||||
/// Check API `mindspore::dataset::config::load(const std::string &file)` and find more usage.
|
||||
bool MS_API load(const std::vector<char> &file);
|
||||
bool DATASET_API load(const std::vector<char> &file);
|
||||
|
||||
/// \brief A function to load the configuration from a file.
|
||||
/// \param[in] file Path of the configuration file to be loaded.
|
||||
|
@ -156,7 +156,7 @@ bool MS_API load(const std::vector<char> &file);
|
|||
/// std::string config_file = "/path/to/config/file";
|
||||
/// bool rc = config::load(config_file);
|
||||
/// \endcode
|
||||
inline bool MS_API load(const std::string &file) { return load(StringToChar(file)); }
|
||||
inline bool DATASET_API load(const std::string &file) { return load(StringToChar(file)); }
|
||||
} // namespace config
|
||||
} // namespace dataset
|
||||
} // namespace mindspore
|
||||
|
|
|
@ -29,26 +29,26 @@ using uchar = unsigned char;
|
|||
using dsize_t = int64_t;
|
||||
|
||||
/// \brief The modulation in Flanger
|
||||
enum class MS_API Modulation {
|
||||
enum class DATASET_API Modulation {
|
||||
kSinusoidal = 0, ///< Use sinusoidal modulation.
|
||||
kTriangular = 1 ///< Use triangular modulation.
|
||||
};
|
||||
|
||||
/// \brief The interpolation in Flanger
|
||||
enum class MS_API Interpolation {
|
||||
enum class DATASET_API Interpolation {
|
||||
kLinear = 0, ///< Use linear for delay-line interpolation.
|
||||
kQuadratic = 1 ///< Use quadratic for delay-line interpolation.
|
||||
};
|
||||
|
||||
/// \brief The dataset auto augment policy in AutoAugment
|
||||
enum class MS_API AutoAugmentPolicy {
|
||||
enum class DATASET_API AutoAugmentPolicy {
|
||||
kImageNet = 0, ///< AutoAugment policy learned on the ImageNet dataset.
|
||||
kCifar10 = 1, ///< AutoAugment policy learned on the Cifar10 dataset.
|
||||
kSVHN = 2 ///< AutoAugment policy learned on the SVHN dataset.
|
||||
};
|
||||
|
||||
/// \brief The color conversion code
|
||||
enum class MS_API ConvertMode {
|
||||
enum class DATASET_API ConvertMode {
|
||||
COLOR_BGR2BGRA = 0, ///< Add alpha channel to BGR image.
|
||||
COLOR_RGB2RGBA = COLOR_BGR2BGRA, ///< Add alpha channel to RGB image.
|
||||
COLOR_BGRA2BGR = 1, ///< Remove alpha channel to BGR image.
|
||||
|
@ -72,46 +72,46 @@ enum class MS_API ConvertMode {
|
|||
};
|
||||
|
||||
// \brief Possible density function in Dither.
|
||||
enum MS_API DensityFunction {
|
||||
enum DATASET_API DensityFunction {
|
||||
kTPDF = 0, ///< Use triangular probability density function.
|
||||
kRPDF = 1, ///< Use rectangular probability density function.
|
||||
kGPDF = 2 ///< Use gaussian probability density function.
|
||||
};
|
||||
|
||||
/// \brief Values of norm in CreateDct.
|
||||
enum class MS_API NormMode {
|
||||
enum class DATASET_API NormMode {
|
||||
kNone = 0, ///< None type norm.
|
||||
kOrtho = 1 ///< Ortho type norm.
|
||||
};
|
||||
|
||||
/// \brief Possible options for norm in MelscaleFbanks.
|
||||
enum class MS_API NormType {
|
||||
enum class DATASET_API NormType {
|
||||
kNone = 0, ///< None type norm.
|
||||
kSlaney = 1, ///< Slaney type norm.
|
||||
};
|
||||
|
||||
/// \brief The mode for manual offload.
|
||||
enum class MS_API ManualOffloadMode {
|
||||
enum class DATASET_API ManualOffloadMode {
|
||||
kUnspecified, ///< Not set, will use auto_offload setting instead.
|
||||
kDisabled, ///< Do not perform offload.
|
||||
kEnabled ///< Attempt to offload.
|
||||
};
|
||||
|
||||
/// \brief Target devices to perform map operation.
|
||||
enum class MS_API MapTargetDevice {
|
||||
enum class DATASET_API MapTargetDevice {
|
||||
kCpu, ///< CPU Device.
|
||||
kGpu, ///< Gpu Device.
|
||||
kAscend310 ///< Ascend310 Device.
|
||||
};
|
||||
|
||||
/// \brief Possible options for mel_type in MelscaleFbanks.
|
||||
enum class MS_API MelType {
|
||||
enum class DATASET_API MelType {
|
||||
kHtk = 0, ///< Htk scale type.
|
||||
kSlaney = 1, ///< Slaney scale type.
|
||||
};
|
||||
|
||||
/// \brief The initial type of tensor implementation.
|
||||
enum class MS_API TensorImpl {
|
||||
enum class DATASET_API TensorImpl {
|
||||
kNone, ///< None type tensor.
|
||||
kFlexible, ///< Flexible type tensor, can be converted to any type.
|
||||
kCv, ///< CV type tensor.
|
||||
|
@ -119,7 +119,7 @@ enum class MS_API TensorImpl {
|
|||
};
|
||||
|
||||
/// \brief The mode for shuffling data.
|
||||
enum class MS_API ShuffleMode {
|
||||
enum class DATASET_API ShuffleMode {
|
||||
kFalse = 0, ///< No shuffling is performed.
|
||||
kFiles = 1, ///< Shuffle files only.
|
||||
kGlobal = 2, ///< Shuffle both the files and samples.
|
||||
|
@ -127,20 +127,20 @@ enum class MS_API ShuffleMode {
|
|||
};
|
||||
|
||||
/// \brief Possible scale for input audio.
|
||||
enum class MS_API ScaleType {
|
||||
enum class DATASET_API ScaleType {
|
||||
kMagnitude = 0, ///< Audio scale is magnitude.
|
||||
kPower = 1, ///< Audio scale is power.
|
||||
};
|
||||
|
||||
/// \brief The scale for gain type.
|
||||
enum class MS_API GainType {
|
||||
enum class DATASET_API GainType {
|
||||
kAmplitude = 0, ///< Audio gain type is amplitude.
|
||||
kPower = 1, ///< Audio gain type is power.
|
||||
kDb = 2, ///< Audio gain type is db.
|
||||
};
|
||||
|
||||
/// \brief The method of padding.
|
||||
enum class MS_API BorderType {
|
||||
enum class DATASET_API BorderType {
|
||||
kConstant = 0, ///< Fill the border with constant values.
|
||||
kEdge = 1, ///< Fill the border with the last value on the edge.
|
||||
kReflect = 2, ///< Reflect the values on the edge omitting the last value of edge.
|
||||
|
@ -148,7 +148,7 @@ enum class MS_API BorderType {
|
|||
};
|
||||
|
||||
/// \brief Possible fix rotation angle for Rotate Op.
|
||||
enum class MS_API FixRotationAngle {
|
||||
enum class DATASET_API FixRotationAngle {
|
||||
k0Degree = 1, ///< Rotate 0 degree.
|
||||
k0DegreeAndMirror = 2, ///< Rotate 0 degree and apply horizontal flip.
|
||||
k180Degree = 3, ///< Rotate 180 degree.
|
||||
|
@ -160,7 +160,7 @@ enum class MS_API FixRotationAngle {
|
|||
};
|
||||
|
||||
/// \brief Possible types for windows function.
|
||||
enum class MS_API WindowType {
|
||||
enum class DATASET_API WindowType {
|
||||
kBartlett = 0, ///< Bartlett window function.
|
||||
kBlackman = 1, ///< Blackman window function.
|
||||
kHamming = 2, ///< Hamming window function.
|
||||
|
@ -169,20 +169,20 @@ enum class MS_API WindowType {
|
|||
};
|
||||
|
||||
/// \brief Possible options for Image format types in a batch.
|
||||
enum class MS_API ImageBatchFormat {
|
||||
enum class DATASET_API ImageBatchFormat {
|
||||
kNHWC = 0, ///< Indicate the input batch is of NHWC format.
|
||||
kNCHW = 1 ///< Indicate the input batch is of NCHW format.
|
||||
};
|
||||
|
||||
/// \brief Possible options for Image format types.
|
||||
enum class MS_API ImageFormat {
|
||||
enum class DATASET_API ImageFormat {
|
||||
HWC = 0, ///< Indicate the input batch is of NHWC format
|
||||
CHW = 1, ///< Indicate the input batch is of NHWC format
|
||||
HW = 2 ///< Indicate the input batch is of NHWC format
|
||||
};
|
||||
|
||||
/// \brief Possible options for interpolation method.
|
||||
enum class MS_API InterpolationMode {
|
||||
enum class DATASET_API InterpolationMode {
|
||||
kLinear = 0, ///< Interpolation method is linear interpolation.
|
||||
kNearestNeighbour = 1, ///< Interpolation method is nearest-neighbor interpolation.
|
||||
kCubic = 2, ///< Interpolation method is bicubic interpolation.
|
||||
|
@ -191,13 +191,13 @@ enum class MS_API InterpolationMode {
|
|||
};
|
||||
|
||||
/// \brief Possible formats for Vdec output image.
|
||||
enum class MS_API VdecOutputFormat {
|
||||
enum class DATASET_API VdecOutputFormat {
|
||||
kYuvSemiplanar420 = 1, ///< Output image with PIXEL_FORMAT_YUV_SEMIPLANAR_420.
|
||||
kYvuSemiplanar420 = 2, ///< Output image with PIXEL_FORMAT_YVU_SEMIPLANAR_420.
|
||||
};
|
||||
|
||||
/// \brief Possible formats for Vdec input video.
|
||||
enum class MS_API VdecStreamFormat {
|
||||
enum class DATASET_API VdecStreamFormat {
|
||||
kH265MainLevel = 0, ///< Input video with H265_MAIN_LEVEL
|
||||
kH264BaselineLevel, ///< Input video with H264_BASELINE_LEVEL
|
||||
kH264MainLevel, ///< Input video with H264_MAIN_LEVEL
|
||||
|
@ -205,26 +205,26 @@ enum class MS_API VdecStreamFormat {
|
|||
};
|
||||
|
||||
/// \brief Possible tokenize modes for JiebaTokenizer.
|
||||
enum class MS_API JiebaMode {
|
||||
enum class DATASET_API JiebaMode {
|
||||
kMix = 0, ///< Tokenize with MPSegment algorithm.
|
||||
kMp = 1, ///< Tokenize with Hiddel Markov Model Segment algorithm.
|
||||
kHmm = 2 ///< Tokenize with a mix of MPSegment and HMMSegment algorithm.
|
||||
};
|
||||
|
||||
/// \brief Possible options for SPieceTokenizerOutType.
|
||||
enum class MS_API SPieceTokenizerOutType {
|
||||
enum class DATASET_API SPieceTokenizerOutType {
|
||||
kString = 0, ///< Output of sentencepiece tokenizer is string type.
|
||||
kInt = 1 ///< Output of sentencepiece tokenizer is int type.
|
||||
};
|
||||
|
||||
/// \brief Possible options for SPieceTokenizerLoadType.
|
||||
enum class MS_API SPieceTokenizerLoadType {
|
||||
enum class DATASET_API SPieceTokenizerLoadType {
|
||||
kFile = 0, ///< Load sentencepiece tokenizer from local sentencepiece vocab file.
|
||||
kModel = 1 ///< Load sentencepiece tokenizer from sentencepiece vocab instance.
|
||||
};
|
||||
|
||||
/// \brief Type options for SentencePiece Model.
|
||||
enum class MS_API SentencePieceModel {
|
||||
enum class DATASET_API SentencePieceModel {
|
||||
kUnigram = 0, ///< Based on Unigram model.
|
||||
kBpe = 1, ///< Based on Byte Pair Encoding (BPE) model.
|
||||
kChar = 2, ///< Based on Char model.
|
||||
|
@ -232,7 +232,7 @@ enum class MS_API SentencePieceModel {
|
|||
};
|
||||
|
||||
/// \brief Possible options to specify a specific normalize mode.
|
||||
enum class MS_API NormalizeForm {
|
||||
enum class DATASET_API NormalizeForm {
|
||||
kNone = 0, ///< Keep the input string tensor unchanged.
|
||||
kNfc, ///< Normalize with Normalization Form C.
|
||||
kNfkc, ///< Normalize with Normalization Form KC.
|
||||
|
@ -241,7 +241,7 @@ enum class MS_API NormalizeForm {
|
|||
};
|
||||
|
||||
/// \brief Possible options for Mask.
|
||||
enum class MS_API RelationalOp {
|
||||
enum class DATASET_API RelationalOp {
|
||||
kEqual = 0, ///< equal to `==`
|
||||
kNotEqual, ///< equal to `!=`
|
||||
kLess, ///< equal to `<`
|
||||
|
@ -251,26 +251,26 @@ enum class MS_API RelationalOp {
|
|||
};
|
||||
|
||||
/// \brief Possible modes for slice patches.
|
||||
enum class MS_API SliceMode {
|
||||
enum class DATASET_API SliceMode {
|
||||
kPad = 0, ///< Pad some pixels before slice to patches.
|
||||
kDrop = 1, ///< Drop remainder pixels before slice to patches.
|
||||
};
|
||||
|
||||
/// \brief Possible options for SamplingStrategy.
|
||||
enum class MS_API SamplingStrategy {
|
||||
enum class DATASET_API SamplingStrategy {
|
||||
kRandom = 0, ///< Random sampling with replacement.
|
||||
kEdgeWeight = 1 ///< Sampling with edge weight as probability.
|
||||
};
|
||||
|
||||
/// \brief Possible values for output format in get all neighbors function of gnn dataset
|
||||
enum class MS_API OutputFormat {
|
||||
enum class DATASET_API OutputFormat {
|
||||
kNormal = 0, ///< Normal format.
|
||||
kCoo = 1, ///< COO format.
|
||||
kCsr = 2 ///< CSR format.
|
||||
};
|
||||
|
||||
/// \brief Possible options for fade shape.
|
||||
enum class MS_API FadeShape {
|
||||
enum class DATASET_API FadeShape {
|
||||
kLinear = 0, ///< Fade shape is linear mode.
|
||||
kExponential = 1, ///< Fade shape is exponential mode.
|
||||
kLogarithmic = 2, ///< Fade shape is logarithmic mode.
|
||||
|
@ -279,7 +279,7 @@ enum class MS_API FadeShape {
|
|||
};
|
||||
|
||||
/// \brief Sample method for audio resample.
|
||||
enum class MS_API ResampleMethod {
|
||||
enum class DATASET_API ResampleMethod {
|
||||
kSincInterpolation = 0, ///< Resample audio by sinc interpolation method
|
||||
kKaiserWindow = 1, ///< Resample audio by Kaiser window
|
||||
};
|
||||
|
@ -288,12 +288,12 @@ enum class MS_API ResampleMethod {
|
|||
/// \param[in] bits a 32bit int to be tested
|
||||
/// \param[in] bitMask a 32bit int representing bit mask
|
||||
/// \return bool Result for the check
|
||||
inline bool MS_API BitTest(uint32_t bits, uint32_t bitMask) { return (bits & bitMask) == bitMask; }
|
||||
inline bool DATASET_API BitTest(uint32_t bits, uint32_t bitMask) { return (bits & bitMask) == bitMask; }
|
||||
|
||||
/// \brief Convenience function to set bitmask for a 32bit int
|
||||
/// \param[in] bits a 32bit int to deal with
|
||||
/// \param[in] bitMask a 32bit int representing bit mask
|
||||
inline void MS_API BitSet(uint32_t *bits, uint32_t bitMask) {
|
||||
inline void DATASET_API BitSet(uint32_t *bits, uint32_t bitMask) {
|
||||
if (bits == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ inline void MS_API BitSet(uint32_t *bits, uint32_t bitMask) {
|
|||
/// \brief Convenience function to clear bitmask from a 32bit int
|
||||
/// \param[in] bits a 32bit int to deal with
|
||||
/// \param[in] bitMask a 32bit int representing bit mask
|
||||
inline void MS_API BitClear(uint32_t *bits, uint32_t bitMask) {
|
||||
inline void DATASET_API BitClear(uint32_t *bits, uint32_t bitMask) {
|
||||
if (bits == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace mindspore {
|
|||
namespace dataset {
|
||||
|
||||
/// \brief Simple class to do data manipulation, contains helper function to update json files in dataset
|
||||
class MS_API DataHelper {
|
||||
class DATASET_API DataHelper {
|
||||
public:
|
||||
/// \brief constructor
|
||||
DataHelper() = default;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -33,7 +33,7 @@ class TensorOp;
|
|||
class Tensor;
|
||||
|
||||
// class to run tensor operations in eager mode
|
||||
class MS_API Execute {
|
||||
class DATASET_API Execute {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] op TensorOperation to be applied in Eager mode, it accepts operation in type of shared pointer.
|
||||
|
|
|
@ -45,7 +45,7 @@ using MSTensorMapChar = std::map<std::vector<char>, mindspore::MSTensor>;
|
|||
using MSTensorVec = std::vector<mindspore::MSTensor>;
|
||||
|
||||
// Abstract class for iterating over the dataset.
|
||||
class MS_API Iterator {
|
||||
class DATASET_API Iterator {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
Iterator();
|
||||
|
@ -146,7 +146,7 @@ class MS_API Iterator {
|
|||
IteratorConsumer *consumer_;
|
||||
};
|
||||
|
||||
class MS_API PullIterator : public Iterator {
|
||||
class DATASET_API PullIterator : public Iterator {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
PullIterator();
|
||||
|
|
|
@ -31,7 +31,7 @@ class SamplerObj;
|
|||
// Abstract class to represent a sampler in the data pipeline.
|
||||
/// \class Sampler samplers.h
|
||||
/// \brief An abstract base class to represent a sampler in the data pipeline.
|
||||
class MS_API Sampler : std::enable_shared_from_this<Sampler> {
|
||||
class DATASET_API Sampler : std::enable_shared_from_this<Sampler> {
|
||||
friend class AlbumDataset;
|
||||
friend class Caltech256Dataset;
|
||||
friend class CelebADataset;
|
||||
|
@ -104,7 +104,7 @@ class MS_API Sampler : std::enable_shared_from_this<Sampler> {
|
|||
|
||||
/// \brief A class to represent a Distributed Sampler in the data pipeline.
|
||||
/// \note A Sampler that accesses a shard of the dataset.
|
||||
class MS_API DistributedSampler final : public Sampler {
|
||||
class DATASET_API DistributedSampler final : public Sampler {
|
||||
friend std::shared_ptr<SamplerObj> SelectSampler(int64_t num_samples, bool shuffle, int32_t num_shards,
|
||||
int32_t shard_id);
|
||||
|
||||
|
@ -147,7 +147,7 @@ class MS_API DistributedSampler final : public Sampler {
|
|||
/// \brief A class to represent a PK Sampler in the data pipeline.
|
||||
/// \note Samples K elements for each P class in the dataset.
|
||||
/// This will sample all classes.
|
||||
class MS_API PKSampler final : public Sampler {
|
||||
class DATASET_API PKSampler final : public Sampler {
|
||||
friend std::shared_ptr<SamplerObj> SelectSampler(int64_t num_samples, bool shuffle, int32_t num_shards,
|
||||
int32_t shard_id);
|
||||
|
||||
|
@ -180,7 +180,7 @@ class MS_API PKSampler final : public Sampler {
|
|||
|
||||
/// \brief A class to represent a Random Sampler in the data pipeline.
|
||||
/// \note Samples the elements randomly.
|
||||
class MS_API RandomSampler final : public Sampler {
|
||||
class DATASET_API RandomSampler final : public Sampler {
|
||||
friend std::shared_ptr<SamplerObj> SelectSampler(int64_t num_samples, bool shuffle, int32_t num_shards,
|
||||
int32_t shard_id);
|
||||
|
||||
|
@ -211,7 +211,7 @@ class MS_API RandomSampler final : public Sampler {
|
|||
|
||||
/// \brief A class to represent a Sequential Sampler in the data pipeline.
|
||||
/// \note Samples the dataset elements sequentially, same as not having a sampler.
|
||||
class MS_API SequentialSampler final : public Sampler {
|
||||
class DATASET_API SequentialSampler final : public Sampler {
|
||||
friend std::shared_ptr<SamplerObj> SelectSampler(int64_t num_samples, bool shuffle, int32_t num_shards,
|
||||
int32_t shard_id);
|
||||
|
||||
|
@ -242,7 +242,7 @@ class MS_API SequentialSampler final : public Sampler {
|
|||
|
||||
/// \brief A class to represent a Subset Sampler in the data pipeline.
|
||||
/// \note Samples the elements from a sequence of indices.
|
||||
class MS_API SubsetSampler : public Sampler {
|
||||
class DATASET_API SubsetSampler : public Sampler {
|
||||
friend std::shared_ptr<SamplerObj> SelectSampler(int64_t num_samples, bool shuffle, int32_t num_shards,
|
||||
int32_t shard_id);
|
||||
|
||||
|
@ -272,7 +272,7 @@ class MS_API SubsetSampler : public Sampler {
|
|||
|
||||
/// \brief A class to represent a Subset Random Sampler in the data pipeline.
|
||||
/// \note Samples the elements randomly from a sequence of indices.
|
||||
class MS_API SubsetRandomSampler final : public SubsetSampler {
|
||||
class DATASET_API SubsetRandomSampler final : public SubsetSampler {
|
||||
friend std::shared_ptr<SamplerObj> SelectSampler(int64_t num_samples, bool shuffle, int32_t num_shards,
|
||||
int32_t shard_id);
|
||||
|
||||
|
@ -300,7 +300,7 @@ class MS_API SubsetRandomSampler final : public SubsetSampler {
|
|||
/// \brief A class to represent a Weighted Random Sampler in the data pipeline.
|
||||
/// \note Samples the elements from [0, len(weights) - 1] randomly with the given
|
||||
/// weights (probabilities).
|
||||
class MS_API WeightedRandomSampler final : public Sampler {
|
||||
class DATASET_API WeightedRandomSampler final : public Sampler {
|
||||
friend std::shared_ptr<SamplerObj> SelectSampler(int64_t num_samples, bool shuffle, int32_t num_shards,
|
||||
int32_t shard_id);
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ namespace text {
|
|||
#ifndef _WIN32
|
||||
/// \brief Tokenize a scalar tensor of UTF-8 string by specific rules.
|
||||
/// \note BasicTokenizer is not supported on the Windows platform yet.
|
||||
class MS_API BasicTokenizer final : public TensorTransform {
|
||||
class DATASET_API BasicTokenizer final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] lower_case If true, apply CaseFold, NormalizeUTF8 (NFD mode) and RegexReplace operations to
|
||||
|
@ -277,7 +277,7 @@ class MS_API BasicTokenizer final : public TensorTransform {
|
|||
|
||||
/// \brief A tokenizer used for Bert text process.
|
||||
/// \note BertTokenizer is not supported on the Windows platform yet.
|
||||
class MS_API BertTokenizer final : public TensorTransform {
|
||||
class DATASET_API BertTokenizer final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] vocab A Vocab object.
|
||||
|
@ -348,7 +348,7 @@ class MS_API BertTokenizer final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply case fold operation on UTF-8 string tensors.
|
||||
class MS_API CaseFold final : public TensorTransform {
|
||||
class DATASET_API CaseFold final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
@ -389,7 +389,7 @@ class FilterWikipediaXML final : public TensorTransform {
|
|||
|
||||
/// \brief Tokenize a Chinese string into words based on the dictionary.
|
||||
/// \note The integrity of the HMMSegment algorithm and MPSegment algorithm files must be confirmed.
|
||||
class MS_API JiebaTokenizer final : public TensorTransform {
|
||||
class DATASET_API JiebaTokenizer final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] hmm_path Dictionary file is used by the HMMSegment algorithm. The dictionary can be obtained on the
|
||||
|
@ -501,7 +501,7 @@ class MS_API JiebaTokenizer final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Look up a word into an id according to the input vocabulary table.
|
||||
class MS_API Lookup final : public TensorTransform {
|
||||
class DATASET_API Lookup final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] vocab a Vocab object.
|
||||
|
@ -555,7 +555,7 @@ class MS_API Lookup final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Generate n-gram from a 1-D string Tensor.
|
||||
class MS_API Ngram final : public TensorTransform {
|
||||
class DATASET_API Ngram final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] ngrams ngrams is a vector of positive integers. For example, if ngrams={4, 3}, then the result
|
||||
|
@ -606,7 +606,7 @@ class MS_API Ngram final : public TensorTransform {
|
|||
|
||||
#ifndef _WIN32
|
||||
/// \brief Apply normalize operation to UTF-8 string tensors.
|
||||
class MS_API NormalizeUTF8 final : public TensorTransform {
|
||||
class DATASET_API NormalizeUTF8 final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] normalize_form Valid values can be any of [NormalizeForm::kNone,NormalizeForm::kNfc,
|
||||
|
@ -642,7 +642,7 @@ class MS_API NormalizeUTF8 final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Replace a UTF-8 string tensor with 'replace' according to regular expression 'pattern'.
|
||||
class MS_API RegexReplace final : public TensorTransform {
|
||||
class DATASET_API RegexReplace final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] pattern The regex expression patterns.
|
||||
|
@ -682,7 +682,7 @@ class MS_API RegexReplace final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Tokenize a scalar tensor of UTF-8 string by the regex expression pattern.
|
||||
class MS_API RegexTokenizer final : public TensorTransform {
|
||||
class DATASET_API RegexTokenizer final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] delim_pattern The pattern of regex delimiters.
|
||||
|
@ -721,7 +721,7 @@ class MS_API RegexTokenizer final : public TensorTransform {
|
|||
#endif
|
||||
|
||||
/// \brief Tokenize a scalar token or a 1-D token to tokens by sentencepiece.
|
||||
class MS_API SentencePieceTokenizer final : public TensorTransform {
|
||||
class DATASET_API SentencePieceTokenizer final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] vocab a SentencePieceVocab object.
|
||||
|
@ -777,7 +777,7 @@ class MS_API SentencePieceTokenizer final : public TensorTransform {
|
|||
|
||||
/// \brief Construct a tensor from data (only 1-D for now), where each element in the dimension
|
||||
/// axis is a slice of data starting at the corresponding position, with a specified width.
|
||||
class MS_API SlidingWindow final : public TensorTransform {
|
||||
class DATASET_API SlidingWindow final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] width The width of the window. It must be an integer and greater than zero.
|
||||
|
@ -812,7 +812,7 @@ class MS_API SlidingWindow final : public TensorTransform {
|
|||
/// https://en.cppreference.com/w/cpp/string/basic_string/stof,
|
||||
/// https://en.cppreference.com/w/cpp/string/basic_string/stoul,
|
||||
/// except that any strings which represent negative numbers cannot be cast to an unsigned integer type.
|
||||
class MS_API ToNumber final : public TensorTransform {
|
||||
class DATASET_API ToNumber final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] data_type mindspore::DataType of the tensor to be cast to. Must be a numeric type, excluding bool.
|
||||
|
@ -841,7 +841,7 @@ class MS_API ToNumber final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Look up a token into an vector according to the input Vectors table.
|
||||
class MS_API ToVectors final : public TensorTransform {
|
||||
class DATASET_API ToVectors final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] vectors A Vectors object.
|
||||
|
@ -865,7 +865,7 @@ class MS_API ToVectors final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Truncate a pair of rank-1 tensors such that the total length is less than max_length.
|
||||
class MS_API TruncateSequencePair final : public TensorTransform {
|
||||
class DATASET_API TruncateSequencePair final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] max_length Maximum length required.
|
||||
|
@ -894,7 +894,7 @@ class MS_API TruncateSequencePair final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Tokenize a scalar tensor of UTF-8 string to Unicode characters.
|
||||
class MS_API UnicodeCharTokenizer final : public TensorTransform {
|
||||
class DATASET_API UnicodeCharTokenizer final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] with_offsets whether to output offsets of tokens (default=false).
|
||||
|
@ -923,7 +923,7 @@ class MS_API UnicodeCharTokenizer final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Tokenize scalar token or 1-D tokens to 1-D sub-word tokens.
|
||||
class MS_API WordpieceTokenizer final : public TensorTransform {
|
||||
class DATASET_API WordpieceTokenizer final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] vocab A Vocab object.
|
||||
|
@ -969,7 +969,7 @@ class MS_API WordpieceTokenizer final : public TensorTransform {
|
|||
|
||||
#ifndef _WIN32
|
||||
/// \brief Tokenize a scalar tensor of UTF-8 string on Unicode script boundaries.
|
||||
class MS_API UnicodeScriptTokenizer final : public TensorTransform {
|
||||
class DATASET_API UnicodeScriptTokenizer final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] keep_whitespace whether to emit whitespace tokens (default=false).
|
||||
|
@ -999,7 +999,7 @@ class MS_API UnicodeScriptTokenizer final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Tokenize a scalar tensor of UTF-8 string on ICU4C defined whitespaces.
|
||||
class MS_API WhitespaceTokenizer final : public TensorTransform {
|
||||
class DATASET_API WhitespaceTokenizer final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] with_offsets whether to output offsets of tokens (default=false).
|
||||
|
|
|
@ -47,7 +47,7 @@ class UniformAugment;
|
|||
// Abstract class to represent a tensor transform operation in the data pipeline.
|
||||
/// \class TensorTransform transforms.h
|
||||
/// \brief A base class to represent a tensor transform operation in the data pipeline.
|
||||
class MS_API TensorTransform : public std::enable_shared_from_this<TensorTransform> {
|
||||
class DATASET_API TensorTransform : public std::enable_shared_from_this<TensorTransform> {
|
||||
friend class Dataset;
|
||||
friend class Execute;
|
||||
friend class transforms::Compose;
|
||||
|
@ -76,7 +76,7 @@ class MS_API TensorTransform : public std::enable_shared_from_this<TensorTransfo
|
|||
};
|
||||
|
||||
/// \brief Slice object used in SliceOption.
|
||||
class MS_API Slice {
|
||||
class DATASET_API Slice {
|
||||
public:
|
||||
/// \brief Constructor, with start, stop and step default to 0.
|
||||
Slice() : start_(0), stop_(0), step_(0) {}
|
||||
|
@ -122,7 +122,7 @@ class MS_API Slice {
|
|||
};
|
||||
|
||||
/// \brief SliceOption used in Slice TensorTransform.
|
||||
class MS_API SliceOption {
|
||||
class DATASET_API SliceOption {
|
||||
public:
|
||||
/// \param[in] all Slice the whole dimension
|
||||
/// \par Example
|
||||
|
@ -166,7 +166,7 @@ class MS_API SliceOption {
|
|||
namespace transforms {
|
||||
|
||||
/// \brief Compose a list of transforms into a single transform.
|
||||
class MS_API Compose final : public TensorTransform {
|
||||
class DATASET_API Compose final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] transforms A vector of raw pointers to TensorTransform objects to be applied.
|
||||
|
@ -229,7 +229,7 @@ class MS_API Compose final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Concatenate all tensors into a single tensor.
|
||||
class MS_API Concatenate final : public TensorTransform {
|
||||
class DATASET_API Concatenate final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] axis Concatenate the tensors along given axis, only support 0 or -1 so far (default=0).
|
||||
|
@ -263,7 +263,7 @@ class MS_API Concatenate final : public TensorTransform {
|
|||
|
||||
/// \brief Duplicate the input tensor to a new output tensor.
|
||||
/// The input tensor is carried over to the output list.
|
||||
class MS_API Duplicate final : public TensorTransform {
|
||||
class DATASET_API Duplicate final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
@ -289,7 +289,7 @@ class MS_API Duplicate final : public TensorTransform {
|
|||
|
||||
/// \brief Fill all elements in the tensor with the specified value.
|
||||
/// The output tensor will have the same shape and type as the input tensor.
|
||||
class MS_API Fill final : public TensorTransform {
|
||||
class DATASET_API Fill final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] fill_value Scalar value to fill the tensor with.
|
||||
|
@ -322,7 +322,7 @@ class MS_API Fill final : public TensorTransform {
|
|||
|
||||
/// \brief Mask content of the input tensor with the given predicate.
|
||||
/// Any element of the tensor that matches the predicate will be evaluated to True, otherwise False.
|
||||
class MS_API Mask final : public TensorTransform {
|
||||
class DATASET_API Mask final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] op One of the relational operators: EQ, NE LT, GT, LE or GE.
|
||||
|
@ -357,7 +357,7 @@ class MS_API Mask final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Convert the labels into OneHot format.
|
||||
class MS_API OneHot final : public TensorTransform {
|
||||
class DATASET_API OneHot final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] num_classes number of classes.
|
||||
|
@ -388,7 +388,7 @@ class MS_API OneHot final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Pad input tensor according to pad_shape
|
||||
class MS_API PadEnd final : public TensorTransform {
|
||||
class DATASET_API PadEnd final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] pad_shape List of integers representing the shape needed, need to have same rank with input tensor.
|
||||
|
@ -421,7 +421,7 @@ class MS_API PadEnd final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Randomly perform a series of transforms with a given probability.
|
||||
class MS_API RandomApply final : public TensorTransform {
|
||||
class DATASET_API RandomApply final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] transforms A vector of raw pointers to TensorTransform objects to be applied.
|
||||
|
@ -487,7 +487,7 @@ class MS_API RandomApply final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Randomly select one transform from a list of transforms to perform on the input tensor.
|
||||
class MS_API RandomChoice final : public TensorTransform {
|
||||
class DATASET_API RandomChoice final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] transforms A vector of raw pointers to TensorTransform objects to be applied.
|
||||
|
@ -552,7 +552,7 @@ class MS_API RandomChoice final : public TensorTransform {
|
|||
/// \brief Extract a tensor out using the given n slices.
|
||||
/// The functionality of Slice is similar to the feature of indexing of NumPy.
|
||||
/// (Currently only rank-1 tensors are supported).
|
||||
class MS_API Slice final : public TensorTransform {
|
||||
class DATASET_API Slice final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] slice_input Vector of SliceOption.
|
||||
|
@ -582,7 +582,7 @@ class MS_API Slice final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Cast the MindSpore data type of a tensor to another.
|
||||
class MS_API TypeCast final : public TensorTransform {
|
||||
class DATASET_API TypeCast final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] data_type mindspore::DataType to be cast to.
|
||||
|
@ -612,7 +612,7 @@ class MS_API TypeCast final : public TensorTransform {
|
|||
|
||||
/// \brief Return an output tensor that contains all the unique elements of the input tensor in
|
||||
/// the same order as they appear in the input tensor.
|
||||
class MS_API Unique final : public TensorTransform {
|
||||
class DATASET_API Unique final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
|
|
@ -36,7 +36,7 @@ class TensorOperation;
|
|||
// Transform operations for performing computer vision.
|
||||
namespace vision {
|
||||
/// \brief Apply brightness adjustment on input image.
|
||||
class MS_API AdjustBrightness final : public TensorTransform {
|
||||
class DATASET_API AdjustBrightness final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] brightness_factor Adjusts image brightness, non negative real number.
|
||||
|
@ -66,7 +66,7 @@ class MS_API AdjustBrightness final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply contrast adjustment on input image.
|
||||
class MS_API AdjustContrast final : public TensorTransform {
|
||||
class DATASET_API AdjustContrast final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] contrast_factor Adjusts image contrast, non negative real number.
|
||||
|
@ -97,7 +97,7 @@ class MS_API AdjustContrast final : public TensorTransform {
|
|||
|
||||
/// \brief AdjustGamma TensorTransform.
|
||||
/// \note Apply gamma correction on input image.
|
||||
class MS_API AdjustGamma final : public TensorTransform {
|
||||
class DATASET_API AdjustGamma final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] gamma Non negative real number, which makes the output image pixel value
|
||||
|
@ -129,7 +129,7 @@ class MS_API AdjustGamma final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \note Apply hue adjustment on input image.
|
||||
class MS_API AdjustHue final : public TensorTransform {
|
||||
class DATASET_API AdjustHue final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] hue_factor How much to shift the hue channel, must be in the interval [-0.5, 0.5].
|
||||
|
@ -159,7 +159,7 @@ class MS_API AdjustHue final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Adjust the color saturation of the input image.
|
||||
class MS_API AdjustSaturation final : public TensorTransform {
|
||||
class DATASET_API AdjustSaturation final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] saturation_factor Adjust image saturation, non negative real number.
|
||||
|
@ -189,7 +189,7 @@ class MS_API AdjustSaturation final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply adjust sharpness on input image. Input image is expected to be in [H, W, C] or [H, W] format.
|
||||
class MS_API AdjustSharpness final : public TensorTransform {
|
||||
class DATASET_API AdjustSharpness final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] sharpness_factor How much to adjust the sharpness. Can be any Non negative real number.
|
||||
|
@ -220,7 +220,7 @@ class MS_API AdjustSharpness final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply AutoAugment data augmentation method.
|
||||
class MS_API AutoAugment final : public TensorTransform {
|
||||
class DATASET_API AutoAugment final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] policy An enum for the data auto augmentation policy (default=AutoAugmentPolicy::kImageNet).
|
||||
|
@ -261,7 +261,7 @@ class MS_API AutoAugment final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply automatic contrast on the input image.
|
||||
class MS_API AutoContrast final : public TensorTransform {
|
||||
class DATASET_API AutoContrast final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] cutoff Percent of pixels to cut off from the histogram, the valid range of cutoff value is 0 to 50.
|
||||
|
@ -293,7 +293,7 @@ class MS_API AutoContrast final : public TensorTransform {
|
|||
|
||||
/// \brief BoundingBoxAugment TensorTransform.
|
||||
/// \note Apply a given image transform on a random selection of bounding box regions of a given image.
|
||||
class MS_API BoundingBoxAugment final : public TensorTransform {
|
||||
class DATASET_API BoundingBoxAugment final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] transform Raw pointer to the TensorTransform operation.
|
||||
|
@ -354,7 +354,7 @@ class MS_API BoundingBoxAugment final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Change the color space of the image.
|
||||
class MS_API ConvertColor final : public TensorTransform {
|
||||
class DATASET_API ConvertColor final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] convert_mode The mode of image channel conversion.
|
||||
|
@ -382,7 +382,7 @@ class MS_API ConvertColor final : public TensorTransform {
|
|||
|
||||
/// \brief Mask a random section of each image with the corresponding part of another randomly
|
||||
/// selected image in that batch.
|
||||
class MS_API CutMixBatch final : public TensorTransform {
|
||||
class DATASET_API CutMixBatch final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] image_batch_format The format of the batch.
|
||||
|
@ -411,7 +411,7 @@ class MS_API CutMixBatch final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Randomly cut (mask) out a given number of square patches from the input image.
|
||||
class MS_API CutOut final : public TensorTransform {
|
||||
class DATASET_API CutOut final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] length Integer representing the side length of each square patch.
|
||||
|
@ -441,7 +441,7 @@ class MS_API CutOut final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply histogram equalization on the input image.
|
||||
class MS_API Equalize final : public TensorTransform {
|
||||
class DATASET_API Equalize final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
@ -463,7 +463,7 @@ class MS_API Equalize final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Erase the input image with given value.
|
||||
class MS_API Erase final : public TensorTransform {
|
||||
class DATASET_API Erase final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] top Vertical ordinate of the upper left corner of erased region.
|
||||
|
@ -501,16 +501,16 @@ class MS_API Erase final : public TensorTransform {
|
|||
/// \param[in] image Tensor of the image.
|
||||
/// \param[out] channels Channels of the image.
|
||||
/// \return The status code.
|
||||
Status MS_API GetImageNumChannels(const mindspore::MSTensor &image, dsize_t *channels);
|
||||
Status DATASET_API GetImageNumChannels(const mindspore::MSTensor &image, dsize_t *channels);
|
||||
|
||||
/// \brief Get the size of input image.
|
||||
/// \param[in] image Tensor of the image.
|
||||
/// \param[out] size Size of the image as [height, width].
|
||||
/// \return The status code.
|
||||
Status MS_API GetImageSize(const mindspore::MSTensor &image, std::vector<dsize_t> *size);
|
||||
Status DATASET_API GetImageSize(const mindspore::MSTensor &image, std::vector<dsize_t> *size);
|
||||
|
||||
/// \brief Flip the input image horizontally.
|
||||
class MS_API HorizontalFlip final : public TensorTransform {
|
||||
class DATASET_API HorizontalFlip final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
@ -532,7 +532,7 @@ class MS_API HorizontalFlip final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply invert on the input image in RGB mode.
|
||||
class MS_API Invert final : public TensorTransform {
|
||||
class DATASET_API Invert final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
@ -555,7 +555,7 @@ class MS_API Invert final : public TensorTransform {
|
|||
|
||||
/// \brief Apply MixUp transformation on an input batch of images and labels. The labels must be in
|
||||
/// one-hot format and Batch must be called before calling this function.
|
||||
class MS_API MixUpBatch final : public TensorTransform {
|
||||
class DATASET_API MixUpBatch final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] alpha hyperparameter of beta distribution (default = 1.0).
|
||||
|
@ -583,7 +583,7 @@ class MS_API MixUpBatch final : public TensorTransform {
|
|||
|
||||
/// \brief Normalize the input image with respect to mean and standard deviation and pads an extra
|
||||
/// channel with value zero.
|
||||
class MS_API NormalizePad final : public TensorTransform {
|
||||
class DATASET_API NormalizePad final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] mean A vector of mean values for each channel, with respect to channel order.
|
||||
|
@ -625,7 +625,7 @@ class MS_API NormalizePad final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Pad the image according to padding parameters.
|
||||
class MS_API Pad final : public TensorTransform {
|
||||
class DATASET_API Pad final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] padding A vector representing the number of pixels to pad the image.
|
||||
|
@ -675,7 +675,7 @@ class MS_API Pad final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Pad the image to a fixed size.
|
||||
class MS_API PadToSize final : public TensorTransform {
|
||||
class DATASET_API PadToSize final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] size A two element vector representing the target size to pad, in order of [height, width].
|
||||
|
@ -717,7 +717,7 @@ class MS_API PadToSize final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Posterize an image by reducing the number of bits for each color channel.
|
||||
class MS_API Posterize final : public TensorTransform {
|
||||
class DATASET_API Posterize final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] bits The number of bits to keep for each channel,
|
||||
|
@ -748,7 +748,7 @@ class MS_API Posterize final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Automatically adjust the contrast of the image with a given probability.
|
||||
class MS_API RandomAutoContrast final : public TensorTransform {
|
||||
class DATASET_API RandomAutoContrast final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] cutoff Percent of the lightest and darkest pixels to be cut off from
|
||||
|
@ -783,7 +783,7 @@ class MS_API RandomAutoContrast final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Randomly adjust the sharpness of the input image with a given probability.
|
||||
class MS_API RandomAdjustSharpness final : public TensorTransform {
|
||||
class DATASET_API RandomAdjustSharpness final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] degree A float representing sharpness adjustment degree, which must be non negative.
|
||||
|
@ -817,7 +817,7 @@ class MS_API RandomAdjustSharpness final : public TensorTransform {
|
|||
/// \brief Blend an image with its grayscale version with random weights
|
||||
/// t and 1 - t generated from a given range. If the range is trivial
|
||||
/// then the weights are determinate and t equals to the bound of the interval.
|
||||
class MS_API RandomColor final : public TensorTransform {
|
||||
class DATASET_API RandomColor final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] t_lb Lower bound random weights.
|
||||
|
@ -848,7 +848,7 @@ class MS_API RandomColor final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Randomly adjust the brightness, contrast, saturation, and hue of the input image.
|
||||
class MS_API RandomColorAdjust final : public TensorTransform {
|
||||
class DATASET_API RandomColorAdjust final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] brightness Brightness adjustment factor. Must be a vector of one or two values
|
||||
|
@ -889,7 +889,7 @@ class MS_API RandomColorAdjust final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Crop the input image at a random location.
|
||||
class MS_API RandomCrop final : public TensorTransform {
|
||||
class DATASET_API RandomCrop final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] size A vector representing the output size of the cropped image.
|
||||
|
@ -945,7 +945,7 @@ class MS_API RandomCrop final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Equivalent to RandomResizedCrop TensorTransform, but crop the image before decoding.
|
||||
class MS_API RandomCropDecodeResize final : public TensorTransform {
|
||||
class DATASET_API RandomCropDecodeResize final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] size A vector representing the output size of the cropped image.
|
||||
|
@ -992,7 +992,7 @@ class MS_API RandomCropDecodeResize final : public TensorTransform {
|
|||
|
||||
/// \brief Crop the input image at a random location and adjust bounding boxes accordingly.
|
||||
/// If the cropped area is out of bbox, the returned bbox will be empty.
|
||||
class MS_API RandomCropWithBBox final : public TensorTransform {
|
||||
class DATASET_API RandomCropWithBBox final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] size A vector representing the output size of the cropped image.
|
||||
|
@ -1046,7 +1046,7 @@ class MS_API RandomCropWithBBox final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Randomly apply histogram equalization on the input image with a given probability.
|
||||
class MS_API RandomEqualize final : public TensorTransform {
|
||||
class DATASET_API RandomEqualize final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] prob A float representing the probability of equalization, which
|
||||
|
@ -1077,7 +1077,7 @@ class MS_API RandomEqualize final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Randomly flip the input image horizontally with a given probability.
|
||||
class MS_API RandomHorizontalFlip final : public TensorTransform {
|
||||
class DATASET_API RandomHorizontalFlip final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] prob A float representing the probability of flip.
|
||||
|
@ -1107,7 +1107,7 @@ class MS_API RandomHorizontalFlip final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Randomly flip the input image horizontally with a given probability and adjust bounding boxes accordingly.
|
||||
class MS_API RandomHorizontalFlipWithBBox final : public TensorTransform {
|
||||
class DATASET_API RandomHorizontalFlipWithBBox final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] prob A float representing the probability of flip.
|
||||
|
@ -1136,7 +1136,7 @@ class MS_API RandomHorizontalFlipWithBBox final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Randomly invert the input image with a given probability.
|
||||
class MS_API RandomInvert final : public TensorTransform {
|
||||
class DATASET_API RandomInvert final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] prob A float representing the probability of the image being inverted, which
|
||||
|
@ -1167,7 +1167,7 @@ class MS_API RandomInvert final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Add AlexNet-style PCA-based noise to an image.
|
||||
class MS_API RandomLighting final : public TensorTransform {
|
||||
class DATASET_API RandomLighting final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] alpha A float representing the intensity of the image (default=0.05).
|
||||
|
@ -1197,7 +1197,7 @@ class MS_API RandomLighting final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Reduce the number of bits for each color channel randomly.
|
||||
class MS_API RandomPosterize final : public TensorTransform {
|
||||
class DATASET_API RandomPosterize final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] bit_range Range of random posterize to compress image.
|
||||
|
@ -1228,7 +1228,7 @@ class MS_API RandomPosterize final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Resize the input image using a randomly selected interpolation mode.
|
||||
class MS_API RandomResize final : public TensorTransform {
|
||||
class DATASET_API RandomResize final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] size A vector representing the output size of the resized image.
|
||||
|
@ -1261,7 +1261,7 @@ class MS_API RandomResize final : public TensorTransform {
|
|||
|
||||
/// \brief Resize the input image using a randomly selected interpolation mode and adjust
|
||||
/// bounding boxes accordingly.
|
||||
class MS_API RandomResizeWithBBox final : public TensorTransform {
|
||||
class DATASET_API RandomResizeWithBBox final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] size A vector representing the output size of the resized image.
|
||||
|
@ -1292,7 +1292,7 @@ class MS_API RandomResizeWithBBox final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Crop the input image to a random size and aspect ratio.
|
||||
class MS_API RandomResizedCrop final : public TensorTransform {
|
||||
class DATASET_API RandomResizedCrop final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] size A vector representing the output size of the cropped image.
|
||||
|
@ -1340,7 +1340,7 @@ class MS_API RandomResizedCrop final : public TensorTransform {
|
|||
|
||||
/// \brief Crop the input image to a random size and aspect ratio.
|
||||
/// If cropped area is out of bbox, the return bbox will be empty.
|
||||
class MS_API RandomResizedCropWithBBox final : public TensorTransform {
|
||||
class DATASET_API RandomResizedCropWithBBox final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] size A vector representing the output size of the cropped image.
|
||||
|
@ -1387,7 +1387,7 @@ class MS_API RandomResizedCropWithBBox final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Rotate the image according to parameters.
|
||||
class MS_API RandomRotation final : public TensorTransform {
|
||||
class DATASET_API RandomRotation final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] degrees A float vector of size 2, representing the starting and ending degrees.
|
||||
|
@ -1434,7 +1434,7 @@ class MS_API RandomRotation final : public TensorTransform {
|
|||
/// (operation, prob), where operation is a TensorTransform operation and prob is the probability that this
|
||||
/// operation will be applied. Once a sub-policy is selected, each operation within the sub-policy with be
|
||||
/// applied in sequence according to its probability.
|
||||
class MS_API RandomSelectSubpolicy final : public TensorTransform {
|
||||
class DATASET_API RandomSelectSubpolicy final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] policy Vector of sub-policies to choose from, in which the TensorTransform objects are raw pointers.
|
||||
|
@ -1509,7 +1509,7 @@ class MS_API RandomSelectSubpolicy final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Adjust the sharpness of the input image by a fixed or random degree.
|
||||
class MS_API RandomSharpness final : public TensorTransform {
|
||||
class DATASET_API RandomSharpness final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] degrees A float vector of size 2, representing the range of random sharpness
|
||||
|
@ -1541,7 +1541,7 @@ class MS_API RandomSharpness final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Invert pixels randomly within a specified range.
|
||||
class MS_API RandomSolarize final : public TensorTransform {
|
||||
class DATASET_API RandomSolarize final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] threshold A vector with two elements specifying the pixel range to invert.
|
||||
|
@ -1573,7 +1573,7 @@ class MS_API RandomSolarize final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Randomly flip the input image vertically with a given probability.
|
||||
class MS_API RandomVerticalFlip final : public TensorTransform {
|
||||
class DATASET_API RandomVerticalFlip final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] prob A float representing the probability of flip.
|
||||
|
@ -1603,7 +1603,7 @@ class MS_API RandomVerticalFlip final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Randomly flip the input image vertically with a given probability and adjust bounding boxes accordingly.
|
||||
class MS_API RandomVerticalFlipWithBBox final : public TensorTransform {
|
||||
class DATASET_API RandomVerticalFlipWithBBox final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] prob A float representing the probability of flip.
|
||||
|
@ -1632,7 +1632,7 @@ class MS_API RandomVerticalFlipWithBBox final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Rescale the pixel value of input image.
|
||||
class MS_API Rescale final : public TensorTransform {
|
||||
class DATASET_API Rescale final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] rescale Rescale factor.
|
||||
|
@ -1663,7 +1663,7 @@ class MS_API Rescale final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Crop the given image and zoom to the specified size.
|
||||
class MS_API ResizedCrop final : public TensorTransform {
|
||||
class DATASET_API ResizedCrop final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] top Horizontal ordinate of the upper left corner of the crop image.
|
||||
|
@ -1707,7 +1707,7 @@ class MS_API ResizedCrop final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Resize the input image to the given size and adjust bounding boxes accordingly.
|
||||
class MS_API ResizeWithBBox final : public TensorTransform {
|
||||
class DATASET_API ResizeWithBBox final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] size The output size of the resized image.
|
||||
|
@ -1745,7 +1745,7 @@ class MS_API ResizeWithBBox final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Change the format of input tensor from 4-channel RGBA to 3-channel BGR.
|
||||
class MS_API RGBA2BGR final : public TensorTransform {
|
||||
class DATASET_API RGBA2BGR final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
@ -1770,7 +1770,7 @@ class MS_API RGBA2BGR final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Change the input 4 channel RGBA tensor to 3 channel RGB.
|
||||
class MS_API RGBA2RGB final : public TensorTransform {
|
||||
class DATASET_API RGBA2RGB final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
@ -1795,7 +1795,7 @@ class MS_API RGBA2RGB final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \note Slice the tensor to multiple patches in horizontal and vertical directions.
|
||||
class MS_API SlicePatches final : public TensorTransform {
|
||||
class DATASET_API SlicePatches final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] num_height The number of patches in vertical direction (default=1).
|
||||
|
@ -1832,7 +1832,7 @@ class MS_API SlicePatches final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Invert pixels within a specified range.
|
||||
class MS_API Solarize final : public TensorTransform {
|
||||
class DATASET_API Solarize final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] threshold A vector with two elements specifying the pixel range to invert.
|
||||
|
@ -1864,7 +1864,7 @@ class MS_API Solarize final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Swap the red and blue channels of the input image.
|
||||
class MS_API SwapRedBlue final : public TensorTransform {
|
||||
class DATASET_API SwapRedBlue final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
@ -1889,7 +1889,7 @@ class MS_API SwapRedBlue final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Divide the pixel values by 255 and convert from HWC format to CHW format with required datatype.
|
||||
class MS_API ToTensor final : public TensorTransform {
|
||||
class DATASET_API ToTensor final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] output_type The type of the output tensor of type mindspore::DataType or String
|
||||
|
@ -1921,7 +1921,7 @@ class MS_API ToTensor final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Dataset-independent data-augmentation with TrivialAugment Wide.
|
||||
class MS_API TrivialAugmentWide final : public TensorTransform {
|
||||
class DATASET_API TrivialAugmentWide final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] num_magnitude_bins The number of different magnitude values. Default: 31.
|
||||
|
@ -1958,7 +1958,7 @@ class MS_API TrivialAugmentWide final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Randomly perform transformations, as selected from input transform list, on the input tensor.
|
||||
class MS_API UniformAugment final : public TensorTransform {
|
||||
class DATASET_API UniformAugment final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] transforms Raw pointer to vector of TensorTransform operations.
|
||||
|
@ -2025,7 +2025,7 @@ class MS_API UniformAugment final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Flip the input image vertically.
|
||||
class MS_API VerticalFlip final : public TensorTransform {
|
||||
class DATASET_API VerticalFlip final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace vision {
|
|||
|
||||
/// \brief Decode and resize JPEG image using the hardware algorithm of
|
||||
/// Ascend series chip DVPP module.
|
||||
class MS_API DvppDecodeResizeJpeg final : public TensorTransform {
|
||||
class DATASET_API DvppDecodeResizeJpeg final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] resize Parameter vector of two integers for each dimension, with respect to H,W order.
|
||||
|
@ -67,7 +67,7 @@ class MS_API DvppDecodeResizeJpeg final : public TensorTransform {
|
|||
|
||||
/// \brief Decode, resize and crop JPEG image using the hardware algorithm of
|
||||
/// Ascend series chip DVPP module.
|
||||
class MS_API DvppDecodeResizeCropJpeg final : public TensorTransform {
|
||||
class DATASET_API DvppDecodeResizeCropJpeg final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] crop Parameter vector of two integers for each dimension after final crop, with respect to H,W order.
|
||||
|
@ -100,7 +100,7 @@ class MS_API DvppDecodeResizeCropJpeg final : public TensorTransform {
|
|||
|
||||
/// \brief Decode H264/H265 video using the hardware algorithm of
|
||||
/// DVPP module on Ascend series chip.
|
||||
class MS_API DvppDecodeVideo final : public TensorTransform {
|
||||
class DATASET_API DvppDecodeVideo final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] size Parameter vector of two integers for each dimension of input video frames, with respect to H,W
|
||||
|
@ -176,7 +176,7 @@ class MS_API DvppDecodeVideo final : public TensorTransform {
|
|||
|
||||
/// \brief Decode PNG image using the hardware algorithm of
|
||||
/// Ascend series chip DVPP module.
|
||||
class MS_API DvppDecodePng final : public TensorTransform {
|
||||
class DATASET_API DvppDecodePng final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace vision {
|
|||
class RotateOperation;
|
||||
|
||||
/// \brief Apply affine transform on the input image.
|
||||
class MS_API Affine final : public TensorTransform {
|
||||
class DATASET_API Affine final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] degrees The degrees to rotate the image.
|
||||
|
@ -79,7 +79,7 @@ class MS_API Affine final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Crop the input image at the center to the given size.
|
||||
class MS_API CenterCrop final : public TensorTransform {
|
||||
class DATASET_API CenterCrop final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] size A vector representing the output size of the cropped image.
|
||||
|
@ -113,7 +113,7 @@ class MS_API CenterCrop final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Crop an image based on location and crop size.
|
||||
class MS_API Crop final : public TensorTransform {
|
||||
class DATASET_API Crop final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] coordinates Starting location of crop. Must be a vector of two values, in the form of {x_coor, y_coor}.
|
||||
|
@ -146,7 +146,7 @@ class MS_API Crop final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Decode the input image in RGB mode.
|
||||
class MS_API Decode final : public TensorTransform {
|
||||
class DATASET_API Decode final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] rgb A boolean indicating whether to decode the image in RGB mode or not.
|
||||
|
@ -177,7 +177,7 @@ class MS_API Decode final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Blur the input image with the specified Gaussian kernel.
|
||||
class MS_API GaussianBlur final : public TensorTransform {
|
||||
class DATASET_API GaussianBlur final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] kernel_size A vector of Gaussian kernel size for width and height. The value must be positive and odd.
|
||||
|
@ -209,7 +209,7 @@ class MS_API GaussianBlur final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Transpose the input image; shape (H, W, C) to shape (C, H, W).
|
||||
class MS_API HWC2CHW final : public TensorTransform {
|
||||
class DATASET_API HWC2CHW final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
@ -231,7 +231,7 @@ class MS_API HWC2CHW final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Normalize the input image with respect to mean and standard deviation.
|
||||
class MS_API Normalize final : public TensorTransform {
|
||||
class DATASET_API Normalize final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] mean A vector of mean values for each channel, with respect to channel order.
|
||||
|
@ -269,7 +269,7 @@ class MS_API Normalize final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Apply a Random Affine transformation on the input image in RGB or Greyscale mode.
|
||||
class MS_API RandomAffine final : public TensorTransform {
|
||||
class DATASET_API RandomAffine final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] degrees A float vector of size 2, representing the starting and ending degree.
|
||||
|
@ -320,7 +320,7 @@ class MS_API RandomAffine final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Resize the input image to the given size.
|
||||
class MS_API Resize final : public TensorTransform {
|
||||
class DATASET_API Resize final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] size A vector representing the output size of the resized image.
|
||||
|
@ -360,7 +360,7 @@ class MS_API Resize final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Keep the original picture ratio and fills the rest.
|
||||
class MS_API ResizePreserveAR final : public TensorTransform {
|
||||
class DATASET_API ResizePreserveAR final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \param[in] height The height of image output value after resizing.
|
||||
|
@ -401,7 +401,7 @@ class MS_API ResizePreserveAR final : public TensorTransform {
|
|||
|
||||
/// \brief RGB2BGR TensorTransform.
|
||||
/// \note Convert the format of input image from RGB to BGR.
|
||||
class MS_API RGB2BGR final : public TensorTransform {
|
||||
class DATASET_API RGB2BGR final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
@ -428,7 +428,7 @@ class MS_API RGB2BGR final : public TensorTransform {
|
|||
/// \brief RGB2GRAY TensorTransform.
|
||||
/// \note Convert RGB image or color image to grayscale image.
|
||||
/// \brief Convert a RGB image or color image to a grayscale one.
|
||||
class MS_API RGB2GRAY final : public TensorTransform {
|
||||
class DATASET_API RGB2GRAY final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \par Example
|
||||
|
@ -453,7 +453,7 @@ class MS_API RGB2GRAY final : public TensorTransform {
|
|||
};
|
||||
|
||||
/// \brief Rotate the input image according to parameters.
|
||||
class MS_API Rotate final : public TensorTransform {
|
||||
class DATASET_API Rotate final : public TensorTransform {
|
||||
public:
|
||||
/// \brief Constructor.
|
||||
/// \note This api is only used in Lite, the interpolation mode is bilinear.
|
||||
|
|
Loading…
Reference in New Issue