ailia  1.3.0.0
Public Member Functions | Protected Member Functions | List of all members
AiliaPoseEstimatorModel Class Reference
Inheritance diagram for AiliaPoseEstimatorModel:
Inheritance graph
[legend]
Collaboration diagram for AiliaPoseEstimatorModel:
Collaboration graph
[legend]

Public Member Functions

bool Settings (uint set_algorithm)
 Model setting. More...
 
override bool OpenFile (string prototxt, string model_path)
 Create a network object from a model file. More...
 
override bool OpenEx (Ailia.ailiaFileCallback callback, IntPtr arg1, IntPtr arg2)
 Creates a network object from a file callback. More...
 
override bool OpenMem (byte[] prototxt_buf, byte[] model_buf)
 Creates network objects from memory. More...
 
bool SetThreshold (float threshold)
 Sets the detection threshold. More...
 
List< AiliaPoseEstimator.AILIAPoseEstimatorObjectPoseComputePoseFromImage (Color32 [] image, int image_width, int image_height)
 Skeletal detection is performed from images. More...
 
List< AiliaPoseEstimator.AILIAPoseEstimatorObjectPoseComputePoseFromImageB2T (Color32 [] image, int image_width, int image_height)
 Skeletal detection is performed from an bottom-top image. More...
 
List< AiliaPoseEstimator.AILIAPoseEstimatorObjectUpPoseComputeUpPoseFromImage (Color32[] image, int image_width, int image_height)
 Detection is performed from the image. More...
 
List< AiliaPoseEstimator.AILIAPoseEstimatorObjectUpPoseComputeUpPoseFromImageB2T (Color32[] image, int image_width, int image_height)
 Detection is performed from an upside-down image. More...
 
List< AiliaPoseEstimator.AILIAPoseEstimatorObjectFaceComputeFaceFromImage (Color32 [] image, int image_width, int image_height)
 Performs facial feature point detection from images. More...
 
List< AiliaPoseEstimator.AILIAPoseEstimatorObjectFaceComputeFaceFromImageB2T (Color32 [] image, int image_width, int image_height)
 Detects facial feature points from bottom-top images. More...
 
List< AiliaPoseEstimator.AILIAPoseEstimatorObjectHandComputeHandFromImage (Color32 [] image, int image_width, int image_height)
 Detects hands from an image. More...
 
List< AiliaPoseEstimator.AILIAPoseEstimatorObjectHandComputeHandFromImageB2T (Color32 [] image, int image_width, int image_height)
 Detects hands from an bottom-top image. More...
 
override void Close ()
 Destroy the detection object. More...
 
override void Dispose ()
 Release resources. More...
 
- Public Member Functions inherited from AiliaModel
bool Environment (int type)
 Selects the specified type of calculation environment. More...
 
string EnvironmentName ()
 Displays the name of the selected environment. More...
 
int GetEnvironmentCount ()
 Get the number of available computing environments (CPU, GPU). More...
 
Ailia.AILIAEnvironment GetEnvironment (int idx)
 Obtains the computing environment for the specified index. More...
 
bool SelectEnvironment (int idx)
 Select the calculation environment. More...
 
Ailia.AILIAEnvironment GetSelectedEnvironment ()
 Retrieves the selected computing environment. More...
 
void SetMemoryMode (uint set_memory_mode)
 Sets the memory mode. More...
 
void DisableLayerFusion ()
 Disables speedup due to layer fusion. More...
 
bool Predict (float[] output_data, float[] input_data)
 Perform inference and obtain inference results. More...
 
Ailia.AILIAShape GetInputShape ()
 
uint [] GetInputShapeND ()
 Obtains the shape of the input data at the time of inference. More...
 
bool SetInputShape (Ailia.AILIAShape shape)
 Sets the shape of the input data during inference. More...
 
bool SetInputShapeND (uint[] shape, int dim)
 Change the shape of the input data during inference. More...
 
Ailia.AILIAShape GetOutputShape ()
 Obtains the shape of the output data during inference. More...
 
uint [] GetOutputShapeND ()
 Obtains the shape of the output data during inference. More...
 
Ailia.AILIAShape GetBlobShape (string layer_name)
 Obtains the shape (layer format) of the internal data (Blob) at the time of inference. (Obsolete) More...
 
int FindBlobIndexByName (string name)
 Look up and retrieve the index of the internal data (Blob) at the time of inference by name. More...
 
Ailia.AILIAShape GetBlobShape (uint idx)
 Obtains the shape (layer format) of the internal data (Blob) at the time of inference. More...
 
Ailia.AILIAShape GetBlobShape (int idx)
 
bool GetBlobData (float[] output_data, uint idx)
 Obtains internal data (Blob) at the time of inference. More...
 
bool GetBlobData (float[] output_data, int idx)
 
bool SetInputBlobData (float[] input_data, uint idx)
 Set input data to the specified Blob. More...
 
bool SetInputBlobData (float[] input_data, int idx)
 
bool SetInputBlobShape (Ailia.AILIAShape shape, uint idx)
 Sets the format of the specified input data (Blob). (4 dimensions or less) More...
 
bool SetInputBlobShape (Ailia.AILIAShape shape, int idx)
 
bool SetInputBlobShapeND (uint[] shape, uint dim, uint idx)
 Sets the format of the input data (Blob). (5D or more) More...
 
bool SetInputBlobShapeND (uint[] shape, int dim, int idx)
 
uint [] GetInputBlobList ()
 Obtains a list of the indices of the input data (Blob). More...
 
uint [] GetOutputBlobList ()
 Obtains a list of indices of the output data (Blob). More...
 
bool CopyBlobData (uint dst_blob_idx, uint src_blob_idx, AiliaModel src_model=null)
 Perform copies between blobs that specified. More...
 
bool Update ()
 Inference is performed with pre-populated data. More...
 
string GetStatusString (int status)
 Returns a string corresponding to the status code. More...
 
string GetErrorDetail ()
 Returns error details. More...
 
bool SetProfileMode (uint profile_mode)
 Enable profile mode. More...
 
string GetSummary ()
 Obtain network information and profile results. More...
 

Protected Member Functions

override void Dispose (bool disposing)
 

Additional Inherited Members

- Protected Attributes inherited from AiliaModel
IntPtr ailia = IntPtr.Zero
 
bool logging = true
 
- Properties inherited from AiliaModel
int Status [get, protected set]
 Status code Get the library status code. More...
 

Member Function Documentation

◆ Close()

override void AiliaPoseEstimatorModel.Close ( )
inlinevirtual

Destroy the detection object.

Returns
Return nothing.

Destroys the detection object.

Reimplemented from AiliaModel.

723  {
724  if(ailia_pose_estimator!=IntPtr.Zero){
725  AiliaPoseEstimator.ailiaDestroyPoseEstimator(ailia_pose_estimator);
726  ailia_pose_estimator=IntPtr.Zero;
727  }
728  base.Close();
729  }
static void ailiaDestroyPoseEstimator(IntPtr pose_estimator)
Destroy the detection object.
Definition: AiliaPoseEstimator.cs:20

◆ ComputeFaceFromImage()

List<AiliaPoseEstimator.AILIAPoseEstimatorObjectFace> AiliaPoseEstimatorModel.ComputeFaceFromImage ( Color32 []  image,
int  image_width,
int  image_height 
)
inline

Performs facial feature point detection from images.

Parameters
imageImage to be detected
image_widthImage width
image_heightImage height
Returns
List of detection results

Performs facial feature point detection from an image and returns a list of results.

487  {
488  return ComputeFaceFromImageWithFormat(image,image_width,image_height,AiliaFormat.AILIA_IMAGE_FORMAT_RGBA);
489  }
Definition: AiliaFormat.cs:20
const Int32 AILIA_IMAGE_FORMAT_RGBA
Definition: AiliaFormat.cs:33

◆ ComputeFaceFromImageB2T()

List<AiliaPoseEstimator.AILIAPoseEstimatorObjectFace> AiliaPoseEstimatorModel.ComputeFaceFromImageB2T ( Color32 []  image,
int  image_width,
int  image_height 
)
inline

Detects facial feature points from bottom-top images.

Parameters
imageImage to be detected
image_widthImage width
image_heightImage height
Returns
List of detection results

Performs facial feature point detection from an image and returns a list of results.

513  {
514  return ComputeFaceFromImageWithFormat(image,image_width,image_height,AiliaFormat.AILIA_IMAGE_FORMAT_RGBA_B2T);
515  }
Definition: AiliaFormat.cs:20
const Int32 AILIA_IMAGE_FORMAT_RGBA_B2T
Definition: AiliaFormat.cs:50

◆ ComputeHandFromImage()

List<AiliaPoseEstimator.AILIAPoseEstimatorObjectHand> AiliaPoseEstimatorModel.ComputeHandFromImage ( Color32 []  image,
int  image_width,
int  image_height 
)
inline

Detects hands from an image.

Parameters
imageImage to be detected
image_widthImage width
image_heightImage height
Returns
List of detection results

Detects hands from an image and returns a list of results.

608  {
609  return ComputeHandFromImageWithFormat(image,image_width,image_height,AiliaFormat.AILIA_IMAGE_FORMAT_RGBA);
610  }
Definition: AiliaFormat.cs:20
const Int32 AILIA_IMAGE_FORMAT_RGBA
Definition: AiliaFormat.cs:33

◆ ComputeHandFromImageB2T()

List<AiliaPoseEstimator.AILIAPoseEstimatorObjectHand> AiliaPoseEstimatorModel.ComputeHandFromImageB2T ( Color32 []  image,
int  image_width,
int  image_height 
)
inline

Detects hands from an bottom-top image.

Parameters
imageImage to be detected
image_widthImage width
image_heightImage height
Returns
List of detection results

Detects hands from an image and returns a list of results.

634  {
635  return ComputeHandFromImageWithFormat(image,image_width,image_height,AiliaFormat.AILIA_IMAGE_FORMAT_RGBA_B2T);
636  }
Definition: AiliaFormat.cs:20
const Int32 AILIA_IMAGE_FORMAT_RGBA_B2T
Definition: AiliaFormat.cs:50

◆ ComputePoseFromImage()

List<AiliaPoseEstimator.AILIAPoseEstimatorObjectPose> AiliaPoseEstimatorModel.ComputePoseFromImage ( Color32 []  image,
int  image_width,
int  image_height 
)
inline

Skeletal detection is performed from images.

Parameters
imageImage to be detected
image_widthImage width
image_heightImage height
Returns
List of detection results

Performs skeletal detection from an image and returns a list of detection results.

226  {
227  return ComputePoseFromImageWithFormat(image,image_width,image_height,AiliaFormat.AILIA_IMAGE_FORMAT_RGBA);
228  }
Definition: AiliaFormat.cs:20
const Int32 AILIA_IMAGE_FORMAT_RGBA
Definition: AiliaFormat.cs:33

◆ ComputePoseFromImageB2T()

List<AiliaPoseEstimator.AILIAPoseEstimatorObjectPose> AiliaPoseEstimatorModel.ComputePoseFromImageB2T ( Color32 []  image,
int  image_width,
int  image_height 
)
inline

Skeletal detection is performed from an bottom-top image.

Parameters
imageImage to be detected
image_widthImage width
image_heightImage height
Returns
List of detection results

Performs skeletal detection from an image and returns a list of detection results.

252  {
253  return ComputePoseFromImageWithFormat(image,image_width,image_height,AiliaFormat.AILIA_IMAGE_FORMAT_RGBA_B2T);
254  }
Definition: AiliaFormat.cs:20
const Int32 AILIA_IMAGE_FORMAT_RGBA_B2T
Definition: AiliaFormat.cs:50

◆ ComputeUpPoseFromImage()

List<AiliaPoseEstimator.AILIAPoseEstimatorObjectUpPose> AiliaPoseEstimatorModel.ComputeUpPoseFromImage ( Color32 []  image,
int  image_width,
int  image_height 
)
inline

Detection is performed from the image.

Parameters
imageImage to be detected
image_widthImage width
image_heightImage Height
Returns
List of detection results

Performs upper body skeleton detection from an image and returns a list of detection results.

350  {
351  return ComputeUpPoseFromImageWithFormat(image, image_width, image_height, AiliaFormat.AILIA_IMAGE_FORMAT_RGBA);
352  }
Definition: AiliaFormat.cs:20
const Int32 AILIA_IMAGE_FORMAT_RGBA
Definition: AiliaFormat.cs:33

◆ ComputeUpPoseFromImageB2T()

List<AiliaPoseEstimator.AILIAPoseEstimatorObjectUpPose> AiliaPoseEstimatorModel.ComputeUpPoseFromImageB2T ( Color32 []  image,
int  image_width,
int  image_height 
)
inline

Detection is performed from an upside-down image.

Parameters
imageImage to be detected
image_widthImage width
image_heightImage height
Returns
List of detection results

Performs upper body skeleton detection from an image and returns a list of detection results.

377  {
378  return ComputeUpPoseFromImageWithFormat(image, image_width, image_height, AiliaFormat.AILIA_IMAGE_FORMAT_RGBA_B2T);
379  }
Definition: AiliaFormat.cs:20
const Int32 AILIA_IMAGE_FORMAT_RGBA_B2T
Definition: AiliaFormat.cs:50

◆ Dispose() [1/2]

override void AiliaPoseEstimatorModel.Dispose ( )
inlinevirtual

Release resources.

Reimplemented from AiliaModel.

739  {
740  Dispose(true);
741  }
override void Dispose()
Release resources.
Definition: AiliaPoseEstimatorModel.cs:738

◆ Dispose() [2/2]

override void AiliaPoseEstimatorModel.Dispose ( bool  disposing)
inlineprotectedvirtual

Reimplemented from AiliaModel.

744  {
745  if (disposing){
746  // release managed resource
747  }
748  Close(); // release unmanaged resource
749  base.Dispose(disposing);
750  }
override void Close()
Destroy the detection object.
Definition: AiliaPoseEstimatorModel.cs:723

◆ OpenEx()

override bool AiliaPoseEstimatorModel.OpenEx ( Ailia.ailiaFileCallback  callback,
IntPtr  arg1,
IntPtr  arg2 
)
inlinevirtual

Creates a network object from a file callback.

Parameters
callbackUser-defined file access callback function structure
alg1Argument pointer notified to AILIA_USER_API_FOPEN
alg2Argument pointer notified to AILIA_USER_API_FOPEN
Returns
If this funcyion is successful, it returns true.

Creates a network object from a file callback.

Reimplemented from AiliaModel.

104  {
105  Close();
106  bool status=base.OpenEx(callback,arg1,arg2);
107  if(status==false){
108  if(logging){
109  Debug.Log("ailiaModelOpenEx failed");
110  }
111  return false;
112  }
113  return OpenPoseEstimator();
114  }
bool logging
Definition: AiliaModel.cs:32
override void Close()
Destroy the detection object.
Definition: AiliaPoseEstimatorModel.cs:723

◆ OpenFile()

override bool AiliaPoseEstimatorModel.OpenFile ( string  prototxt,
string  model_path 
)
inlinevirtual

Create a network object from a model file.

Parameters
prototxtPath name of the prototxt file (MBSC or UTF16)
model_pathPathname of the protobuf/onnx file (MBSC or UTF16)
Returns
If this funcyion is successful, it returns true.

Create a network object from a model file.

Reimplemented from AiliaModel.

70  {
71  Close();
72  bool status=base.OpenFile(prototxt,model_path);
73  if(status==false){
74  if(logging){
75  Debug.Log("ailiaModelOpenFile failed");
76  }
77  return false;
78  }
79  return OpenPoseEstimator();
80  }
bool logging
Definition: AiliaModel.cs:32
override void Close()
Destroy the detection object.
Definition: AiliaPoseEstimatorModel.cs:723

◆ OpenMem()

override bool AiliaPoseEstimatorModel.OpenMem ( byte []  prototxt_buf,
byte []  model_buf 
)
inlinevirtual

Creates network objects from memory.

Parameters
prototxtPointer to data in prototxt file
model_pathPointer to data in protobuf/onnx file
Returns
If this funcyion is successful, it returns true.

Creates network objects from memory.

Reimplemented from AiliaModel.

136  {
137  Close();
138  bool status=base.OpenMem(prototxt_buf,model_buf);
139  if(status==false){
140  if(logging){
141  Debug.Log("ailiaModelOpenMem failed");
142  }
143  return false;
144  }
145  return OpenPoseEstimator();
146  }
bool logging
Definition: AiliaModel.cs:32
override void Close()
Destroy the detection object.
Definition: AiliaPoseEstimatorModel.cs:723

◆ SetThreshold()

bool AiliaPoseEstimatorModel.SetThreshold ( float  threshold)
inline

Sets the detection threshold.

Parameters
thresholdDetection threshold A value between 0.0 and 1.0; the smaller the value, the easier it is to detect.
Returns
Returns true on success, false on failure.

Set the detection threshold.

193  {
194  int status=AiliaPoseEstimator.ailiaPoseEstimatorSetThreshold(ailia_pose_estimator,threshold);
195  if(status!=Ailia.AILIA_STATUS_SUCCESS){
196  if(logging){
197  Debug.Log("ailiaPoseEstimatorSetThreshold failed "+status);
198  }
199  return false;
200  }
201  return true;
202  }
bool logging
Definition: AiliaModel.cs:32
Definition: Ailia.cs:20
const Int32 AILIA_STATUS_SUCCESS
Definition: Ailia.cs:34
Definition: AiliaPoseEstimator.cs:20
static int ailiaPoseEstimatorSetThreshold(IntPtr pose_estimator, float threshold)
Set the detection threshold.

◆ Settings()

bool AiliaPoseEstimatorModel.Settings ( uint  set_algorithm)
inline

Model setting.

Parameters
set_algorithmAlgorithm
Returns
Returns true on success.

Specifies the algorithm of the model.

45  {
46  algorithm=set_algorithm;
47  return true;
48  }

The documentation for this class was generated from the following file: