Files
MultimodalOCR/models/__pycache__/process.cpython-310.pyc

17 lines
1.2 KiB
Plaintext
Raw Normal View History

2023-05-17 03:38:36 +08:00
o
2023-05-23 18:24:16 +08:00
<00><>ed<65><00>@s,ddlZddlmZmZdd<04>Zdd<06>ZdS)<07>N)<02>Image<67>ImageOpsc
2023-05-17 03:38:36 +08:00
Cs<>|j\}}|\}}t||||<00>}t||d<00>}t||d<00>}|d7}|d7}|<00>||ftjj<06>}tj<05>d||fd<04>} | <09>|||d||df<02>| S)zd
:param image: input image
:param target_size: a tuple (num,num)
:return: new image
2023-05-23 18:24:16 +08:00
g<00>?<3F><><00>RGB)rrr<00>) <09>size<7A>min<69>int<6E>resize<7A>PILr<00>BICUBIC<49>new<65>paste)
<EFBFBD>image<67> target_size<7A>iw<69>ih<69>w<>h<>scale<6C>nw<6E>nhZ new_image<67>r<00>1/home/zhangli/GPT4/MutimodelOCR/models/process.py<70> pad_images
 rcCs<>|j\}}||}|dkr|d}t||<00>}n
|d}t||<00>}|<00>||f<02>}|d|jd}|d|jd}d} d}
|| } ||
} tj|| |
| | fdd<03>} | S)N<>r)<02>border<65>fill)rr r
r<00>expand)rr<00>width<74>height<68> aspect_ratio<69> new_width<74>
new_heightZ
width_diffZ height_diffZ left_paddingZ top_paddingZ right_paddingZbottom_paddingZ padded_imagerrr<00> resize_images
 r$)r rrrr$rrrr<00><module>s