From bb2cae521c98a71195d37dfa4594c1c740bd08ce Mon Sep 17 00:00:00 2001 From: liuruilong Date: Wed, 6 Mar 2019 16:22:49 +0800 Subject: [PATCH] format files --- .../project.pbxproj | 4 ++++ .../paddle-mobile.imageset/Contents.json | 21 ++++++++++++++++++ .../paddle-mobile.imageset/paddle-mobile.png | Bin 0 -> 5331 bytes .../Base.lproj/Main.storyboard | 4 ++-- .../paddle-mobile-demo/ViewController.swift | 6 +++-- .../paddle-mobile.xcodeproj/project.pbxproj | 4 ++-- .../Src/Framework/Executor.swift | 2 -- 7 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 metal/paddle-mobile-demo/paddle-mobile-demo/Assets.xcassets/paddle-mobile.imageset/Contents.json create mode 100644 metal/paddle-mobile-demo/paddle-mobile-demo/Assets.xcassets/paddle-mobile.imageset/paddle-mobile.png 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 10f84f4842..149956653b 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 0000000000..9b6282f957 --- /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 GIT binary patch literal 5331 zcmc&&`9GBH_aFOO*^;b7$s;kc?}V(02O-1Qm%+@)SQ}YmP?nHwWJ{LBkX?psS%ws4 z>|{;0#+qgLjGpKFJfH9D`v-jQAMV$=u5-@&EU$B&bKQ5W$z9!ZjNFU>0N|Xyp0+6f zK#@$Q)#z!-Zwj#&6952X6;w;hL|;n_XySu#g?hOF0D7^{)9B3ES2(*{Gxb3=8h@B- zA|iY#^{^Big^}?|00!a5k3V%r-?(1MX|And`}rO#4S}-98t~_hm;y%v&3%qkzbfGM z>&ox1G(XyG-v4+sc;Fhcy!7z}N@V-RHeJ}(V{wk6_db9^Mk#H<7XGIt-??Z{6vF__ zdVmWtUI|v;`FVNiO$KaED-!oVd6@_FU-Kj#ZJyrSnhd;22l#_)QK2FuC2mX9xAwu~ z0%kyxmrMobxnTCf_0)^E-6Q`H$X)1!!gCiIpdpga**WK8wab&mcxfrc zSa-fS#y(C;3A?bj0(}y^{FoD7%|`O zgmkuF<`hBG_N(E|xG(8z7OED0A(Zr|L|Amn=t*0(U&Jfv2ow7#{^|F$qm)blskv(D zYv`YM*q35{#WpiXD>otMF5jT&4wmTXYfol)zo3?Vf|(gE-n*pTD#ru%=Ky%3WUQ2V z48^EtCoKWa@&g~9p3f7X1mx{f=?e8_CpcU)w(ia0KYP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_Y9xqpq4vWZ7l}gW<47qKzp`XUGOzdTEX7~J{3TxFDknBTk`$YpXzx7 X+?9HAS>(Tz0D%7OyV@0+_7VR9o6zuF literal 0 HcmV?d00001 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 d67403f272..585fc3417d 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 42d6c2b7ab..47fd69a4a5 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 afa580e3cb..14cfcb3a92 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 9f257200b1..0b6b17205f 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..