
    gW                     *    d dl Zd dlZ G d de      Zy)    Nc                       e Zd Z	 	 ddZd Zy)KeyPointClassifierc                     t         j                  j                  ||      | _        | j                  j	                          | j                  j                         | _        | j                  j                         | _        y )N)
model_pathnum_threads)	tfliteInterpreterinterpreterallocate_tensorsget_input_detailsinput_detailsget_output_detailsoutput_details)selfr   r   s      J/var/www/html/VirtualCube/model/keypoint_classifier/keypoint_classifier.py__init__zKeyPointClassifier.__init__   sh    
 77..*;F / H 	))+!--??A"..AAC    c                    | j                   d   d   }| j                  j                  |t        j                  |gt        j
                               | j                  j                          | j                  d   d   }| j                  j                  |      }t        j                  t        j                  |            }|S )Nr   index)dtype)r   r   
set_tensornparrayfloat32invoker   
get_tensorargmaxsqueeze)r   landmark_listinput_details_tensor_indexoutput_details_tensor_indexresultresult_indexs         r   __call__zKeyPointClassifier.__call__   s     &*%7%7%:7%C"##&HHm_BJJ7	9 	!&*&9&9!&<W&E#!!,,-HIyyF!34r   N)z4model/keypoint_classifier/keypoint_classifier.tflite   )__name__
__module____qualname__r   r%    r   r   r   r      s     J
Dr   r   )numpyr   
tensorflowr   objectr   r*   r   r   <module>r.      s      r   