rustify-ml 0.1.2

Profile Python hotspots and auto-generate Rust + PyO3 stubs via maturin
Documentation
�

cǕi����SrSrSrSr\S:Xa�SSKr\"S5Vs/sHn\"US-5S	-PM snr\R
"5r	\"S
5H
r
\"\SS5 M \R
"5\	-
r\"S
\SS35 \R
"5r	\"S
5Hr
\"\S5 M \R
"5\	-
r\"S\SS35 ggs snf)z�
Numpy-style image augmentation loop - target for rustify-ml acceleration.
Expected gain: 5-20x via Rust ndarray + rayon parallel iter.
c�r�S/[U5-n[[U55HnXU-
U-X4'M U$)z;Normalize a flat pixel array: (x - mean) / std per element.���len�range)�pixels�mean�std�result�is     �Cd:\WindsurfProjects\rustify\rustify-ml\examples\image_preprocess.py�normalize_pixelsr
s=���U�S��[�
 �F�
�3�v�;�
���Y��%��,��	� ��M�c�l�S/[U5-n[[U55HnXU-X#'M U$)z5Apply gamma correction to each pixel value in [0, 1].rr)r�gammar
rs    r�apply_gammars8���U�S��[�
 �F�
�3�v�;�
���I��&��	� ��Mrc�t�SnSn[U[U5U5HnX0U-
nUS-
nM US:�aX4-$S$)z;Compute mean of a single channel from interleaved RGB data.r��)rr)r�channels�channel_idx�total�countrs      r�channel_meanrsM���E�
�E�
�;��F��X�
6��
�����
��
��7�"�A�I�5�=�.�3�.r�__main__rNiL�g�o@�2g
ףp=
�?gZd;�O�?znormalize_pixels 224x224x3: z.3fzs for 50 iterationsg������@zapply_gamma 224x224x3: )
�__doc__r
rr�__name__�timer�floatr�start�_�elapsed�print)rs0r�<module>r%s������/��z���.3�M�.B�
C�.B��e�A��G�n�u�$�.B�
C�F��I�I�K�E�
�2�Y������.���i�i�k�E�!�G�	�(���
�5H�
I�J��I�I�K�E�
�2�Y���F�C� ���i�i�k�E�!�G�	�#�G�C�=�0C�
D�E���Ds�C