Skip to content

Commit

Permalink
Fix the common typos in the tasks directory.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 716715702
  • Loading branch information
MediaPipe Team authored and copybara-github committed Jan 17, 2025
1 parent 7e33b6c commit cf6e4ec
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ TrackHolisticPoseUsingCustomPoseDetection(
{// Min cutoff 0.01 results into ~0.002 alpha in landmark EMA filter when
// landmark is static.
/*.min_cutoff = */ 0.01,
// Beta 10.0 in combintation with min_cutoff 0.01 results into ~0.68
// Beta 10.0 in combination with min_cutoff 0.01 results into ~0.68
// alpha in landmark EMA filter when landmark is moving fast.
/*.beta = */ 10.0,
// Derivative cutoff 1.0 results into ~0.17 alpha in landmark velocity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ - (void)testCreateAudioRecordSucceeds {
XCTAssertEqual(audioRecord.bufferLength, bufferLength);
}

// Test for error propogation from audio record creation.
// Test for error propagation from audio record creation.
- (void)testCreateAudioRecordWithInvalidChannelCountFails {
const NSUInteger channelCount = 3;

Expand Down
14 changes: 7 additions & 7 deletions mediapipe/tasks/ios/test/audio/core/MPPAudioRecordTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ - (void)testConvertAndLoadAudioRecordWithMonoFormatAndLongBufferLengthSucceeds {
const NSUInteger channelCount = 1;
const NSUInteger sampleRate = 8000;

// Buffer length is equal to the interim buffer produced by `MPPAudioRecord` after coversion of
// Buffer length is equal to the interim buffer produced by `MPPAudioRecord` after conversion of
// the audio samples to its format. Test ensures that the entire buffer is loaded into the ring
// buffer of audio record in this scenario.
const NSUInteger expectedBufferLengthOfInternalConvertedAudioBuffer = 34180;

// Buffer length is equal to the interim buffer produced by `MPPAudioRecord` after coversion of
// Buffer length is equal to the interim buffer produced by `MPPAudioRecord` after conversion of
// the audio samples to its format. Test ensures that the entire buffer is loaded into the ring
// buffer of audio record in this scenario.
[MPPAudioRecordTests
Expand All @@ -165,7 +165,7 @@ - (void)testConvertAndLoadAudioRecordWithMonoFormatAndLongBufferLengthSucceeds {
expectedBufferLengthOfInternalConvertedAudioBuffer
channelCount:channelCount];

// Buffer length is longer than the interim buffer produced by `MPPAudioRecord` after coversion of
// Buffer length is longer than the interim buffer produced by `MPPAudioRecord` after conversion of
// the audio samples to its format. Test ensures that the entire buffer is loaded as the most
// recent samples of the ring buffer of audio record by pushing out the oldest samples in this
// scenario. After loading the ring buffer, the earliest samples should be all zeroes since we
Expand All @@ -183,7 +183,7 @@ - (void)testConvertAndRepeatedlyLoadAudioRecordWithMonoFormatSucceeds {
const NSUInteger channelCount = 1;
const NSUInteger sampleRate = 8000;

// Buffer length is longer than the interim buffer produced by `MPPAudioRecord` after coversion of
// Buffer length is longer than the interim buffer produced by `MPPAudioRecord` after conversion of
// the audio samples to its format. Test ensures that the entire buffer is loaded as the most
// recent samples of the ring buffer of audio record by pushing out the oldest samples in this
// scenario. After loading the ring buffer, the earliest samples should be all zeroes since we
Expand All @@ -209,12 +209,12 @@ - (void)testReadAudioRecordAtOffsetSucceeds {
const NSUInteger channelCount = 1;
const NSUInteger sampleRate = 8000;

// Buffer length is equal to the interim buffer produced by `MPPAudioRecord` after coversion of
// Buffer length is equal to the interim buffer produced by `MPPAudioRecord` after conversion of
// the audio samples to its format. Test ensures that the entire buffer is loaded into the ring
// buffer of audio record in this scenario.
const NSUInteger expectedBufferLengthOfInternalConvertedAudioBuffer = 34180;

// Buffer length is equal to the interim buffer produced by `MPPAudioRecord` after coversion of
// Buffer length is equal to the interim buffer produced by `MPPAudioRecord` after conversion of
// the audio samples to its format. Test ensures that the entire buffer is loaded into the ring
// buffer of audio record in this scenario.
MPPAudioRecord *audioRecord = [MPPAudioRecordTests
Expand Down Expand Up @@ -398,7 +398,7 @@ + (void)assertFloatBuffer:(MPPFloatBuffer *)floatBuffer
FLT_EPSILON);
}

// Starting indices for comparison of the second chunks in float bufer and `pcmBuffer` are
// Starting indices for comparison of the second chunks in float buffer and `pcmBuffer` are
// calculated.
const NSInteger startIndexForComparisonInFloatBuffer = firstChunkLength;
const NSInteger startIndexForComparisonInPCMBuffer = pcmBuffer.frameLength - secondChunkLength;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ - (CVPixelBufferRef)pixelBuffer {
}

// To create a `CVPixelBuffer` from `CGImage`, the underlying buffer of the `CGImage` is extracted
// in the format `kCVPixelFormatType32BGRA`. since `CVPixelBuffer`s only suport the pixel format
// in the format `kCVPixelFormatType32BGRA`. since `CVPixelBuffer`s only support the pixel format
// `kCVPixelFormatType32BGRA` for 32 bit RGBA images (All RGB images are stored with an alpha
// value of 255.0 by iOS).
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class AudioClassifier extends AudioTaskRunner<AudioClassifierResult[]> {

/**
* Internal function for converting raw data into classification results, and
* adding them to our classfication results list.
* adding them to our classification results list.
**/
private addJsAudioClassificationResults(binaryProtos: Uint8Array[]): void {
binaryProtos.forEach((binaryProto) => {
Expand Down
2 changes: 1 addition & 1 deletion mediapipe/tasks/web/audio/audio_embedder/audio_embedder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class AudioEmbedder extends AudioTaskRunner<AudioEmbedderResult[]> {
* @param sampleRate The sample rate in Hz of the provided audio data. If not
* set, defaults to the sample rate set via `setDefaultSampleRate()` or
* `48000` if no custom default was set.
* @return The embedding resuls of the audio
* @return The embedding results of the audio
*/
embed(audioData: Float32Array, sampleRate?: number): AudioEmbedderResult[] {
return this.processAudioClip(audioData, sampleRate);
Expand Down
2 changes: 1 addition & 1 deletion mediapipe/tasks/web/text/text_embedder/text_embedder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export class TextEmbedder extends TaskRunner {
*
* @export
* @param text The text to process.
* @return The embedding resuls of the text
* @return The embedding results of the text
*/
embed(text: string): TextEmbedderResult {
this.graphRunner.addStringToStream(
Expand Down
2 changes: 1 addition & 1 deletion mediapipe/tasks/web/vision/core/drawing_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export class DrawingUtils {
*
* @export
* @param boundingBox The bounding box to draw.
* @param style The style to visualize the boundin box.
* @param style The style to visualize the bounding box.
*/
drawBoundingBox(boundingBox: BoundingBox, style?: DrawingOptions): void {
const ctx = this.getCanvasRenderingContext();
Expand Down
2 changes: 1 addition & 1 deletion mediapipe/tasks/web/vision/core/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export class MPImage {
if (!this.canvas) {
throw new Error(
'Conversion to different image formats require that a canvas ' +
'is passed when iniitializing the image.');
'is passed when initializing the image.');
}
if (!this.gl) {
this.gl = assertExists(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class ImageSegmenter extends VisionTaskRunner {
*/
override setOptions(options: ImageSegmenterOptions): Promise<void> {
// Note that we have to support both JSPB and ProtobufJS, hence we
// have to expliclity clear the values instead of setting them to
// have to explicitly clear the values instead of setting them to
// `undefined`.
if (options.displayNamesLocale !== undefined) {
this.options.setDisplayNamesLocale(options.displayNamesLocale);
Expand Down

0 comments on commit cf6e4ec

Please sign in to comment.