mayhug commited on
Commit
4ee3e3c
1 Parent(s): 6bc79d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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[:, :, [2, 1, 0]], TileMode[tile])
824
 
825
  _, ext = os.path.splitext(file.name)
826
  tempfile = mktemp(suffix=ext)
827
  cv2.imwrite(tempfile, result)
828
- return result, tempfile
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(