Skip to content

Commit

Permalink
iOS update mediapipe tasks text version from 0.10.5 to 0.10.14 (#392)
Browse files Browse the repository at this point in the history
* update text classification tasks text version to 0.10.14

* update text embedder tasks text to 0.10.14 and update unit test
  • Loading branch information
st-tuanmai authored May 21, 2024
1 parent 81f24c3 commit 88792a9
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion examples/text_classification/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ platform :ios, '15.0'
target 'TextClassifier' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
pod 'MediaPipeTasksText', '0.10.5'
pod 'MediaPipeTasksText', '0.10.14'

# Pods for TextClassifier
end
Expand Down
16 changes: 8 additions & 8 deletions examples/text_classification/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
PODS:
- MediaPipeTasksCommon (0.10.5)
- MediaPipeTasksText (0.10.5):
- MediaPipeTasksCommon (= 0.10.5)
- MediaPipeTasksCommon (0.10.14)
- MediaPipeTasksText (0.10.14):
- MediaPipeTasksCommon (= 0.10.14)

DEPENDENCIES:
- MediaPipeTasksText
- MediaPipeTasksText (= 0.10.14)

SPEC REPOS:
trunk:
- MediaPipeTasksCommon
- MediaPipeTasksText

SPEC CHECKSUMS:
MediaPipeTasksCommon: 235e81afa9f7bd5b5b39f00a858bfb2539d1a52f
MediaPipeTasksText: d359653b471d424b0a3b9a564b474bba2e4cf69a
MediaPipeTasksCommon: 5660099c2dd81f7ac4a7a5f51055785ead8e0e64
MediaPipeTasksText: 6c251a9d3d127ef7a1efd82aa1d7f84f980a46b2

PODFILE CHECKSUM: 51f76d4617e8d16dafaecd763548c7b4d8be00e5
PODFILE CHECKSUM: 9f7107afefde459e1aeef9a769c7075bcb91c2d1

COCOAPODS: 1.12.1
COCOAPODS: 1.14.3
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 9PLS9MU793;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
Expand All @@ -574,7 +574,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 9PLS9MU793;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MARKETING_VERSION = 1.0;
Expand Down
2 changes: 1 addition & 1 deletion examples/text_embedder/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ platform :ios, '15.0'
target 'TextEmbedder' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
pod 'MediaPipeTasksText', '0.10.5'
pod 'MediaPipeTasksText', '0.10.14'

# Pods for TextEmbedder

Expand Down
16 changes: 8 additions & 8 deletions examples/text_embedder/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
PODS:
- MediaPipeTasksCommon (0.10.5)
- MediaPipeTasksText (0.10.5):
- MediaPipeTasksCommon (= 0.10.5)
- MediaPipeTasksCommon (0.10.14)
- MediaPipeTasksText (0.10.14):
- MediaPipeTasksCommon (= 0.10.14)

DEPENDENCIES:
- MediaPipeTasksText (= 0.10.5)
- MediaPipeTasksText (= 0.10.14)

SPEC REPOS:
trunk:
- MediaPipeTasksCommon
- MediaPipeTasksText

SPEC CHECKSUMS:
MediaPipeTasksCommon: 235e81afa9f7bd5b5b39f00a858bfb2539d1a52f
MediaPipeTasksText: d359653b471d424b0a3b9a564b474bba2e4cf69a
MediaPipeTasksCommon: 5660099c2dd81f7ac4a7a5f51055785ead8e0e64
MediaPipeTasksText: 6c251a9d3d127ef7a1efd82aa1d7f84f980a46b2

PODFILE CHECKSUM: 93aea3ec1bb08db63e89ddd1ad388461eba5dc31
PODFILE CHECKSUM: f312c6eacc7f937af44db7eab9ed3b75a24ae85e

COCOAPODS: 1.12.1
COCOAPODS: 1.14.3
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ final class TextEmbedderTests: XCTestCase {
static let text2: String = "Google has released 24 versions of the Android operating system since 2008"

static let embeddingResult1: Embedding = Embedding(
floatEmbedding: [0.36532423, 0.047590725, -0.58034915, 0.81803715, -0.83936816, 1.0803267, -1.683998, -1.2703534, 1.8736261, -0.45948586, -0.4926827, -0.78908664, -0.3505274, -1.6993542, 0.769318, 1.9567271, -1.7904824, -1.1316108, 0.059136376, 0.00289971, -1.953178, 1.9991299, -0.3950468, -0.92938966, 0.9549097, 0.8119625, -0.09827121, -1.6820917, 2.2537918, 1.6061562, -1.6614496, -0.6898748, -0.7298267, 0.306313, -0.65373176, 0.2993963, -0.32034644, -0.12563556, 1.4751105, -0.4300541, -1.4357476, -0.5477365, 1.1301636, 1.9408872, -0.5358113, 0.7074716, 0.5665407, 2.2299273, 0.7578367, -0.8634927, -1.0908612, 0.4853919, 0.88917464, 0.17473765, 0.9157595, -0.028933238, 0.2870373, -0.33703837, -0.47779506, 2.1007392, -1.8750576, 0.13741638, 0.94581753, 0.7843519, -0.21389213, 0.7008632, -0.033169623, -2.598468, -0.97367656, 0.28298423, -0.3299811, -0.6989682, -1.3105547, 0.0032470266, 1.0610827, -0.7787282, 1.5894828, 0.105639495, -1.6225517, -0.9812658, 1.7289429, -0.016152928, 0.73713666, -0.008867563, 1.3180345, -0.30255127, 3.3796136, 0.29108533, -2.0276186, 0.34291005, -0.379848, 0.24279688, 0.54965883, -1.8938673, 0.34205624, -0.6351377, 0.68269515, 0.4076469, 0.9852723, 0.35037997],
floatEmbedding: [0.3653241, 0.04759156, -0.5803496, 0.8180379, -0.8393675, 1.080326, -1.683998, -1.270353, 1.873625, -0.4594853, -0.492683, -0.7890862, -0.3505277, -1.699354, 0.7693181, 1.956728, -1.790482, -1.13161, 0.05913593, 0.002898678, -1.953177, 1.999129, -0.3950457, -0.9293886, 0.9549099, 0.8119621, -0.09827112, -1.682092, 2.253792, 1.606155, -1.661449, -0.6898757, -0.7298279, 0.3063133, -0.6537318, 0.2993962, -0.3203471, -0.1256338, 1.47511, -0.4300548, -1.435748, -0.5477355, 1.130164, 1.940887, -0.5358125, 0.7074715, 0.5665413, 2.229927, 0.7578374, -0.8634944, -1.090861, 0.4853912, 0.8891751, 0.1747377, 0.9157588, -0.02893238, 0.2870376, -0.3370381, -0.4777956, 2.10074, -1.875058, 0.1374154, 0.9458161, 0.7843524, -0.2138919, 0.7008632, -0.03317095, -2.598468, -0.9736772, 0.2829854, -0.3299808, -0.6989679, -1.310554, 0.003248722, 1.061082, -0.7787276, 1.589482, 0.1056395, -1.622551, -0.9812658, 1.728942, -0.01615245, 0.7371362, -0.008867697, 1.318034, -0.3025512, 3.379612, 0.2910861, -2.027618, 0.3429114, -0.3798485, 0.2427975, 0.5496578, -1.893867, 0.3420545, -0.6351373, 0.6826952, 0.4076473, 0.9852723, 0.3503794],
quantizedEmbedding: nil,
head: 0,
headName: nil)
static let embeddingResult2: Embedding = Embedding(
floatEmbedding: [0.64565486, 0.116448246, -1.0540192, 0.6861718, -0.31857502, 1.348019, -1.847239, -0.9350123, 2.2461917, -0.43754864, -0.9569025, -0.8150869, -0.19902262, -1.821287, 1.067085, 1.7314306, -1.1303993, -0.89637387, -0.972647, -0.2532016, -2.0174396, 1.5301282, -0.5990305, -0.95686877, 1.0816203, 0.31295553, 0.40090463, -1.3691411, 2.229438, 1.2033331, -1.4095374, -0.8667203, -0.8358657, 0.6628247, -1.0826141, 0.43714273, -0.42172623, 0.28555048, 1.6349199, -0.21735463, -1.4692173, 0.24371623, 1.5557445, 2.0530715, -0.38548565, 1.1879013, -0.23002982, 1.9709659, 1.2193843, -1.1444125, -1.0646181, 0.75855684, 0.7563348, 0.8307041, 0.4176243, -0.08782976, 0.11722673, -0.47372058, -0.7211732, 1.4049535, -2.0380833, -0.12806825, 0.66476125, 0.8927604, 0.4958357, 1.4040443, -0.282444, -2.6350355, -1.2326286, 0.5868405, -0.33381227, -1.2678164, -1.251449, -0.392318, 0.38106433, -0.5975351, 1.7139304, -0.076468684, -0.48719692, -1.3204789, 1.2524556, 0.19933356, 1.2739782, 0.006039286, 0.9298355, 0.010017813, 3.3296566, 0.4261271, -1.724599, 0.25884697, -0.78916174, 0.42680606, 0.3259297, -2.1638749, -0.46910936, -0.43734843, 0.7963945, -0.067255, 0.78012973, 0.35482663],
floatEmbedding: [0.6456553, 0.1164482, -1.054019, 0.6861709, -0.3185744, 1.348018, -1.847239, -0.935012, 2.246192, -0.4375512, -0.956903, -0.8150874, -0.1990242, -1.821287, 1.067085, 1.73143, -1.130399, -0.8963736, -0.9726468, -0.2532014, -2.017439, 1.53013, -0.5990306, -0.9568684, 1.081622, 0.3129545, 0.4009041, -1.369142, 2.229438, 1.203333, -1.409538, -0.8667203, -0.8358657, 0.6628245, -1.082615, 0.4371429, -0.4217262, 0.2855506, 1.634919, -0.2173558, -1.469216, 0.2437164, 1.555744, 2.053072, -0.3854842, 1.187901, -0.2300293, 1.970965, 1.219385, -1.144413, -1.064619, 0.7585568, 0.7563339, 0.8307036, 0.4176229, -0.08783004, 0.1172272, -0.4737191, -0.7211733, 1.404953, -2.038084, -0.1280682, 0.6647619, 0.8927605, 0.4958345, 1.404044, -0.2824433, -2.635035, -1.232629, 0.5868394, -0.3338131, -1.267816, -1.25145, -0.3923185, 0.3810659, -0.597534, 1.71393, -0.07646833, -0.4871983, -1.320478, 1.252456, 0.1993347, 1.273979, 0.006039389, 0.9298355, 0.01001734, 3.329656, 0.4261275, -1.724598, 0.2588451, -0.7891623, 0.4268072, 0.3259311, -2.163875, -0.4691091, -0.4373473, 0.7963935, -0.0672554, 0.7801297, 0.3548266],
quantizedEmbedding: nil,
head: 0,
headName: nil)

static let similarity: Float = 0.9434198
static let similarity: Float = 0.94341993

func textEmbedderWithModelPath(
_ modelPath: String) throws -> TextEmbedderService {
Expand All @@ -59,6 +59,7 @@ final class TextEmbedderTests: XCTestCase {
XCTAssertEqual(
floatEmbedding.floatValue,
expectedFloatEmbedding.floatValue,
accuracy: 1e-3,
String(
format: """
embedding[%d] and expectedEmbedding[%d] are not equal.
Expand Down

0 comments on commit 88792a9

Please sign in to comment.