提交 60196621 编写于 作者: D dolphin8

Merge branch 'metal' of https://github.com/PaddlePaddle/paddle-mobile into metal

上级 8ea39155 4791da97
develop _release/v2.6.2 gh-pages github/fork/AnBaolei1984/baolei/bitmain github/fork/AnBaolei1984/bitmain github/fork/Cambricon/develop github/fork/DannyIsFunny/Android5 github/fork/DannyIsFunny/Update_MemOpt github/fork/DannyIsFunny/fix_pow github/fork/DannyIsFunny/fix_v26_windows github/fork/GaoWei8/reduce_sum github/fork/GaoWei8/reduce_sum_test_con github/fork/LDOUBLEV/ocr github/fork/Leonardo-Ding/dwh_dev github/fork/MaxwellDing/develop github/fork/MyPandaShaoxiang/fpga_patch github/fork/MyPandaShaoxiang/int8 github/fork/MyPandaShaoxiang/nlp_correct github/fork/MyPandaShaoxiang/opencl_valid github/fork/MyPandaShaoxiang/release/v2.3 github/fork/NHZlX/more_jeston_support github/fork/PaddleLite-EB/merge1.4 github/fork/PaddleLite-EB/new_dev github/fork/Wangzheee/matrix_nms_op github/fork/Xreki/step_rnn/opt_ddim_lite github/fork/cathwong/patch-1 github/fork/cclauss/patch-1 github/fork/chenjiaoAngel/cherry_pic github/fork/chenjiaoAngel/conv_dw_5x5 github/fork/chenjiaoAngel/conv_dw_5x5s2 github/fork/edimetia3d/arm_update_elementwise_op github/fork/edimetia3d/host_deformable_conv github/fork/edimetia3d/matrix_nms_host github/fork/edimetia3d/update_pow_op github/fork/edimetia3d/update_yolo_box github/fork/haozech/develop github/fork/haozech/infershape_chz github/fork/haozech/parl-develop github/fork/jackzhang235/develop github/fork/jameswu2014/develop github/fork/jiansowa/jiansowa/img_nna github/fork/jiweibo/stream_manage github/fork/juncaipeng/add_cast github/fork/lijianshe02/lite-x86 github/fork/qili93/update_sup_model_v26 github/fork/qjing666/develop github/fork/qnqinan/develop github/fork/qnqinan/track-develop github/fork/sangoly/python_compa github/fork/smilejames/develop github/fork/sunsetlh/sunsetlh/xpu_multi_test github/fork/wangqunbaidu/develop github/fork/weihaoji/whj_27 github/fork/weihaoji/xpu_res2net_fusion github/fork/weihaoji/xpu_weihaoji_dev github/fork/xiebaiyuan/fix_leak_opencl github/fork/xiebaiyuan/opencl_depthwised1 github/fork/xiebaiyuan/opencl_softmax github/fork/yanghongtian/yanghongtian/add_ascend310_target_place github/fork/yiicy/computelib github/fork/yongqiangma/bm_card github/fork/yongqiangma/calib github/fork/yongqiangma/copytocpu github/fork/yongqiangma/gpu github/fork/yongqiangma/pass github/fork/yongqiangma/pool github/fork/yongqiangma/priorbox github/fork/yongqiangma/shape github/fork/yongqiangma/split_c github/fork/yongqiangma/trans github/fork/yongqiangma/trans2 github/fork/yongqiangma/workspace github/fork/ysh329/add-cl-kernel-member-for-opencl github/fork/ysh329/add-get-output github/fork/ysh329/cherry-pick-precision-profiler-enhance github/fork/ysh329/fix-opencl-concat github/fork/ysh329/support-int64-copy-from-to-cpu github/fork/zhaoyang-star/enable_prifile_in_tiny_publish github/fork/zhaoyang-star/fix_openc_demo github/fork/zhaoyang-star/patch-1 github/fork/zhupengyang/opt release/v2.0.0 release/v2.0.0-beta1 release/v2.0.0-beta2 release/v2.0.0-rc release/v2.1.0 release/v2.2.0 release/v2.3 release/v2.6 release/v2.6.0 release/v2.7 revert-4368-hongming/test_v26 2.0.0-beta 1.5.0 1.1.1 1.1.0 v2.7-beta v2.6.3-beta2 v2.6.3-beta1 v2.6.2 v2.6.1 v2.6.0 v2.3.0 v2.2.0 v2.1.0 v2.0.0 v2.0.0-rc v2.0.0-beta1 v2.0.0-beta1-prerel v1.0 release/1.4
8 合并请求!3489pull code,!3210[Opencl] fix opencl bug,!3154[arm]resize nnv12 bug,!3074[opencl]add grid_sampler op,!1241fix #1239 release 1.1.0,!1011fix #1010 merge new version metal,!950texture,!854Metal
...@@ -17,11 +17,11 @@ import MetalKit ...@@ -17,11 +17,11 @@ import MetalKit
import paddle_mobile import paddle_mobile
import MetalPerformanceShaders import MetalPerformanceShaders
let platform: Platform = .CPU let platform: Platform = .GPU
let threadSupport = [1] let threadSupport = [1]
let modelHelperMap: [SupportModel : Runner] = [.mobilenet_ssd : Runner.init(inNet: MobileNet_ssd_hand.init(), commandQueue: MetalHelper.shared.queue, inPlatform: platform), let modelHelperMap: [SupportModel : Runner] = [.mobilenet_ssd : Runner.init(inNet: MobileNet_ssd_hand.init(device: MetalHelper.shared.device), commandQueue: MetalHelper.shared.queue, inPlatform: platform),
.genet : Runner.init(inNet: Genet.init(), commandQueue: MetalHelper.shared.queue, inPlatform: platform)] .genet : Runner.init(inNet: Genet.init(device: MetalHelper.shared.device), commandQueue: MetalHelper.shared.queue, inPlatform: platform)]
//, .genet : Genet.init() //, .genet : Genet.init()
//let modelHelperMap: [SupportModel : Net] = [.mobilenet : MobileNet.init(), .mobilenet_ssd : MobileNet_ssd_hand.init()] //let modelHelperMap: [SupportModel : Net] = [.mobilenet : MobileNet.init(), .mobilenet_ssd : MobileNet_ssd_hand.init()]
...@@ -48,6 +48,7 @@ class ViewController: UIViewController { ...@@ -48,6 +48,7 @@ class ViewController: UIViewController {
var toPredictTexture: MTLTexture? var toPredictTexture: MTLTexture?
var runner: Runner { var runner: Runner {
get { get {
return modelHelperMap[modelType] ?! " has no this type " return modelHelperMap[modelType] ?! " has no this type "
} }
......
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
#import "CPUCompute.h" //#import <paddle_mobile/>
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
import Foundation import Foundation
class Genet: Net { public class Genet: Net {
@objc override init(device: MTLDevice) { @objc public override init(device: MTLDevice) {
super.init(device: device) super.init(device: device)
means = [128.0, 128.0, 128.0] means = [128.0, 128.0, 128.0]
scale = 0.017 scale = 0.017
...@@ -34,7 +34,7 @@ class Genet: Net { ...@@ -34,7 +34,7 @@ class Genet: Net {
} }
} }
override func resultStr(res: [Float]) -> String { override public func resultStr(res: [Float]) -> String {
return " \(Array<Float>(res.suffix(10))) ... " return " \(Array<Float>(res.suffix(10))) ... "
} }
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
import Foundation import Foundation
class MobileNet_ssd_hand: Net{ public class MobileNet_ssd_hand: Net{
@objc override init(device: MTLDevice) { @objc public override init(device: MTLDevice) {
super.init(device: device) super.init(device: device)
means = [123.68, 116.78, 103.94] means = [123.68, 116.78, 103.94]
scale = 0.017 scale = 0.017
...@@ -34,7 +34,7 @@ class MobileNet_ssd_hand: Net{ ...@@ -34,7 +34,7 @@ class MobileNet_ssd_hand: Net{
} }
} }
override func resultStr(res: [Float]) -> String { override public func resultStr(res: [Float]) -> String {
return " \(res)" return " \(res)"
} }
......
...@@ -33,7 +33,7 @@ public class Net: NSObject { ...@@ -33,7 +33,7 @@ public class Net: NSObject {
var modelPath: String = "" var modelPath: String = ""
var paramPath: String = "" var paramPath: String = ""
var modelDir: String = "" var modelDir: String = ""
func resultStr(res: [Float]) -> String { public func resultStr(res: [Float]) -> String {
fatalError() fatalError()
} }
func fetchResult(paddleMobileRes: ResultHolder) -> [Float32] { func fetchResult(paddleMobileRes: ResultHolder) -> [Float32] {
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
typedef enum : NSUInteger { typedef enum : NSUInteger {
MobileNet, MobileNetType,
MobileNetSSD, MobileNetSSDType,
Genet, GenetType,
} NetType; } NetType;
@interface ModelConfig: NSObject @interface ModelConfig: NSObject
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部