Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -819,13 +819,13 @@ def main(file: IO[bytes], half: bool, weight: str, tile: str):
|
|
819 |
scale, weight_path=str(AVALIABLE_WEIGHTS[weight]), half=half, device=DEVICE
|
820 |
)
|
821 |
|
822 |
-
frame = cv2.imread(file.name)
|
823 |
-
result = upscaler(frame
|
824 |
|
825 |
_, ext = os.path.splitext(file.name)
|
826 |
tempfile = mktemp(suffix=ext)
|
827 |
cv2.imwrite(tempfile, result)
|
828 |
-
return
|
829 |
|
830 |
|
831 |
interface = Interface(
|
|
|
819 |
scale, weight_path=str(AVALIABLE_WEIGHTS[weight]), half=half, device=DEVICE
|
820 |
)
|
821 |
|
822 |
+
frame = cv2.cvtColor(cv2.imread(file.name), cv2.COLOR_BGR2RGB)
|
823 |
+
result = cv2.cvtColor(upscaler(frame, TileMode[tile]), cv2.COLOR_RGB2BGR)
|
824 |
|
825 |
_, ext = os.path.splitext(file.name)
|
826 |
tempfile = mktemp(suffix=ext)
|
827 |
cv2.imwrite(tempfile, result)
|
828 |
+
return tempfile, tempfile
|
829 |
|
830 |
|
831 |
interface = Interface(
|