search4faces

package module
v0.0.2-0...-d9807f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2024 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

Module for access to API search4faces.com

Original documention by API: https://search4faces.com/en/api.html

Index

Constants

View Source
const (
	ApiURL                   = "https://search4faces.com/api/json-rpc/v1"
	Search4FacesApiApiKeyEnv = "SEARCH4FACES_API_KEY"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	APIKey string
	APIURL string
}

func NewSearch4FacesApi

func NewSearch4FacesApi() (*API, error)

func (*API) DetectFaces

func (api *API) DetectFaces()

func (*API) DetectFacesFiles

func (api *API) DetectFacesFiles(filename string) error

func (*API) RateLimit

func (api *API) RateLimit() error

func (*API) SearchFace

func (api *API) SearchFace()

type DetectFaceItem

type DetectFaceItem struct {
	X      int `json:"x"`
	Y      int `json:"y"`
	Width  int `json:"width"`
	Height int `json:"height"`
	Lm1X   int `json:"lm1_x"`
	Lm1Y   int `json:"lm1_y"`
	Lm2X   int `json:"lm2_x"`
	Lm2Y   int `json:"lm2_y"`
	Lm3X   int `json:"lm3_x"`
	Lm3Y   int `json:"lm3_y"`
	Lm4X   int `json:"lm4_x"`
	Lm4Y   int `json:"lm4_y"`
	Lm5X   int `json:"lm5_x"`
	Lm5Y   int `json:"lm5_y"`
}

type DetectRequestParams

type DetectRequestParams struct {
	Image string `json:"image"`
}

type DetectResponse

type DetectResponse struct {
	Image string           `json:"image"`
	Faces []DetectFaceItem `json:"faces"`
}

type JSONRPCRequst

type JSONRPCRequst struct {
	Jsonrpc string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Id      string      `json:"id"`
	Params  interface{} `json:"params"`
}

type JSONRPCResponse

type JSONRPCResponse struct {
	Jsonrpc string      `json:"jsonrpc"`
	Result  interface{} `json:"result"`
	ID      string      `json:"id"`
}

type Profile

type Profile struct {
	Score       string `json:"score"`
	Face        string `json:"face"`
	Profile     string `json:"profile"`
	Photo       string `json:"photo"`
	PhotoX      int    `json:"photo_x"`
	PhotoY      int    `json:"photo_y"`
	PhotoWidth  int    `json:"photo_width"`
	PhotoHeight int    `json:"photo_height"`
	Source      string `json:"source"`
	Age         int    `json:"age"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
	MaidenName  string `json:"maiden_name"`
	City        string `json:"city"`
	Country     string `json:"country"`
}

type RateResult

type RateResult struct {
	Apikey    string   `json:"apikey"`
	Limit     int      `json:"limit"`
	Remaining int      `json:"remaining"`
	Enddate   string   `json:"enddate"`
	Speed     int      `json:"speed"`
	Allowed   []string `json:"allowed"`
	Disabled  string   `json:"disabled"`
}

type SearchRequestParams

type SearchRequestParams struct {
	Image string `json:"image"`
	Face  struct {
		X      int `json:"x"`
		Y      int `json:"y"`
		Width  int `json:"width"`
		Height int `json:"height"`
		Lm1X   int `json:"lm1_x"`
		Lm1Y   int `json:"lm1_y"`
		Lm2X   int `json:"lm2_x"`
		Lm2Y   int `json:"lm2_y"`
		Lm3X   int `json:"lm3_x"`
		Lm3Y   int `json:"lm3_y"`
		Lm4X   int `json:"lm4_x"`
		Lm4Y   int `json:"lm4_y"`
		Lm5X   int `json:"lm5_x"`
		Lm5Y   int `json:"lm5_y"`
	} `json:"face"`
	Source  string `json:"source"`
	Hidden  bool   `json:"hidden"`
	Results int    `json:"results"`
	Lang    string `json:"lang"`
}

type SearchResponse

type SearchResponse struct {
	Profiles []Profile `json:"profiles"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL