diff --git a/metal/paddle-mobile-demo/paddle-mobile-demo.xcodeproj/project.pbxproj b/metal/paddle-mobile-demo/paddle-mobile-demo.xcodeproj/project.pbxproj index 10f84f48429fe27a40ae54a2efa774f278d3094a..149956653b91a54cfefc23b8e24b4d5ae8306ee1 100644 --- a/metal/paddle-mobile-demo/paddle-mobile-demo.xcodeproj/project.pbxproj +++ b/metal/paddle-mobile-demo/paddle-mobile-demo.xcodeproj/project.pbxproj @@ -50,6 +50,7 @@ FCEBEC2C20E1391F00C0B14D /* paddle_mobile.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FCEBEC2B20E1391F00C0B14D /* paddle_mobile.framework */; }; FCEBEC2D20E1391F00C0B14D /* paddle_mobile.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FCEBEC2B20E1391F00C0B14D /* paddle_mobile.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; FCF437E8214B6DDB00943429 /* MultiPredictViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FCF437E7214B6DDB00943429 /* MultiPredictViewController.swift */; }; + FCFADE34222F63CC0037DCE8 /* test_big.JPG in Resources */ = {isa = PBXBuildFile; fileRef = FCFADE33222F63CB0037DCE8 /* test_big.JPG */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -118,6 +119,7 @@ FCCED60421D7646E00BE8D5F /* test_image_super */ = {isa = PBXFileReference; lastKnownFileType = file; path = test_image_super; sourceTree = ""; }; FCEBEC2B20E1391F00C0B14D /* paddle_mobile.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = paddle_mobile.framework; sourceTree = BUILT_PRODUCTS_DIR; }; FCF437E7214B6DDB00943429 /* MultiPredictViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiPredictViewController.swift; sourceTree = ""; }; + FCFADE33222F63CB0037DCE8 /* test_big.JPG */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = test_big.JPG; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -196,6 +198,7 @@ FC203FA821CBFDBA00B37166 /* images */ = { isa = PBXGroup; children = ( + FCFADE33222F63CB0037DCE8 /* test_big.JPG */, FC2BFCBF21DF279900C262B2 /* classify-img-output.png */, FC2BFCBD21DF15D900C262B2 /* 123.jpg */, FC2BFCBB21DF0A8600C262B2 /* 00001.jpg */, @@ -389,6 +392,7 @@ FC2BFCBE21DF15D900C262B2 /* 123.jpg in Resources */, FC039B8920E11C560081E9F8 /* Assets.xcassets in Resources */, FC9797C721D609FB00F2FD90 /* synset.txt in Resources */, + FCFADE34222F63CC0037DCE8 /* test_big.JPG in Resources */, FC5E03B221DCE8D90016C137 /* mingren_input_data in Resources */, FC704C1A21D2375300F98BAB /* super_model in Resources */, FC039B8720E11C550081E9F8 /* Main.storyboard in Resources */, diff --git a/metal/paddle-mobile-demo/paddle-mobile-demo/Assets.xcassets/paddle-mobile.imageset/Contents.json b/metal/paddle-mobile-demo/paddle-mobile-demo/Assets.xcassets/paddle-mobile.imageset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..9b6282f9578ef476c0d88b40a7629dd1afd0004e --- /dev/null +++ b/metal/paddle-mobile-demo/paddle-mobile-demo/Assets.xcassets/paddle-mobile.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "paddle-mobile.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/metal/paddle-mobile-demo/paddle-mobile-demo/Assets.xcassets/paddle-mobile.imageset/paddle-mobile.png b/metal/paddle-mobile-demo/paddle-mobile-demo/Assets.xcassets/paddle-mobile.imageset/paddle-mobile.png new file mode 100644 index 0000000000000000000000000000000000000000..7cb32991117140a3016c24bc6d3b96f696facf82 Binary files /dev/null and b/metal/paddle-mobile-demo/paddle-mobile-demo/Assets.xcassets/paddle-mobile.imageset/paddle-mobile.png differ diff --git a/metal/paddle-mobile-demo/paddle-mobile-demo/Base.lproj/Main.storyboard b/metal/paddle-mobile-demo/paddle-mobile-demo/Base.lproj/Main.storyboard index d67403f27299c887922be6ced1fcb6a28bf89fbb..585fc3417d3003686b03bbfcf594d0fde62f4f4a 100644 --- a/metal/paddle-mobile-demo/paddle-mobile-demo/Base.lproj/Main.storyboard +++ b/metal/paddle-mobile-demo/paddle-mobile-demo/Base.lproj/Main.storyboard @@ -155,7 +155,7 @@ - + @@ -320,6 +320,6 @@ - + diff --git a/metal/paddle-mobile-demo/paddle-mobile-demo/ViewController.swift b/metal/paddle-mobile-demo/paddle-mobile-demo/ViewController.swift index 42d6c2b7abb57bcfd3734e70befcb942cf1f5dcd..47fd69a4a5e2b7cd4ab1b2164446018ce3c09207 100644 --- a/metal/paddle-mobile-demo/paddle-mobile-demo/ViewController.swift +++ b/metal/paddle-mobile-demo/paddle-mobile-demo/ViewController.swift @@ -105,7 +105,10 @@ class ViewController: UIViewController { // self?.toPredictTexture = texture // } + let beforeDate = Date.init() runner.getTexture(image: selectImage!.cgImage!) { [weak self] (texture) in + let timeUse = Date.init().timeIntervalSince(beforeDate) + print("get texture time use: \(timeUse)") self?.toPredictTexture = texture } } @@ -178,7 +181,7 @@ class ViewController: UIViewController { modelPickerView.dataSource = self threadPickerView.delegate = self threadPickerView.dataSource = self - if let image = UIImage.init(named: "00001.jpg") { + if let image = UIImage.init(named: "test.jpg") { selectImage = image selectImageView.image = image } else { @@ -249,7 +252,6 @@ extension ViewController: VideoCaptureDelegate{ func predictTexture(texture: MTLTexture){ runner.scaleTexture(input: texture) { (scaledTexture) in self.runner.predict(texture: scaledTexture, completion: { (success, resultHolder) in - // print(resultHolder!.result![0]) resultHolder?.first?.releasePointer() }) } diff --git a/metal/paddle-mobile/paddle-mobile.xcodeproj/project.pbxproj b/metal/paddle-mobile/paddle-mobile.xcodeproj/project.pbxproj index afa580e3cb0be7e5a3f13bf00f9ae355f8e7d9f2..14cfcb3a92158fa9d98d2d2574ccc23eaa3f5477 100644 --- a/metal/paddle-mobile/paddle-mobile.xcodeproj/project.pbxproj +++ b/metal/paddle-mobile/paddle-mobile.xcodeproj/project.pbxproj @@ -758,7 +758,7 @@ "$(inherited)", "$(PROJECT_DIR)/paddle-mobile/CPU", ); - MACH_O_TYPE = mh_dylib; + MACH_O_TYPE = staticlib; MTL_LANGUAGE_REVISION = UseDeploymentTarget; PRODUCT_BUNDLE_IDENTIFIER = "orange.paddle-mobile"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -795,7 +795,7 @@ "$(inherited)", "$(PROJECT_DIR)/paddle-mobile/CPU", ); - MACH_O_TYPE = mh_dylib; + MACH_O_TYPE = staticlib; MTL_LANGUAGE_REVISION = UseDeploymentTarget; PRODUCT_BUNDLE_IDENTIFIER = "orange.paddle-mobile"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; diff --git a/metal/paddle-mobile/paddle-mobile/Src/Framework/Executor.swift b/metal/paddle-mobile/paddle-mobile/Src/Framework/Executor.swift index 9f257200b12edda19085b5414b1cafcc30ea6153..0b6b17205f7450f29f6d5428272e0ca40af4673a 100644 --- a/metal/paddle-mobile/paddle-mobile/Src/Framework/Executor.swift +++ b/metal/paddle-mobile/paddle-mobile/Src/Framework/Executor.swift @@ -120,8 +120,6 @@ public class Executor { return */ - - //输出 op 计算结果 if GlobalConfig.shared.debug { for i in 0..