Chakshu123 commited on
Commit
596557e
1 Parent(s): 6f2e604

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -217,11 +217,11 @@ def colorize2(img: Image.Image, model_option: str):
217
  if not isinstance(img, dict):
218
  return gr.update(visible=True)
219
 
220
- if hint_mode == "Model 1":
221
  model_int = 0
222
- elif hint_mode == "Model 2":
223
  model_int = 0
224
-
225
  with torch.inference_mode():
226
  out2 = model_net(input)
227
  out2 = sample[0].cpu().numpy().transpose([1,2,0])
 
217
  if not isinstance(img, dict):
218
  return gr.update(visible=True)
219
 
220
+ if model_option == "Model 1":
221
  model_int = 0
222
+ elif model_option == "Model 2":
223
  model_int = 0
224
+ input = torch.from_numpy(np.asarray(img))[None,None].float().to(device) / 255.0 * 2 - 1
225
  with torch.inference_mode():
226
  out2 = model_net(input)
227
  out2 = sample[0].cpu().numpy().transpose([1,2,0])