
    gM                     *    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)PointHistoryClassifierc                    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score_thinvalid_value)selfr   r   r   r   s        T/var/www/html/VirtualCube/model/point_history_classifier/point_history_classifier.py__init__zPointHistoryClassifier.__init__   sw     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                  |            }t        j                  |      |   | j                  k  r| j                  }|S )Nr   index)dtype)r   r   
set_tensornparrayfloat32invoker   
get_tensorargmaxsqueezer   r   )r   point_historyinput_details_tensor_indexoutput_details_tensor_indexresultresult_indexs         r   __call__zPointHistoryClassifier.__call__   s     &*%7%7%:7%C"##&HHm_BJJ7	9 	!&*&9&9!&<W&E#!!,,-HIyyF!34::fl+dmm;--Lr   N)z>model/point_history_classifier/point_history_classifier.tfliteg      ?r      )__name__
__module____qualname__r   r'    r   r   r   r      s     T+"r   r   )numpyr   
tensorflowr   objectr   r,   r   r   <module>r0      s     %V %r   