Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
d522cd52
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d522cd52
编写于
9月 07, 2018
作者:
R
Ruilong Liu
提交者:
GitHub
9月 07, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #929 from codeWorm2015/metal
add objc interface
上级
ca3045cc
c3c6fc32
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
27 deletion
+16
-27
metal/paddle-mobile/paddle-mobile.xcodeproj/project.pbxproj
metal/paddle-mobile/paddle-mobile.xcodeproj/project.pbxproj
+4
-0
metal/paddle-mobile/paddle-mobile/Genet.swift
metal/paddle-mobile/paddle-mobile/Genet.swift
+12
-23
metal/paddle-mobile/paddle-mobile/MobileNetSSD.swift
metal/paddle-mobile/paddle-mobile/MobileNetSSD.swift
+0
-4
未找到文件。
metal/paddle-mobile/paddle-mobile.xcodeproj/project.pbxproj
浏览文件 @
d522cd52
...
...
@@ -46,6 +46,7 @@
FC292C81214255BD00CF622F
/* CPUCompute.mm in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FC292C7C214255BC00CF622F
/* CPUCompute.mm */
;
};
FC292C82214255BD00CF622F
/* MobileNetSSD.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FC292C7E214255BC00CF622F
/* MobileNetSSD.swift */
;
};
FC292C85214257CB00CF622F
/* CPUCompute.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FC292C7D214255BC00CF622F
/* CPUCompute.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
FC292C872142624800CF622F
/* Genet.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FC292C862142624800CF622F
/* Genet.swift */
;
};
FC3602CC2108819F00FACB58
/* PaddleMobileUnitTest.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FC3602CB2108819F00FACB58
/* PaddleMobileUnitTest.swift */
;
};
FC4CB74920F0B954007C0C6D
/* ConvKernel.metal in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FC4CB74820F0B954007C0C6D
/* ConvKernel.metal */
;
};
FC4CB74B20F12C30007C0C6D
/* ProgramOptimize.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FC4CB74A20F12C30007C0C6D
/* ProgramOptimize.swift */
;
};
...
...
@@ -147,6 +148,7 @@
FC292C7C214255BC00CF622F
/* CPUCompute.mm */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.cpp.objcpp
;
path
=
CPUCompute.mm
;
sourceTree
=
"<group>"
;
};
FC292C7D214255BC00CF622F
/* CPUCompute.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
CPUCompute.h
;
sourceTree
=
"<group>"
;
};
FC292C7E214255BC00CF622F
/* MobileNetSSD.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MobileNetSSD.swift
;
sourceTree
=
"<group>"
;
};
FC292C862142624800CF622F
/* Genet.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Genet.swift
;
sourceTree
=
"<group>"
;
};
FC3602CB2108819F00FACB58
/* PaddleMobileUnitTest.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PaddleMobileUnitTest.swift
;
sourceTree
=
"<group>"
;
};
FC4CB74820F0B954007C0C6D
/* ConvKernel.metal */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.metal
;
path
=
ConvKernel.metal
;
sourceTree
=
"<group>"
;
};
FC4CB74A20F12C30007C0C6D
/* ProgramOptimize.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ProgramOptimize.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -256,6 +258,7 @@
FC039B6C20E11C3C0081E9F8
/* paddle-mobile */
=
{
isa
=
PBXGroup
;
children
=
(
FC292C862142624800CF622F
/* Genet.swift */
,
FC292C7E214255BC00CF622F
/* MobileNetSSD.swift */
,
FC292C7C214255BC00CF622F
/* CPUCompute.mm */
,
FC292C7D214255BC00CF622F
/* CPUCompute.h */
,
...
...
@@ -581,6 +584,7 @@
FC039BAC20E11CBC0081E9F8
/* BatchNormOp.swift in Sources */
,
FCBCCC6F2123097100D94F7E
/* MulticlassNMSOp.swift in Sources */
,
FC039BBC20E11CC20081E9F8
/* VarDesc.swift in Sources */
,
FC292C872142624800CF622F
/* Genet.swift in Sources */
,
4AF928822135673D005B6C3A
/* Concat.metal in Sources */
,
FCBCCC632122FCC000D94F7E
/* TransposeKernel.swift in Sources */
,
FCBCCC71212309A700D94F7E
/* MulticlassNMSKernel.swift in Sources */
,
...
...
metal/paddle-mobile/paddle-mobile/Genet.swift
浏览文件 @
d522cd52
...
...
@@ -13,17 +13,20 @@
limitations under the License. */
import
Foundation
import
paddle_mobile
class
Genet
:
Net
{
// var means: [Float] = [128.0, 128.0, 128.0]
//
// var scale: Float = 0.017
//
// let except: Int = 0
//
@objc
override
init
(
device
:
MTLDevice
)
{
super
.
init
(
device
:
device
)
means
=
[
128.0
,
128.0
,
128.0
]
scale
=
0.017
except
=
0
modelPath
=
Bundle
.
main
.
path
(
forResource
:
"genet_model"
,
ofType
:
nil
)
?
!
"model null"
paramPath
=
Bundle
.
main
.
path
(
forResource
:
"genet_params"
,
ofType
:
nil
)
?
!
"para null"
modelDir
=
""
preprocessKernel
=
GenetPreProccess
.
init
(
device
:
device
)
dim
=
(
n
:
1
,
h
:
128
,
w
:
128
,
c
:
3
)
}
class
GenetPreProccess
:
CusomKernel
{
init
(
device
:
MTLDevice
)
{
let
s
=
CusomKernel
.
Shape
.
init
(
inWidth
:
128
,
inHeight
:
128
,
inChannel
:
3
)
...
...
@@ -32,21 +35,7 @@ class Genet: Net {
}
override
func
resultStr
(
res
:
[
Float
])
->
String
{
return
"
\(
Array
<
Float
>
(
res
.
suffix
(
10
))
)
... "
}
// var preprocessKernel: CusomKernel
// let dim = (n: 1, h: 128, w: 128, c: 3)
// let modelPath: String
// let paramPath: String
// let modelDir: String
init
(
device
:
MTLDevice
)
{
modelPath
=
Bundle
.
main
.
path
(
forResource
:
"genet_model"
,
ofType
:
nil
)
?
!
"model null"
paramPath
=
Bundle
.
main
.
path
(
forResource
:
"genet_params"
,
ofType
:
nil
)
?
!
"para null"
modelDir
=
""
preprocessKernel
=
GenetPreProccess
.
init
(
device
:
device
)
}
}
metal/paddle-mobile/paddle-mobile/MobileNetSSD.swift
浏览文件 @
d522cd52
...
...
@@ -13,12 +13,8 @@
limitations under the License. */
import
Foundation
//import
//import pad
class
MobileNet_ssd_hand
:
Net
{
@objc
override
init
(
device
:
MTLDevice
)
{
super
.
init
(
device
:
device
)
means
=
[
123.68
,
116.78
,
103.94
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录