File tree 1 file changed +3
-3
lines changed
Sources/PerfectTensorFlowDemo
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,10 @@ class LabelImage {
35
35
36
36
public func match( image: Data ) throws -> ( Int , Int ) {
37
37
let g = try TF . Graph ( )
38
- try g. import ( definition: def)
38
+ _ = try g. import ( definition: def)
39
39
let normalized = try constructAndExecuteGraphToNormalizeImage ( g, imageBytes: image)
40
40
let possibilities = try executeInceptionGraph ( g, image: normalized)
41
- guard let m = possibilities. max ( ) , let i = possibilities. index ( of: m) else {
41
+ guard let m = possibilities. max ( ) , let i = possibilities. firstIndex ( of: m) else {
42
42
throw TF . Panic. INVALID
43
43
} //end guard
44
44
return ( i, Int ( m * 100 ) )
166
166
let lines = try fTag. readString ( )
167
167
tags = lines. split ( separator: " \n " ) . map { String ( describing: $0) }
168
168
try TF . Open ( )
169
- inceptionModel = try LabelImage ( Data ( bytes : modelBytes) )
169
+ inceptionModel = try LabelImage ( Data ( modelBytes) )
170
170
print ( " library ready " )
171
171
try HTTPServer . launch ( configurationData: confData)
172
172
} catch {
You can’t perform that action at this time.
0 commit comments