Spaces:
mikitona
/
Running on Zero

mikitona commited on
Commit
70f1ccf
·
verified ·
1 Parent(s): fc23e64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -152,7 +152,10 @@ def stage1_process(
152
  LQ = (LQ[0].permute(1, 2, 0) * 127.5 + 127.5).cpu().numpy().round().clip(0, 255).astype(np.uint8)
153
  # gamma correction
154
  LQ = LQ / 255.0
155
- LQ = np.power(LQ, gamma_correction)
 
 
 
156
  LQ *= 255.0
157
  LQ = LQ.round().clip(0, 255).astype(np.uint8)
158
  print('<<== stage1_process')
 
152
  LQ = (LQ[0].permute(1, 2, 0) * 127.5 + 127.5).cpu().numpy().round().clip(0, 255).astype(np.uint8)
153
  # gamma correction
154
  LQ = LQ / 255.0
155
+ #LQ = np.power(LQ, gamma_correction)
156
+ LQ = np.power(LQ, float(gamma_correction) if isinstance(gamma_correction, (int, float)) else gamma_correction.value)
157
+
158
+
159
  LQ *= 255.0
160
  LQ = LQ.round().clip(0, 255).astype(np.uint8)
161
  print('<<== stage1_process')