mirror of
https://github.com/bububa/openvision.git
synced 2026-04-22 23:27:13 +08:00
45 lines
879 B
Go
45 lines
879 B
Go
package detecter
|
|
|
|
/*
|
|
#include <stdlib.h>
|
|
#include <stdbool.h>
|
|
#include "openvision/pose/detecter.h"
|
|
*/
|
|
import "C"
|
|
import (
|
|
"github.com/bububa/openvision/go/common"
|
|
"github.com/bububa/openvision/go/pose"
|
|
)
|
|
|
|
// Ultralight represents utralight detecter
|
|
type Ultralight struct {
|
|
d C.IDetecter
|
|
}
|
|
|
|
// NewUltralight returns a new Utralight
|
|
func NewUltralight() *Ultralight {
|
|
return &Ultralight{
|
|
d: C.new_ultralight(),
|
|
}
|
|
}
|
|
|
|
// Destroy free detecter
|
|
func (d *Ultralight) Destroy() {
|
|
Destroy(d)
|
|
}
|
|
|
|
// Handler returns C.IDetecter
|
|
func (d *Ultralight) Handler() C.IDetecter {
|
|
return d.d
|
|
}
|
|
|
|
// LoadModel load model for detecter
|
|
func (d *Ultralight) LoadModel(modelPath string) error {
|
|
return LoadModel(d, modelPath)
|
|
}
|
|
|
|
// ExtractKeypoints implement Detecter interface
|
|
func (d *Ultralight) ExtractKeypoints(img *common.Image) ([]pose.ROI, error) {
|
|
return ExtractKeypoints(d, img)
|
|
}
|