jhj0517
commited on
Commit
·
58f4366
1
Parent(s):
6bbb445
Conver RGB2BGR
Browse files
modules/image_restoration/real_esrgan/real_esrgan_inferencer.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import os.path
|
2 |
import gradio as gr
|
3 |
import torch
|
|
|
4 |
from typing import Optional, Literal
|
5 |
|
6 |
from modules.utils.paths import *
|
@@ -93,6 +94,8 @@ class RealESRGANInferencer:
|
|
93 |
|
94 |
try:
|
95 |
output, img_mode = self.model.enhance(img_path, outscale=scale)
|
|
|
|
|
96 |
|
97 |
if overwrite:
|
98 |
output_path = img_path
|
|
|
1 |
import os.path
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
+
import cv2
|
5 |
from typing import Optional, Literal
|
6 |
|
7 |
from modules.utils.paths import *
|
|
|
94 |
|
95 |
try:
|
96 |
output, img_mode = self.model.enhance(img_path, outscale=scale)
|
97 |
+
if img_mode == "RGB":
|
98 |
+
output = cv2.cvtColor(output, cv2.COLOR_RGB2BGR)
|
99 |
|
100 |
if overwrite:
|
101 |
output_path = img_path
|