0% found this document useful (0 votes)
43 views1 page

Image Processing with Real-ESRGAN

The document is a snippet of code from the Real-ESRGAN GitHub repository, specifically from the 'cog_predict.py' file. It includes function definitions and input parameters for image processing, such as scale, face enhancement, and tile size. The code also handles image reading and resizing based on certain conditions.

Uploaded by

RAYO RIO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views1 page

Image Processing with Real-ESRGAN

The document is a snippet of code from the Real-ESRGAN GitHub repository, specifically from the 'cog_predict.py' file. It includes function definitions and input parameters for image processing, such as scale, face enhancement, and tile size. The code also handles image reading and resizing based on certain conditions.

Uploaded by

RAYO RIO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

14/03/2025, 14:26 Real-ESRGAN/cog_predict.

py at master · xinntao/Real-ESRGAN · GitHub

87 default='General - v3'),
88 scale: float = Input(descrip
89 face_enhance: bool = Input(
90 description='Enhance fac
91 tile: int = Input(
92 description=
93 'Tile size. Default is 0
94 default=0)
95 ) -> Path:
96 if tile <= 100 or tile is No
97 tile = 0
98 print(f'img: {img}. version:
99 try:
100 extension = [Link]
101 img = [Link](str(img
102 if len([Link]) == 3 a
103 img_mode = 'RGBA'
104 elif len([Link]) == 2
105 img_mode = None
106 img = [Link](i
107 else:
108 img_mode = None
109
110 h, w = [Link][0:2]
111 if h < 300:
112 img = [Link](img
113
[Link] 5/7

You might also like