Documentation ¶
Index ¶
- Constants
- Variables
- func AnchorPlane(height, width, stride int, baseAnchor [][]float64) (*tensor.Dense, error)
- func GenerateAnchorsFPN2(denseAnchor bool, cfgs map[string]Anchor) ([][][]float64, error)
- func NewTritonGRPCClient(serverURL string, grpcOpts []grpc.DialOption) error
- func NewTritonHTTPClient(serverURL string, opts []grpc.DialOption) error
- type ARCFaceRecognitionConfig
- type AgeEstimatorConfig
- type Anchor
- type FaceAlignConfig
- type FaceQualityConfig
- type FaceSelectionConfig
- type ModelConfig
- type Pair
- type RetinaFaceDetection
- type RetinaFaceDetectionConfig
- type TritonGRPCClient
- func (tc *TritonGRPCClient) Disconnect() error
- func (tc *TritonGRPCClient) GetModelConfiguration(modelName, modelVersion string, timeout time.Duration) (*grpc_client.ModelConfigResponse, error)
- func (tc *TritonGRPCClient) GetModelTracingSetting(modelName string, timeout time.Duration) (*grpc_client.TraceSettingResponse, error)
- func (tc *TritonGRPCClient) ModelGRPCInfer(inferInputs []*grpc_client.ModelInferRequest_InferInputTensor, ...) (*grpc_client.ModelInferResponse, error)
- func (tc *TritonGRPCClient) ModelInferStats(modelName, modelVersion string, timeout time.Duration) (*grpc_client.ModelStatisticsResponse, error)
- func (tc *TritonGRPCClient) ModelLoadWithGRPC(repoName, modelName string, ...) (*grpc_client.RepositoryModelLoadResponse, error)
- func (tc *TritonGRPCClient) ModelRepositoryIndex(repoName string, isReady bool, timeout time.Duration) (*grpc_client.RepositoryIndexResponse, error)
- func (tc *TritonGRPCClient) ModelUnloadWithGRPC(repoName, modelName string, ...) (*grpc_client.RepositoryModelUnloadResponse, error)
- func (tc *TritonGRPCClient) ServerAlive(timeout time.Duration) (bool, error)
- func (tc *TritonGRPCClient) ServerMetadata(timeout time.Duration) (*grpc_client.ServerMetadataResponse, error)
- func (tc *TritonGRPCClient) ServerReady(timeout time.Duration) (bool, error)
- func (tc *TritonGRPCClient) SetModelTracingSetting(modelName string, ...) (*grpc_client.TraceSettingResponse, error)
- func (tc *TritonGRPCClient) ShareCUDAMemoryRegister(regionName string, cudaRawHandle []byte, cudaDeviceID int64, byteSize uint64, ...) (*grpc_client.CudaSharedMemoryRegisterResponse, error)
- func (tc *TritonGRPCClient) ShareCUDAMemoryUnRegister(regionName string, timeout time.Duration) (*grpc_client.CudaSharedMemoryUnregisterResponse, error)
- func (tc *TritonGRPCClient) ShareMemoryStatus(isCUDA bool, regionName string, timeout time.Duration) (interface{}, error)
- func (tc *TritonGRPCClient) ShareSystemMemoryRegister(regionName, cpuMemRegionKey string, byteSize, cpuMemOffset uint64, ...) (*grpc_client.SystemSharedMemoryRegisterResponse, error)
- func (tc *TritonGRPCClient) ShareSystemMemoryUnRegister(regionName string, timeout time.Duration) (*grpc_client.SystemSharedMemoryUnregisterResponse, error)
- type TritonHTTPClientService
- type VectorF32
Constants ¶
const ( FaceQualityClassBad = iota FaceQualityClassGood FaceQualityClassWearingMask FaceQualityClassWearingSunglasses )
const ( AgeEstimatorClassRange0_2 = iota AgeEstimatorClassRange3_9 AgeEstimatorClassRange10_19 AgeEstimatorClassRange20_29 AgeEstimatorClassRange30_39 AgeEstimatorClassRange40_49 AgeEstimatorClassRange50_59 AgeEstimatorClassRange60_69 AgeEstimatorClassRange70_100 )
const ( DefaultHTTPClientReadTimeout = 5 * time.Second DefaultHTTPClientWriteTimeout = 5 * time.Second DefaultHTTPClientMaxConnPerHost int = 16384 HTTPPrefix string = "http://" JSONContentType string = "application/json" TritonAPIForModelVersionPrefix string = "/versions/" TritonAPIPrefix string = "/v2" TritonAPIForServerIsLive = TritonAPIPrefix + "/health/live" TritonAPIForServerIsReady = TritonAPIPrefix + "/health/ready" TritonAPIForRepoIndex = TritonAPIPrefix + "/repository/index" TritonAPIForRepoModelPrefix = TritonAPIPrefix + "/repository/models/" TritonAPIForModelPrefix = TritonAPIPrefix + "/models/" TritonAPIForCudaMemoryRegionPrefix = TritonAPIPrefix + "/cudasharememory/region/" TritonAPIForSystemMemoryRegionPrefix = TritonAPIPrefix + "/systemsharememory/region/" )
Variables ¶
var FaceQualityClassMapper = map[int]string{ FaceQualityClassBad: "Bad", FaceQualityClassGood: "Good", FaceQualityClassWearingMask: "WearingMask", FaceQualityClassWearingSunglasses: "WearingSunGlasses", }
Functions ¶
func AnchorPlane ¶
func GenerateAnchorsFPN2 ¶
GenerateAnchorsFPN2 generates anchor (reference) windows by enumerating aspect ratios X scales wrt a reference (0, 0, 15, 15) window.
func NewTritonGRPCClient ¶
func NewTritonGRPCClient(serverURL string, grpcOpts []grpc.DialOption) error
NewTritonGRPCClient inits a new gRPC client
func NewTritonHTTPClient ¶
func NewTritonHTTPClient(serverURL string, opts []grpc.DialOption) error
Types ¶
type ARCFaceRecognitionConfig ¶
type ARCFaceRecognitionConfig struct { // ModelName defines the name of the model to use ModelName string // Timeout defines duration in seconds Timeout int64 ImageSize [2]int32 BatchSize int32 }
func DefaultARCFaceRecognitionConfig ¶
func DefaultARCFaceRecognitionConfig() *ARCFaceRecognitionConfig
type AgeEstimatorConfig ¶
type AgeEstimatorConfig struct { // ModelName defines the name of the model to use ModelName string // Timeout defines duration in seconds Timeout int64 ImageSize [2]int32 BatchSize int32 }
func DefaultAgeEstimatorConfig ¶
func DefaultAgeEstimatorConfig() *AgeEstimatorConfig
type FaceAlignConfig ¶
func DefaultFaceAlignConfig ¶
func DefaultFaceAlignConfig() *FaceAlignConfig
type FaceQualityConfig ¶
type FaceQualityConfig struct { // ModelName defines the name of the model to use ModelName string // Timeout defines duration in seconds Timeout int64 ImageSize [2]int32 BatchSize int32 Threshold float32 }
func DefaultFaceQualityConfig ¶
func DefaultFaceQualityConfig() *FaceQualityConfig
type FaceSelectionConfig ¶
type FaceSelectionConfig struct { MarginCenterLeftRatio float32 MarginCenterRightRatio float32 MarginEdgeRatio float32 MinimumFaceRatio float32 MinimumWidthHeightRatio float32 MaximumWidthHeightRatio float32 }
func DefaultFaceSelectionConfig ¶
func DefaultFaceSelectionConfig() *FaceSelectionConfig
type ModelConfig ¶
type ModelConfig struct { }
type RetinaFaceDetection ¶
type RetinaFaceDetection struct { Config *RetinaFaceDetectionConfig TritonClient *triton_client.TritonGRPCClient // contains filtered or unexported fields }
func NewRetinaFaceDetection ¶
func NewRetinaFaceDetection() (*RetinaFaceDetection, error)
func (*RetinaFaceDetection) Forward ¶
func (rfd *RetinaFaceDetection) Forward(src *tensor.Dense) ([]byte, error)
func (*RetinaFaceDetection) Preprocess ¶
type RetinaFaceDetectionConfig ¶
type RetinaFaceDetectionConfig struct { // ModelName defines the name of the model to use ModelName string // Timeout defines duration in seconds Timeout int64 ImageSize [2]int MaxBatchSize int32 ConfidenceThreshold float32 IOUThreshold float32 }
func DefaultRetinaFaceDetectionConfig ¶
func DefaultRetinaFaceDetectionConfig() *RetinaFaceDetectionConfig
type TritonGRPCClient ¶
type TritonGRPCClient struct {
// contains filtered or unexported fields
}
func GetGRPCInstance ¶
func GetGRPCInstance() *TritonGRPCClient
GetGRPCInstance returns an instance of the Triton gRPC client
func GetHTTPInstance ¶
func GetHTTPInstance() *TritonGRPCClient
func (*TritonGRPCClient) Disconnect ¶
func (tc *TritonGRPCClient) Disconnect() error
func (*TritonGRPCClient) GetModelConfiguration ¶
func (tc *TritonGRPCClient) GetModelConfiguration(modelName, modelVersion string, timeout time.Duration) (*grpc_client.ModelConfigResponse, error)
GetModelConfiguration Get model configuration.
func (*TritonGRPCClient) GetModelTracingSetting ¶
func (tc *TritonGRPCClient) GetModelTracingSetting(modelName string, timeout time.Duration) (*grpc_client.TraceSettingResponse, error)
GetModelTracingSetting get model tracing setting.
func (*TritonGRPCClient) ModelGRPCInfer ¶
func (tc *TritonGRPCClient) ModelGRPCInfer(inferInputs []*grpc_client.ModelInferRequest_InferInputTensor, inferOutputs []*grpc_client.ModelInferRequest_InferRequestedOutputTensor, rawInputs [][]byte, modelName, modelVersion string, timeout time.Duration) (*grpc_client.ModelInferResponse, error)
ModelGRPCInfer Call Triton with GRPC
func (*TritonGRPCClient) ModelInferStats ¶
func (tc *TritonGRPCClient) ModelInferStats(modelName, modelVersion string, timeout time.Duration) (*grpc_client.ModelStatisticsResponse, error)
ModelInferStats Get Model infer stats.
func (*TritonGRPCClient) ModelLoadWithGRPC ¶
func (tc *TritonGRPCClient) ModelLoadWithGRPC(repoName, modelName string, modelConfigBody map[string]*grpc_client.ModelRepositoryParameter, timeout time.Duration) (*grpc_client.RepositoryModelLoadResponse, error)
ModelLoadWithGRPC Load Model with grpc.
func (*TritonGRPCClient) ModelRepositoryIndex ¶
func (tc *TritonGRPCClient) ModelRepositoryIndex(repoName string, isReady bool, timeout time.Duration) (*grpc_client.RepositoryIndexResponse, error)
ModelRepositoryIndex Get model repo index.
func (*TritonGRPCClient) ModelUnloadWithGRPC ¶
func (tc *TritonGRPCClient) ModelUnloadWithGRPC(repoName, modelName string, modelConfigBody map[string]*grpc_client.ModelRepositoryParameter, timeout time.Duration) (*grpc_client.RepositoryModelUnloadResponse, error)
ModelUnloadWithGRPC Unload model with grpc modelConfigBody if not is nil.
func (*TritonGRPCClient) ServerAlive ¶
func (tc *TritonGRPCClient) ServerAlive(timeout time.Duration) (bool, error)
ServerAlive check server is alive.
func (*TritonGRPCClient) ServerMetadata ¶
func (tc *TritonGRPCClient) ServerMetadata(timeout time.Duration) (*grpc_client.ServerMetadataResponse, error)
ServerMetadata Get server metadata.
func (*TritonGRPCClient) ServerReady ¶
func (tc *TritonGRPCClient) ServerReady(timeout time.Duration) (bool, error)
ServerReady check server is ready.
func (*TritonGRPCClient) SetModelTracingSetting ¶
func (tc *TritonGRPCClient) SetModelTracingSetting(modelName string, settingMap map[string]*grpc_client.TraceSettingRequest_SettingValue, timeout time.Duration) (*grpc_client.TraceSettingResponse, error)
SetModelTracingSetting set model tracing setting.
func (*TritonGRPCClient) ShareCUDAMemoryRegister ¶
func (tc *TritonGRPCClient) ShareCUDAMemoryRegister(regionName string, cudaRawHandle []byte, cudaDeviceID int64, byteSize uint64, timeout time.Duration) (*grpc_client.CudaSharedMemoryRegisterResponse, error)
ShareCUDAMemoryRegister cuda share memory register.
func (*TritonGRPCClient) ShareCUDAMemoryUnRegister ¶
func (tc *TritonGRPCClient) ShareCUDAMemoryUnRegister(regionName string, timeout time.Duration) (*grpc_client.CudaSharedMemoryUnregisterResponse, error)
ShareCUDAMemoryUnRegister cuda share memory unregister.
func (*TritonGRPCClient) ShareMemoryStatus ¶
func (tc *TritonGRPCClient) ShareMemoryStatus(isCUDA bool, regionName string, timeout time.Duration) (interface{}, error)
ShareMemoryStatus Get share memory / cuda memory status.
func (*TritonGRPCClient) ShareSystemMemoryRegister ¶
func (tc *TritonGRPCClient) ShareSystemMemoryRegister(regionName, cpuMemRegionKey string, byteSize, cpuMemOffset uint64, timeout time.Duration) (*grpc_client.SystemSharedMemoryRegisterResponse, error)
ShareSystemMemoryRegister system share memory register.
func (*TritonGRPCClient) ShareSystemMemoryUnRegister ¶
func (tc *TritonGRPCClient) ShareSystemMemoryUnRegister(regionName string, timeout time.Duration) (*grpc_client.SystemSharedMemoryUnregisterResponse, error)
ShareSystemMemoryUnRegister system share memory unregister.
type TritonHTTPClientService ¶
type TritonHTTPClientService struct {
// contains filtered or unexported fields
}