diff --git a/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbedding+Helpers.h b/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbedding+Helpers.h index 9ff5455d9..33fb3839d 100644 --- a/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbedding+Helpers.h +++ b/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbedding+Helpers.h @@ -19,7 +19,8 @@ NS_ASSUME_NONNULL_BEGIN @interface MPPEmbedding (Helpers) -+ (MPPEmbedding *)embeddingWithProto:(const ::mediapipe::tasks::components::containers::proto::Embedding &)embeddingProto; ++ (MPPEmbedding *)embeddingWithProto: + (const ::mediapipe::tasks::components::containers::proto::Embedding &)embeddingProto; @end diff --git a/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbedding+Helpers.mm b/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbedding+Helpers.mm index 4b2acff7c..a676242e8 100644 --- a/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbedding+Helpers.mm +++ b/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbedding+Helpers.mm @@ -31,7 +31,8 @@ using EmbeddingProto = ::mediapipe::tasks::components::containers::proto::Embedd NSData *quantizedEmbedding; if (embeddingProto.has_float_embedding()) { - floatEmbedding = [NSMutableArray arrayWithCapacity:embeddingProto.float_embedding().values_size()]; + floatEmbedding = + [NSMutableArray arrayWithCapacity:embeddingProto.float_embedding().values_size()]; const auto floatEmbeddingValues = embeddingProto.float_embedding().values(); for (const auto value : embeddingProto.float_embedding().values()) { @@ -40,11 +41,11 @@ using EmbeddingProto = ::mediapipe::tasks::components::containers::proto::Embedd } if (embeddingProto.has_quantized_embedding()) { - const std::string& cppQuantizedEmbedding = - embeddingProto.quantized_embedding().values().data(); + const std::string &cppQuantizedEmbedding = embeddingProto.quantized_embedding().values().data(); const char *cppQuantizedEmbeddingCString = cppQuantizedEmbedding.c_str(); - quantizedEmbedding = [NSData dataWithBytes:cppQuantizedEmbeddingCString length:sizeof(cppQuantizedEmbeddingCString)]; + quantizedEmbedding = [NSData dataWithBytes:cppQuantizedEmbeddingCString + length:sizeof(cppQuantizedEmbeddingCString)]; } NSString *headName; @@ -54,9 +55,9 @@ using EmbeddingProto = ::mediapipe::tasks::components::containers::proto::Embedd } return [[MPPEmbedding alloc] initWithFloatEmbedding:floatEmbedding - quantizedEmbedding:quantizedEmbedding - headIndex:embeddingProto.head_index() - headName:headName]; + quantizedEmbedding:quantizedEmbedding + headIndex:embeddingProto.head_index() + headName:headName]; } @end diff --git a/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbeddingResult+Helpers.h b/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbeddingResult+Helpers.h index 6ec26b764..cc53c3e25 100644 --- a/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbeddingResult+Helpers.h +++ b/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbeddingResult+Helpers.h @@ -19,7 +19,9 @@ NS_ASSUME_NONNULL_BEGIN @interface MPPEmbeddingResult (Helpers) -+ (MPPEmbeddingResult *)embeddingResultWithProto:(const ::mediapipe::tasks::components::containers::proto::EmbeddingResult &)embeddingResultProto; ++ (MPPEmbeddingResult *)embeddingResultWithProto: + (const ::mediapipe::tasks::components::containers::proto::EmbeddingResult &) + embeddingResultProto; @end diff --git a/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbeddingResult+Helpers.mm b/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbeddingResult+Helpers.mm index 385b74efb..f9863e9ca 100644 --- a/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbeddingResult+Helpers.mm +++ b/mediapipe/tasks/ios/components/containers/utils/sources/MPPEmbeddingResult+Helpers.mm @@ -23,9 +23,10 @@ using EmbeddingResultProto = ::mediapipe::tasks::components::containers::proto:: @implementation MPPEmbeddingResult (Helpers) -+ (MPPEmbeddingResult *)embeddingResultWithProto:(const EmbeddingResultProto &)embeddingResultProto { - NSMutableArray *embeddings = [NSMutableArray - arrayWithCapacity:(NSUInteger)embeddingResultProto.embeddings_size()]; ++ (MPPEmbeddingResult *)embeddingResultWithProto: + (const EmbeddingResultProto &)embeddingResultProto { + NSMutableArray *embeddings = + [NSMutableArray arrayWithCapacity:(NSUInteger)embeddingResultProto.embeddings_size()]; for (const auto &embeddingProto : embeddingResultProto.embeddings()) { [embeddings addObject:[MPPEmbedding embeddingWithProto:embeddingProto]]; } @@ -35,8 +36,7 @@ using EmbeddingResultProto = ::mediapipe::tasks::components::containers::proto:: timestampMs = (NSInteger)embeddingResultProto.timestamp_ms(); } - return [[MPPEmbeddingResult alloc] initWithEmbeddings:embeddings - timestampMs:timestampMs]; + return [[MPPEmbeddingResult alloc] initWithEmbeddings:embeddings timestampMs:timestampMs]; } @end