Detect API

class mini.apis.api_sence.FaceDetect(is_serial: bool = True, timeout: int = 10)[source]

Bases: mini.apis.base_api.BaseApi

Detect the number of faces api

Parameters
  • is_serial (bool) – Whether to wait for a reply, the default is True

  • timeout (int) – timeout time, must be greater than 0

#FaceDetectResponse.count: the number of faces

#FaceDetectResponse.isSuccess: Is it successful

#FaceDetectResponse.resultCode: Return code

#FaceDetectResponse.commandId

async execute()[source]

Execute instructions for detecting the number of faces

Returns

FaceDetectResponse

class mini.apis.api_sence.FaceAnalysis(is_serial: bool = True, timeout: int = 10)[source]

Bases: mini.apis.base_api.BaseApi

Face analysis api

Analyze gender and age through face recognition

When multiple people are in front of the camera, return to the one with the largest face area

Parameters
  • is_serial (bool) – Whether to wait for a reply, the default is True

  • timeout (int) – timeout

Return example: FaceAnalyzeResponse{“age”:24,”gender”:99,”height”:238,”width”:238}

#FaceAnalyzeResponse.faceInfos: face information array [FaceInfoResponse]

#FaceInfoResponse.gender (int) :[0,100], females less than 50, males greater than 50

#FaceInfoResponse.age: age

#FaceInfoResponse.width: The width of the face in the camera screen

#FaceInfoResponse.height: The height of the face in the camera screen

#FaceAnalyzeResponse.isSuccess: Is it successful, True or False

#FaceAnalyzeResponse.resultCode: Return code

async execute()[source]

Execute face analysis commands

Returns

FaceAnalyzeResponse

class mini.apis.api_sence.ObjectRecogniseType(value)[source]

Bases: enum.Enum

Object recognition type

FRUIT: Fruit

GESTURE: Gesture

FLOWER: Flower

FRUIT = 1
GESTURE = 2
FLOWER = 3
class mini.apis.api_sence.ObjectRecognise(is_serial: bool = True, object_type: mini.apis.api_sence.ObjectRecogniseType = ObjectRecogniseType.FRUIT, timeout: int = 10)[source]

Bases: mini.apis.base_api.BaseApi

Object recognition api

The robot recognizes the corresponding object (fruit/gesture/flower) through the camera

Parameters
  • is_serial (bool) – Whether to wait for a reply, the default is True

  • object_type (ObjectRecogniseType) – Object recognition type, default FRUIT, fruit

  • timeout (int) – timeout

#RecogniseObjectResponse.objects: array of object names [str]

#RecogniseObjectResponse.isSuccess: Is it successful

#RecogniseObjectResponse.resultCode: Return code

async execute()[source]

Execute object recognition commands

Returns

RecogniseObjectResponse

class mini.apis.api_sence.FaceRecognise(is_serial: bool = True, timeout: int = 10)[source]

Bases: mini.apis.base_api.BaseApi

Face recognition api

The robot recognizes all facial information (acquaintances/strangers) through the camera

Parameters
  • is_serial (bool) – Whether to wait for a reply, the default is True

  • timeout (int) – timeout

#FaceRecogniseResponse.faceInfos([FaceInfoResponse]): face information array

#FaceInfoResponse.id: face id

#FaceInfoResponse.name: name, if it is a stranger, the default name is “stranger”

#FaceRecogniseResponse.isSuccess: Is it successful, True or False

#FaceRecogniseResponse.resultCode: Return code

#FaceRecogniseResponse.commandId

async execute()[source]

Execute facial recognition commands

Returns

FaceRecogniseResponse

class mini.apis.api_sence.TakePictureType(value)[source]

Bases: enum.Enum

Type of photo

IMMEDIATELY: Take pictures immediately

FINDFACE: Find faces and take photos

IMMEDIATELY = 0
FINDFACE = 1
class mini.apis.api_sence.TakePicture(is_serial: bool = True, take_picture_type: mini.apis.api_sence.TakePictureType = TakePictureType.IMMEDIATELY)[source]

Bases: mini.apis.base_api.BaseApi

Photo api

Control the robot to take pictures

Parameters
  • is_serial (bool) – Whether to wait for a reply, the default is True

  • take_picture_type (TakePictureType) – Take picture type, default IMMEDIATELY, take picture immediately

#TakePictureResponse.isSuccess: Is it successful, True or False

#TakePictureResponse.code: Return code

#TakePictureResponse.picPath: The storage path of the photo in the robot (sdcard/)

async execute()[source]

Execute photo command

Returns

TakePictureResponse

class mini.apis.api_sence.GetInfraredDistance(is_serial: bool = True)[source]

Bases: mini.apis.base_api.BaseApi

Get infrared distance api

Get the infrared distance of the obstacle closest to the front of the robot

Parameters

is_serial (bool) – Whether to wait for a reply, the default is True

#GetInfraredDistanceResponse.distance: Infrared distance

async execute()[source]

Execute command to obtain infrared distance

Returns

GetInfraredDistanceResponse

class mini.apis.api_sence.GetRegisterFaces(is_serial: bool = True)[source]

Bases: mini.apis.base_api.BaseApi

Get the registered face list api

Obtain the face list data registered in the robot

Parameters

is_serial (bool) – Whether to wait for a reply, the default is True

#GetRegisterFacesResponse.faceInfos([FaceInfoResponse]): face information array

#FaceInfoResponse.id: face id

#FaceInfoResponse.name: name

#GetRegisterFacesResponse.isSuccess: Is it successful, True or False

#GetRegisterFacesResponse.resultCode: Return code

async execute()[source]

Execute the command to get the list of registered faces

Returns

GetRegisterFacesResponse