File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Sources/PerfectTensorFlowDemo Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,10 @@ class LabelImage {
3535
3636 public func match( image: Data ) throws -> ( Int , Int ) {
3737 let g = try TF . Graph ( )
38- try g. import ( definition: def)
38+ _ = try g. import ( definition: def)
3939 let normalized = try constructAndExecuteGraphToNormalizeImage ( g, imageBytes: image)
4040 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 {
4242 throw TF . Panic. INVALID
4343 } //end guard
4444 return ( i, Int ( m * 100 ) )
166166 let lines = try fTag. readString ( )
167167 tags = lines. split ( separator: " \n " ) . map { String ( describing: $0) }
168168 try TF . Open ( )
169- inceptionModel = try LabelImage ( Data ( bytes : modelBytes) )
169+ inceptionModel = try LabelImage ( Data ( modelBytes) )
170170 print ( " library ready " )
171171 try HTTPServer . launch ( configurationData: confData)
172172 } catch {
You can’t perform that action at this time.
0 commit comments