mirror of
https://github.com/bububa/openvision.git
synced 2025-10-05 05:36:50 +08:00
46 lines
832 B
Go
46 lines
832 B
Go
package detecter
|
|
|
|
/*
|
|
#include <stdlib.h>
|
|
#include <stdbool.h>
|
|
#include "openvision/hand/detecter.h"
|
|
*/
|
|
import "C"
|
|
import (
|
|
"unsafe"
|
|
|
|
"github.com/bububa/openvision/go/common"
|
|
)
|
|
|
|
// Yolox represents yolox detecter
|
|
type Yolox struct {
|
|
d C.IHandDetecter
|
|
}
|
|
|
|
// NewYolox returns a new Yolox
|
|
func NewYolox() *Yolox {
|
|
return &Yolox{
|
|
d: C.new_yolox(),
|
|
}
|
|
}
|
|
|
|
// Destroy free detecter
|
|
func (d *Yolox) Destroy() {
|
|
common.DestroyEstimator(d)
|
|
}
|
|
|
|
// Pointer implenment Estimator interface
|
|
func (d *Yolox) Pointer() unsafe.Pointer {
|
|
return unsafe.Pointer(d.d)
|
|
}
|
|
|
|
// LoadModel load model for detecter
|
|
func (d *Yolox) LoadModel(modelPath string) error {
|
|
return common.EstimatorLoadModel(d, modelPath)
|
|
}
|
|
|
|
// Detect implement Detecter interface
|
|
func (d *Yolox) Detect(img *common.Image) ([]common.ObjectInfo, error) {
|
|
return Detect(d, img)
|
|
}
|