Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Oct 16, 2023
1 parent 44cbb69 commit edc3191
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
8 changes: 5 additions & 3 deletions _example/ssd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ func detect(ctx context.Context, wg *sync.WaitGroup, resultChan chan<- *ssdResul
}
} else {
gocv.Resize(frame, &resized, image.Pt(wanted_width, wanted_height), 0, 0, gocv.InterpolationDefault)
if v, err := resized.DataPtrUint8(); err == nil {
copy(input.UInt8s(), v)
}
//if v, err := resized.DataPtrUint8(); err == nil {
// copy(input.UInt8s(), v)
//}
v := resized.DataPtrUint8()
copy(input.UInt8s(), v)
}
resized.Close()
status := interpreter.Invoke()
Expand Down
8 changes: 5 additions & 3 deletions _example/ssd_edgetpu/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ func detect(ctx context.Context, wg *sync.WaitGroup, resultChan chan<- *ssdResul
}
} else {
gocv.Resize(frame, &resized, image.Pt(wanted_width, wanted_height), 0, 0, gocv.InterpolationDefault)
if v, err := resized.DataPtrUint8(); err == nil {
copy(input.UInt8s(), v)
}
//if v, err := resized.DataPtrUint8(); err == nil {
// copy(input.UInt8s(), v)
//}
v := resized.DataPtrUint8()
copy(input.UInt8s(), v)
}
resized.Close()
status := interpreter.Invoke()
Expand Down
9 changes: 5 additions & 4 deletions _example/ssd_xnnpack/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ func detect(ctx context.Context, wg *sync.WaitGroup, resultChan chan<- *ssdResul
}
} else {
gocv.Resize(frame, &resized, image.Pt(wanted_width, wanted_height), 0, 0, gocv.InterpolationDefault)
if v, err := resized.DataPtrUint8(); err == nil {
copy(input.UInt8s(), v)
}
v := resized.DataPtrUint8()
copy(input.UInt8s(), v)
//v := resized.DataPtrUint8()
//copy(input.UInt8s(), v)
}
resized.Close()
status := interpreter.Invoke()
Expand Down Expand Up @@ -158,7 +159,7 @@ func main() {

options := tflite.NewInterpreterOptions()
options.AddDelegate(xnnpack.New(xnnpack.DelegateOptions{NumThreads: 4}))
//options.SetNumThread(4)
options.SetNumThread(8)
defer options.Delete()

interpreter := tflite.NewInterpreter(model, options)
Expand Down

0 comments on commit edc3191

Please sign in to comment.