CoolFace
Apppublic

Sorobot/Document-modify-Toolkit

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes
predict.cpython-38.pyc18 linesDownload Raw Back to __pycache__
1U

2h�Hf0�@sLddlZej�d�ddlZddlZddlmZddlmZmZdd�Z	dS)�Nz!/home/aistudio/external-libraries�)�GeoTr)�to_image�	to_tensorcCs�d}t�|�}|d}t�}|�|�|��t�|�}t�|d�}t|�}t|�}	||�}3tj	j4j|5|	jdd�ddd�}6|7�
ddd	d8g�}tj	j9�|	|ddd�}t|�}
t�||
�dS)
Nz./Transform/best.ckpt�model)� r�ZbilinearF)�modeZ
align_cornersr�rrg�?)�paddle�loadrZset_state_dict�eval�cv2Zimread�resizer�nn�10functional�interpolate�shape�	transposeZgrid_samplerZimwrite)Z11input_path�output_pathZ12model_path�13checkpointZ14state_dictrZimg_org�img�x�y�bmZbm_nhwc�outZ	out_image�r�(D:\CodeProjects\as1\Transform\predict.py�run
s,151617�r)18�sys�path�appendrrr�utilsrrrrrrr�<module>s