- libtensorfow 1.x Follow the instruction Install TensorFlow for C
- download tenorflow model graph
- CMU model Google Drive
- mobilenet large model Google Drive
- mobilenet small model Google Drive
- mobilenet thin model Google Drive
go get -u github.com/bububa/openpose
- libjpeg-turbo (use
-tags jpegto build withoutCGo) - On Linux/RPi native Go V4L implementation is used to capture images.
make cvcamera# use native Go V4L implementation is used to capture images
make linux_camerause jpeg build tag to build with native Go image/jpeg instead of libjpeg-turbo
go build -o=./bin/cvcamera -tags=cv4,jpeg ./cmd/cameraUsage of camera:
-bind string
Bind address (default ":56000")
-delay int
Delay between frames, in milliseconds (default 10)
-width float
Frame width (default 640)
-height float
Frame height (default 480)
-index int
Camera index
-model string
mode path
import (
"github.com/bububa/openpose"
)
funcmain() {
t:=openpose.NewPoseEstimator(modelPath, openpose.MobileNet)
wd, _:=os.Getwd()
img, err:=loadImage("./golf.jpg")
iferr!=nil {
log.Fatalln(err)
}
modelSize:=openpose.ModelSizeFastersharpenSigma:=0.0t.SetSharpenSigma(sharpenSigma)
humans, err:=t.Estimate(img, modelSize)
iferr!=nil {
log.Fatalln(err)
}
outImg:=openpose.DrawHumans(img, humans, 2)
saveImage(outImg, "./out/jpg")
}